diff --git a/config/ags/current-window/current-window.js b/config/ags/current-window/current-window.js new file mode 100644 index 0000000..8e98da1 --- /dev/null +++ b/config/ags/current-window/current-window.js @@ -0,0 +1,16 @@ +// https://github.com/Aylur/ags/wiki/Widgets + +const { Hyprland } = ags.Service; +const { Label } = ags.Widget; +const { Gtk } = imports.gi; + +const currentWindow = () => Label({ + style: 'color: #CBA6F7; font-size: 18px', + connections: [ + [Hyprland, label => { + label.label = Hyprland.active.client.title; + }, 'changed'], + ], +}); + +export const CurrentWindow = currentWindow(); diff --git a/config/ags/traybuttons/traybuttons.js b/config/ags/traybuttons/traybuttons.js index 5a98615..6e7ef42 100644 --- a/config/ags/traybuttons/traybuttons.js +++ b/config/ags/traybuttons/traybuttons.js @@ -1,5 +1,6 @@ import Gdk from 'gi://Gdk'; const display = Gdk.Display.get_default(); +import { CurrentWindow } from 'file:///home/matt/.nix/config/ags/current-window/current-window.js'; const Separator = () => ags.Widget.Box({ style: 'min-width: 8px; min-height: 8px', @@ -129,10 +130,7 @@ export const LeftBar = ags.Widget.Window({ ], }), - ags.Widget.Box({ - halign: 'center', - style: 'background: red; min-width: 100px; min-height: 40px', - }), + CurrentWindow, ags.Widget.Box({ halign: 'end',