aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-15 22:50:37 +0100
committerAdrian Kummerlaender2019-02-15 22:50:39 +0100
commit7819771a61f577360c2401d9232cadc25a969e15 (patch)
tree723462b49fd783bcceb18b0733212472537b49b8
parenta0c74e2cae9233bf42b149b10c835ac61e2d1742 (diff)
downloadnixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar.gz
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar.bz2
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar.lz
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar.xz
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.tar.zst
nixos_home-7819771a61f577360c2401d9232cadc25a969e15.zip
Add uictrl dependencies
-rwxr-xr-xgui/pkgs/bin/uictrl.sh16
-rw-r--r--gui/pkgs/uictrl.nix19
-rw-r--r--gui/touchegg.nix2
3 files changed, 19 insertions, 18 deletions
diff --git a/gui/pkgs/bin/uictrl.sh b/gui/pkgs/bin/uictrl.sh
deleted file mode 100755
index 46c7219..0000000
--- a/gui/pkgs/bin/uictrl.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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
index 0c965ad..c85e2bc 100644
--- a/gui/pkgs/uictrl.nix
+++ b/gui/pkgs/uictrl.nix
@@ -5,5 +5,22 @@ pkgs.writeTextFile {
executable = true;
destination = "/bin/uictrl";
- text = builtins.readFile ./bin/uictrl.sh;
+ text = with pkgs; ''
+ #!${fish}/bin/fish
+
+ function cycle
+ set nsp_ws (${wmctrl}/bin/wmctrl -d | awk '{if ($9 == "NSP") {print $1}}')
+ set current_ws (${wmctrl}/bin/wmctrl -d | awk '{if ($2 == "*") {print $1}}')
+
+ ${wmctrl}/bin/wmctrl -l | awk -v current_ws=$current_ws -v nsp_ws=$nsp_ws '{if ($2 > current_ws && $2 != nsp_ws) {print $2}}' | uniq
+ ${wmctrl}/bin/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}/bin/wmctrl -s (cycle)[1]
+ case prev
+ ${wmctrl}/bin/wmctrl -s (cycle | tac)[1]
+ end
+ '';
}
diff --git a/gui/touchegg.nix b/gui/touchegg.nix
index fee4344..aaa2195 100644
--- a/gui/touchegg.nix
+++ b/gui/touchegg.nix
@@ -1,7 +1,7 @@
{ pkgs, ... }:
{
- home.file.".config/touchegg/touchegg.conf".lines = let
+ home.file.".config/touchegg/touchegg.conf".text = let
uictrl = pkgs.lib.callPackageWith pkgs ./pkgs/uictrl.nix { };
in ''
<touchégg>