diff --git a/.config/ags/modules/.commonwidgets/statusicons.js b/.config/ags/modules/.commonwidgets/statusicons.js index d74cf9979..fbfe7a861 100644 --- a/.config/ags/modules/.commonwidgets/statusicons.js +++ b/.config/ags/modules/.commonwidgets/statusicons.js @@ -204,16 +204,15 @@ export const NetworkIndicator = () => Widget.Stack({ const HyprlandXkbKeyboardLayout = async ({ useFlag } = {}) => { try { const Hyprland = (await import('resource:///com/github/Aylur/ags/service/hyprland.js')).default; - var initLangs = []; var languageStackArray = []; - var currentKeyboard; const updateCurrentKeyboards = () => { - currentKeyboard = JSON.parse(Utils.exec('hyprctl -j devices')).keyboards - .find(device => device.name === 'at-translated-set-2-keyboard'); - if (currentKeyboard) { - initLangs = currentKeyboard.layout.split(',').map(lang => lang.trim()); - } + var initLangs = []; + JSON.parse(Utils.exec('hyprctl -j devices')).keyboards + .forEach(keyboard => { + initLangs.push(...keyboard.layout.split(',').map(lang => lang.trim())); + }); + initLangs = [...new Set(initLangs)]; languageStackArray = Array.from({ length: initLangs.length }, (_, i) => { const lang = languages.find(lang => lang.layout == initLangs[i]); // if (!lang) return [ diff --git a/.config/ags/modules/indicators/musiccontrols.js b/.config/ags/modules/indicators/musiccontrols.js index 72e3f2648..d39b49b4c 100644 --- a/.config/ags/modules/indicators/musiccontrols.js +++ b/.config/ags/modules/indicators/musiccontrols.js @@ -180,7 +180,7 @@ const CoverArt = ({ player, ...rest }) => { // const player = Mpris.getPlayer(); // Maybe no need to re-get player.. can't remember why I had this // Player closed // Note that cover path still remains, so we're checking title - if (!player || player.trackTitle == "") { + if (!player || player.trackTitle == "" || !player.coverPath) { self.css = `background-image: none;`; // CSS image App.applyCss(`${COMPILED_STYLE_DIR}/style.css`); return; diff --git a/.config/ags/modules/sideright/quicktoggles.js b/.config/ags/modules/sideright/quicktoggles.js index 1c33c1bf2..39b08c908 100644 --- a/.config/ags/modules/sideright/quicktoggles.js +++ b/.config/ags/modules/sideright/quicktoggles.js @@ -78,7 +78,7 @@ export const HyprToggleIcon = async (icon, name, hyprlandConfigValue, props = {} } } -export const ModuleNightLight = (props = {}) => Widget.Button({ // TODO: Make this work +export const ModuleNightLight = (props = {}) => Widget.Button({ attribute: { enabled: false, }, @@ -87,13 +87,25 @@ export const ModuleNightLight = (props = {}) => Widget.Button({ // TODO: Make th onClicked: (self) => { self.attribute.enabled = !self.attribute.enabled; self.toggleClassName('sidebar-button-active', self.attribute.enabled); - if (self.attribute.enabled) Utils.execAsync(['wlsunset', '-t', '4500']).catch(print) - else Utils.execAsync('pkill wlsunset').catch(print); + if (self.attribute.enabled) Utils.execAsync('gammastep').catch(print) + else Utils.execAsync('pkill gammastep') + .then(() => { + // disable the button until fully terminated to avoid race + self.sensitive = false; + const source = setInterval(() => { + Utils.execAsync('pkill -0 gammastep') + .catch(() => { + self.sensitive = true; + source.destroy(); + }); + }, 500); + }) + .catch(print); }, child: MaterialIcon('nightlight', 'norm'), setup: (self) => { setupCursorHover(self); - self.attribute.enabled = !!exec('pidof wlsunset'); + self.attribute.enabled = !!exec('pidof gammastep'); self.toggleClassName('sidebar-button-active', self.attribute.enabled); }, ...props, @@ -235,6 +247,3 @@ export const ModulePowerIcon = (props = {}) => Widget.Button({ setupCursorHover(button); } }) - - - diff --git a/.config/ags/services/gpt.js b/.config/ags/services/gpt.js index b19d46702..eae64a32b 100644 --- a/.config/ags/services/gpt.js +++ b/.config/ags/services/gpt.js @@ -237,7 +237,7 @@ class GPTService extends Service { send(msg) { this._messages.push(new GPTMessage('user', msg, false, true)); this.emit('newMsg', this._messages.length - 1); - const aiResponse = new GPTMessage('assistant', 'thinking...', true, false) + const aiResponse = new GPTMessage('assistant', '', true, false) const body = { model: CHAT_MODELS[this._modelIndex], diff --git a/.config/hypr/hyprland/execs.conf b/.config/hypr/hyprland/execs.conf index ef0c62baa..936429f6e 100644 --- a/.config/hypr/hyprland/execs.conf +++ b/.config/hypr/hyprland/execs.conf @@ -1,5 +1,6 @@ # Bar, wallpaper exec-once = swww-daemon --format xrgb +exec-once = /usr/lib/geoclue-2.0/demos/agent exec-once = ags & # Input method @@ -19,5 +20,3 @@ exec-once = wl-paste --type image --watch cliphist store # Cursor exec-once = hyprctl setcursor Bibata-Modern-Classic 24 - - diff --git a/scriptdata/dependencies.conf b/scriptdata/dependencies.conf index 1c9f1760c..c93a37c6c 100644 --- a/scriptdata/dependencies.conf +++ b/scriptdata/dependencies.conf @@ -26,7 +26,7 @@ pavucontrol wireplumber libdbusmenu-gtk3 playerctl swww webp-pixbuf-loader gtk-layer-shell gtk3 gtksourceview3 gobject-introspection upower yad ydotool ### Gnome -polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager wlsunset gnome-bluetooth-3.0 +polkit-gnome gnome-keyring gnome-control-center blueberry networkmanager gammastep gnome-bluetooth-3.0 ### Backlight brightnessctl ddcutil