aboutsummaryrefslogtreecommitdiff
path: root/gui/pkgs
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-15 22:27:32 +0100
committerAdrian Kummerlaender2019-02-15 22:27:32 +0100
commit18425fd98eae360ab4af07abe724658875e732ec (patch)
tree2d2db1a6a99cf9bcda4b902f51fbe0ddd697a06f /gui/pkgs
parent5d9a1fbfb0ccab88a8e6e00cbe5e9f1dc06a915d (diff)
downloadnixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar.gz
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar.bz2
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar.lz
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar.xz
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.tar.zst
nixos_home-18425fd98eae360ab4af07abe724658875e732ec.zip
Add custom script for cycling workspaces in touchegg
Diffstat (limited to 'gui/pkgs')
-rwxr-xr-xgui/pkgs/bin/uictrl.sh16
-rw-r--r--gui/pkgs/uictrl.nix9
2 files changed, 25 insertions, 0 deletions
diff --git a/gui/pkgs/bin/uictrl.sh b/gui/pkgs/bin/uictrl.sh
new file mode 100755
index 0000000..46c7219
--- /dev/null
+++ b/gui/pkgs/bin/uictrl.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env fish
+
+function cycle
+ set nsp_ws (wmctrl -d | awk '{if ($9 == "NSP") {print $1}}')
+ set current_ws (wmctrl -d | awk '{if ($2 == "*") {print $1}}')
+
+ wmctrl -l | awk -v current_ws=$current_ws -v nsp_ws=$nsp_ws '{if ($2 > current_ws && $2 != nsp_ws) {print $2}}' | uniq
+ wmctrl -l | awk -v current_ws=$current_ws -v nsp_ws=$nsp_ws '{if ($2 < current_ws && $2 != nsp_ws) {print $2}}' | uniq
+end
+
+switch $argv[1]
+ case next
+ wmctrl -s (cycle)[1]
+ case prev
+ wmctrl -s (cycle | tac)[1]
+end
diff --git a/gui/pkgs/uictrl.nix b/gui/pkgs/uictrl.nix
new file mode 100644
index 0000000..0c965ad
--- /dev/null
+++ b/gui/pkgs/uictrl.nix
@@ -0,0 +1,9 @@
+{ stdenv, pkgs, ... }:
+
+pkgs.writeTextFile {
+ name = "uictrl";
+ executable = true;
+ destination = "/bin/uictrl";
+
+ text = builtins.readFile ./bin/uictrl.sh;
+}