aboutsummaryrefslogtreecommitdiffstats
path: root/config/ags/modules/overview/actions.js
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-07-19 17:27:14 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-07-19 17:27:14 +0900
commit3c1cc04020678b76a622a1a7a28a2c1e529f7665 (patch)
treec191782fc9e8c9eee61f64450726c77a3cae65ed /config/ags/modules/overview/actions.js
parentef1b52470a5fd2ec4b5b24ea6c1d56ca62c3c9fa (diff)
updated copy.sh and still added ags
Diffstat (limited to 'config/ags/modules/overview/actions.js')
-rw-r--r--config/ags/modules/overview/actions.js28
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage