✨ ags: add center-window and logout-menu windows and more
This commit is contained in:
@@ -21,11 +21,11 @@ export function Audio() {
|
||||
child: new Widget.Box({
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "icon nf",
|
||||
className: "nf",
|
||||
label: ""
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "icon nf",
|
||||
className: "volume",
|
||||
label: bind(Wireplumber.getDefault().getDefaultSink(), "volume").as((volume: number) =>
|
||||
Math.floor(volume * 100) + "%")
|
||||
} as Widget.LabelProps)
|
||||
@@ -42,22 +42,21 @@ export function Audio() {
|
||||
child: new Widget.Box({
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "icon",
|
||||
className: "nf",
|
||||
label: ""
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "volume",
|
||||
label: bind(Wireplumber.getDefault().getDefaultSource(), "volume").as((volume: number) =>
|
||||
Math.floor(volume * 100) + "%")
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
})
|
||||
} as Widget.EventBoxProps),
|
||||
new Widget.Box({
|
||||
className: "notification-bell",
|
||||
child: new Widget.Label({
|
||||
label: ""
|
||||
} as Widget.LabelProps)
|
||||
} as Widget.BoxProps)
|
||||
new Widget.Label({
|
||||
className: "bell nf",
|
||||
label: ""
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
} as Widget.EventBoxProps);
|
||||
|
||||
@@ -17,13 +17,13 @@ export function FocusedClient() {
|
||||
(getAppIcon(client.initialClass) || client.initialClass)
|
||||
:
|
||||
"image-missing"
|
||||
),
|
||||
iconSize: Gtk.IconSize.SMALL_TOOLBAR
|
||||
)
|
||||
}),
|
||||
new Widget.Box({
|
||||
className: "text-content",
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
homogeneous: false,
|
||||
valign: Gtk.Align.CENTER,
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "class",
|
||||
|
||||
@@ -7,7 +7,8 @@ export function Logo() {
|
||||
//tooltipText: tr("bar.logo.tooltip"),
|
||||
child: new Widget.Button({
|
||||
onClick: () => AstalHyprland.get_default().dispatch("exec", "anyrun"),
|
||||
label: ""
|
||||
className: "nf",
|
||||
label: "",
|
||||
} as Widget.ButtonProps)
|
||||
} as Widget.BoxProps);
|
||||
}
|
||||
|
||||
+15
-11
@@ -1,4 +1,4 @@
|
||||
import { bind, Process } from "astal";
|
||||
import { bind, GLib, Process } from "astal";
|
||||
import { Gtk, Widget } from "astal/gtk3";
|
||||
import AstalMpris from "gi://AstalMpris";
|
||||
import { Separator, SeparatorProps } from "../Separator";
|
||||
@@ -19,25 +19,29 @@ export function Media(): Gtk.Widget {
|
||||
transitionDuration: 260,
|
||||
revealChild: false,
|
||||
child: new Widget.Box({
|
||||
className: "media-controls",
|
||||
className: "media-controls button-row",
|
||||
expand: false,
|
||||
homogeneous: false,
|
||||
children: bind(mpris, "players").as((players: Array<AstalMpris.Player>) =>
|
||||
players[0] ? [
|
||||
new Widget.Button({
|
||||
className: "link",
|
||||
label: "",
|
||||
visible: bind(players[0], "metadata").as(metadata =>
|
||||
metadata?.["xesam:url"] ? true : false),
|
||||
onClick: () => Process.exec(`echo ${players[0].metadata.url}"`)
|
||||
className: "link nf",
|
||||
label: "",
|
||||
tooltipText: "Copy link to Clipboard",
|
||||
visible: bind(players[0], "metadata").as((_metadata: GLib.HashTable) =>
|
||||
players[0].get_meta("xesam:url") === null),
|
||||
onClick: () => Process.exec(`wl-copy ${players[0].get_meta("xesam:url")?.get_string()[0]}`)
|
||||
} as Widget.ButtonProps),
|
||||
new Widget.Button({
|
||||
className: "previous",
|
||||
className: "previous nf",
|
||||
label: "",
|
||||
tooltipText: "Previous",
|
||||
onClick: () => players[0].canGoPrevious && players[0].previous()
|
||||
} as Widget.ButtonProps),
|
||||
new Widget.Button({
|
||||
className: "pause",
|
||||
className: "pause nf",
|
||||
tooltipText: bind(players[0], "playback_status").as((status: AstalMpris.PlaybackStatus) =>
|
||||
status === AstalMpris.PlaybackStatus.PLAYING ? "Pause" : "Play"),
|
||||
label: bind(players[0], "playbackStatus").as((status: AstalMpris.PlaybackStatus) =>
|
||||
status === AstalMpris.PlaybackStatus.PLAYING ? "" : ""),
|
||||
onClick: () => {
|
||||
@@ -48,7 +52,7 @@ export function Media(): Gtk.Widget {
|
||||
}
|
||||
} as Widget.ButtonProps),
|
||||
new Widget.Button({
|
||||
className: "next",
|
||||
className: "next nf",
|
||||
label: "",
|
||||
onClick: () => players[0].canGoNext && players[0].next()
|
||||
} as Widget.ButtonProps)
|
||||
@@ -69,7 +73,7 @@ export function Media(): Gtk.Widget {
|
||||
children: bind(mpris, "players").as((players: Array<AstalMpris.Player>) =>
|
||||
players[0] ? [
|
||||
new Widget.Label({
|
||||
className: "icon",
|
||||
className: "player-icon nf",
|
||||
label: bind(players[0], "busName").as((busName: string) => {
|
||||
const playerName: string = busName.split('.')[busName.split('.').length-1];
|
||||
return playerIcons[playerName as keyof typeof playerIcons] || "";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { bind } from "astal";
|
||||
import { bind, Gio } from "astal";
|
||||
import { Gtk, Widget } from "astal/gtk3";
|
||||
import AstalTray from "gi://AstalTray"
|
||||
|
||||
@@ -19,7 +19,7 @@ export function Tray() {
|
||||
direction: Gtk.ArrowType.DOWN,
|
||||
halign: Gtk.Align.CENTER,
|
||||
child: new Widget.Icon({
|
||||
gIcon: bind(item, "gicon"),
|
||||
gicon: bind(item, "gicon"),
|
||||
iconSize: Gtk.IconSize.SMALL_TOOLBAR
|
||||
})
|
||||
} as Widget.MenuButtonProps)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Gtk, Widget } from "astal/gtk3";
|
||||
|
||||
export const BigMedia: Gtk.Widget = new Widget.Box({
|
||||
className: "big-media",
|
||||
//TODO
|
||||
} as Widget.BoxProps);
|
||||
@@ -0,0 +1,73 @@
|
||||
import { bind } from "astal";
|
||||
import { Gtk, Widget } from "astal/gtk3";
|
||||
import AstalNotifd from "gi://AstalNotifd";
|
||||
import { Notifications } from "../../scripts/notification-handler";
|
||||
|
||||
export const NotificationHistory: Gtk.Widget = new Widget.Scrollable({
|
||||
hscroll: Gtk.PolicyType.NEVER,
|
||||
vscroll: Gtk.PolicyType.AUTOMATIC,
|
||||
child: new Widget.Box({
|
||||
className: "notifications",
|
||||
children: bind(Notifications, "notificationHistory").as((history: Array<AstalNotifd.Notification>) =>
|
||||
history && history.length > 0 && history.map((notification: AstalNotifd.Notification) =>
|
||||
new Widget.Box({
|
||||
className: "notification",
|
||||
hexpand: true,
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "top",
|
||||
expand: true,
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "app",
|
||||
children: [
|
||||
new Widget.Icon({
|
||||
icon: notification.appIcon || notification.appName.toLowerCase(),
|
||||
iconSize: Gtk.IconSize.LARGE_TOOLBAR
|
||||
}),
|
||||
new Widget.Label({
|
||||
className: "name",
|
||||
label: notification.appName || "Unknown"
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
} as Widget.BoxProps),
|
||||
new Widget.Button({
|
||||
className: "remove",
|
||||
label: "",
|
||||
onClick: () => Notifications.removeFromNotificationHistory(notification.id)
|
||||
} as Widget.ButtonProps)
|
||||
]
|
||||
} as Widget.BoxProps),
|
||||
new Widget.Box({
|
||||
className: "content",
|
||||
expand: true,
|
||||
children: [
|
||||
new Widget.Box({
|
||||
className: "image",
|
||||
visible: notification.image !== "",
|
||||
css: `.image { background-image: url('${notification.image}') }`
|
||||
} as Widget.BoxProps),
|
||||
new Widget.Box({
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "summary",
|
||||
useMarkup: true,
|
||||
label: notification.summary
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Label({
|
||||
className: "body",
|
||||
useMarkup: true,
|
||||
label: notification.body
|
||||
} as Widget.LabelProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
]
|
||||
} as Widget.BoxProps)
|
||||
)
|
||||
)
|
||||
} as Widget.BoxProps)
|
||||
} as Widget.ScrollableProps)
|
||||
@@ -10,6 +10,7 @@ const uptime = new Variable<string>("Just turned on")
|
||||
|
||||
function LockButton(): Widget.Button {
|
||||
return new Widget.Button({
|
||||
className: "nf",
|
||||
label: "",
|
||||
onClick: () => AstalHyprland.get_default().dispatch("exec", "hyprlock")
|
||||
} as Widget.ButtonProps)
|
||||
@@ -17,6 +18,7 @@ function LockButton(): Widget.Button {
|
||||
|
||||
function ColorPickerButton(): Widget.Button {
|
||||
return new Widget.Button({
|
||||
className: "nf",
|
||||
label: "",
|
||||
onClick: () => AstalHyprland.get_default().dispatch(
|
||||
"exec",
|
||||
@@ -27,6 +29,7 @@ function ColorPickerButton(): Widget.Button {
|
||||
|
||||
function ScreenshotButton(): Widget.Button {
|
||||
return new Widget.Button({
|
||||
className: "nf",
|
||||
label: "",
|
||||
onClick: () => Process.exec_async(
|
||||
"bash -c 'hyprshot -m region -o $HOME/Screenshots'",
|
||||
@@ -37,6 +40,7 @@ function ScreenshotButton(): Widget.Button {
|
||||
|
||||
function SelectWallpaperButton(): Widget.Button {
|
||||
return new Widget.Button({
|
||||
className: "nf",
|
||||
label: "",
|
||||
onClick: () => Process.exec_async(
|
||||
"bash -c 'sh $HOME/.config/hypr/scripts/change-wallpaper.sh'",
|
||||
@@ -47,6 +51,7 @@ function SelectWallpaperButton(): Widget.Button {
|
||||
|
||||
function LogoutButton(): Widget.Button {
|
||||
return new Widget.Button({
|
||||
className: "nf",
|
||||
label: "",
|
||||
onClick: () => Process.exec_async(
|
||||
"bash -c 'wlogout -b 5'",
|
||||
|
||||
@@ -10,9 +10,10 @@ export const Sliders: Gtk.Widget = new Widget.Box({
|
||||
new Widget.Box({
|
||||
className: "sink speaker",
|
||||
children: [
|
||||
new Widget.Icon({
|
||||
icon: "audio-volume-high-symbolic"
|
||||
} as Widget.IconProps),
|
||||
new Widget.Label({
|
||||
className: "nf icon",
|
||||
label: ""
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Slider({
|
||||
drawValue: false,
|
||||
hexpand: true,
|
||||
@@ -26,9 +27,10 @@ export const Sliders: Gtk.Widget = new Widget.Box({
|
||||
new Widget.Box({
|
||||
className: "source microphone",
|
||||
children: [
|
||||
new Widget.Icon({
|
||||
icon: "microphone-sensitivity-high-symbolic"
|
||||
} as Widget.IconProps),
|
||||
new Widget.Label({
|
||||
className: "nf icon",
|
||||
label: ""
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Slider({
|
||||
drawValue: false,
|
||||
hexpand: true,
|
||||
@@ -42,6 +44,10 @@ export const Sliders: Gtk.Widget = new Widget.Box({
|
||||
/*new Widget.Box({
|
||||
className: "brightness screen",
|
||||
children: [
|
||||
new Widget.Label({
|
||||
className: "icon nf",
|
||||
label: ""
|
||||
} as Widget.LabelProps),
|
||||
new Widget.Slider({
|
||||
drawValue: false,
|
||||
hexpand: true,
|
||||
|
||||
@@ -5,6 +5,7 @@ export const tileList: Array<Gtk.Widget> = [
|
||||
|
||||
export const Tiles: Widget.Box = new Widget.Box({
|
||||
child: new Gtk.Grid({
|
||||
visible: true,
|
||||
orientation: Gtk.Orientation.HORIZONTAL,
|
||||
rowHomogeneous: true
|
||||
} as Gtk.Grid.ConstructorProps)
|
||||
|
||||
Reference in New Issue
Block a user