diff --git a/.config/ags/modules/bar/focus/workspaces_hyprland.js b/.config/ags/modules/bar/focus/workspaces_hyprland.js index 12a3982a9..77fe47935 100644 --- a/.config/ags/modules/bar/focus/workspaces_hyprland.js +++ b/.config/ags/modules/bar/focus/workspaces_hyprland.js @@ -172,8 +172,8 @@ const WorkspaceContents = (count = 10) => { export default () => EventBox({ onScrollUp: () => Hyprland.messageAsync(`dispatch workspace -1`).catch(print), onScrollDown: () => Hyprland.messageAsync(`dispatch workspace +1`).catch(print), - onMiddleClickRelease: () => App.toggleWindow('overview'), - onSecondaryClickRelease: () => App.toggleWindow('osk'), + onMiddleClick: () => toggleWindowOnAllMonitors('osk'), + onSecondaryClick: () => App.toggleWindow('overview'), attribute: { clicked: false, ws_group: 0, diff --git a/.config/ags/modules/bar/focus/workspaces_sway.js b/.config/ags/modules/bar/focus/workspaces_sway.js index e40c7c098..02fed9fa4 100644 --- a/.config/ags/modules/bar/focus/workspaces_sway.js +++ b/.config/ags/modules/bar/focus/workspaces_sway.js @@ -147,8 +147,8 @@ const WorkspaceContents = (count = 10) => { export default () => EventBox({ onScrollUp: (self) => switchToRelativeWorkspace(self, -1), onScrollDown: (self) => switchToRelativeWorkspace(self, +1), - onMiddleClickRelease: () => App.toggleWindow('overview'), - onSecondaryClickRelease: () => App.toggleWindow('osk'), + onMiddleClick: () => toggleWindowOnAllMonitors('osk'), + onSecondaryClick: () => App.toggleWindow('overview'), attribute: { clicked: false }, child: Box({ homogeneous: true, diff --git a/.config/ags/modules/bar/normal/system.js b/.config/ags/modules/bar/normal/system.js index 820e1d6fc..e97374f16 100644 --- a/.config/ags/modules/bar/normal/system.js +++ b/.config/ags/modules/bar/normal/system.js @@ -78,7 +78,7 @@ const Utilities = () => Box({ }), UtilButton({ name: 'Toggle on-screen keyboard', icon: 'keyboard', onClicked: () => { - App.toggleWindow('osk'); + toggleWindowOnAllMonitors('osk'); } }), ] diff --git a/.config/ags/modules/bar/normal/workspaces_hyprland.js b/.config/ags/modules/bar/normal/workspaces_hyprland.js index 20adf4f9f..87ac53bc7 100644 --- a/.config/ags/modules/bar/normal/workspaces_hyprland.js +++ b/.config/ags/modules/bar/normal/workspaces_hyprland.js @@ -149,7 +149,7 @@ const WorkspaceContents = (count = 10) => { export default () => EventBox({ onScrollUp: () => Hyprland.messageAsync(`dispatch workspace -1`).catch(print), onScrollDown: () => Hyprland.messageAsync(`dispatch workspace +1`).catch(print), - onMiddleClick: () => App.toggleWindow('osk'), + onMiddleClick: () => toggleWindowOnAllMonitors('osk'), onSecondaryClick: () => App.toggleWindow('overview'), attribute: { clicked: false, diff --git a/.config/ags/modules/bar/normal/workspaces_sway.js b/.config/ags/modules/bar/normal/workspaces_sway.js index e40c7c098..02fed9fa4 100644 --- a/.config/ags/modules/bar/normal/workspaces_sway.js +++ b/.config/ags/modules/bar/normal/workspaces_sway.js @@ -147,8 +147,8 @@ const WorkspaceContents = (count = 10) => { export default () => EventBox({ onScrollUp: (self) => switchToRelativeWorkspace(self, -1), onScrollDown: (self) => switchToRelativeWorkspace(self, +1), - onMiddleClickRelease: () => App.toggleWindow('overview'), - onSecondaryClickRelease: () => App.toggleWindow('osk'), + onMiddleClick: () => toggleWindowOnAllMonitors('osk'), + onSecondaryClick: () => App.toggleWindow('overview'), attribute: { clicked: false }, child: Box({ homogeneous: true, diff --git a/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js b/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js index 4e8c3445e..772238d8e 100644 --- a/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js +++ b/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js @@ -209,7 +209,8 @@ const KeyboardWindow = () => Box({ }) ], setup: (self) => self.hook(App, (self, name, visible) => { // Update on open - if (name == 'osk' && visible) { + if(!name) return; + if (name.startsWith('osk') && visible) { self.setCss(`margin-bottom: -0px;`); } }), diff --git a/.config/ags/variables.js b/.config/ags/variables.js index ec60aa179..efc0beb55 100644 --- a/.config/ags/variables.js +++ b/.config/ags/variables.js @@ -33,25 +33,19 @@ globalThis['cycleMode'] = () => { // // Window controls const range = (length, start = 1) => Array.from({ length }, (_, i) => i + start); globalThis['toggleWindowOnAllMonitors'] = (name) => { - function forMonitors(widget) { - range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { - App.toggleWindow(`${name}${id}`); - }); - } + range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { + App.toggleWindow(`${name}${id}`); + }); } globalThis['closeWindowOnAllMonitors'] = (name) => { - function forMonitors(widget) { - range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { - App.closeWindow(`${name}${id}`); - }); - } + range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { + App.closeWindow(`${name}${id}`); + }); } globalThis['openWindowOnAllMonitors'] = (name) => { - function forMonitors(widget) { - range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { - App.openWindow(`${name}${id}`); - }); - } + range(Gdk.Display.get_default()?.get_n_monitors() || 1, 0).forEach(id => { + App.openWindow(`${name}${id}`); + }); } globalThis['closeEverything'] = () => {