diff options
| author | Kiran George <kirangeorge1995@gmail.com> | 2024-04-24 22:19:05 +0530 |
|---|---|---|
| committer | Kiran George <kirangeorge1995@gmail.com> | 2024-05-04 11:00:00 +0530 |
| commit | dc9f0cd58454b4cb33a704b11e4cc8a7c6594e67 (patch) | |
| tree | 02aff524a96c620f2f603dbb45f7017256981148 /config/ags/modules/overview/actions.js | |
| parent | 425df5f3a17a72ba41973dedf0673bd8dd607385 (diff) | |
Added ags overview widget
Updated search iscon for overview search result suggested action
Removed excluded site from overview web search
Updated calculator icon for overview
Updated overview search action icon spacing
Added initial pywal integration to overview search and updated seach icon
Diffstat (limited to 'config/ags/modules/overview/actions.js')
| -rw-r--r-- | config/ags/modules/overview/actions.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/ags/modules/overview/actions.js b/config/ags/modules/overview/actions.js new file mode 100644 index 00000000..766cf454 --- /dev/null +++ b/config/ags/modules/overview/actions.js @@ -0,0 +1,28 @@ +import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; +import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js'; + +function moveClientToWorkspace(address, workspace) { + Utils.execAsync(['bash', '-c', `hyprctl dispatch movetoworkspacesilent ${workspace},address:${address} &`]); +} + +export function dumpToWorkspace(from, to) { + if (from == to) return; + Hyprland.clients.forEach(client => { + if (client.workspace.id == from) { + moveClientToWorkspace(client.address, to); + } + }); +} + +export function swapWorkspace(workspaceA, workspaceB) { + if (workspaceA == workspaceB) return; + const clientsA = []; + const clientsB = []; + Hyprland.clients.forEach(client => { + if (client.workspace.id == workspaceA) clientsA.push(client.address); + if (client.workspace.id == workspaceB) clientsB.push(client.address); + }); + + clientsA.forEach((address) => moveClientToWorkspace(address, workspaceB)); + clientsB.forEach((address) => moveClientToWorkspace(address, workspaceA)); +}
\ No newline at end of file |
