diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 13:17:20 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-22 20:42:17 +0100 |
commit | 9a10d19ced763cccf64aa662fd3bc0fa811ce3af (patch) | |
tree | 101d0ec1983f5b3730de7549fa7dc971f720f1a7 /infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix | |
parent | a3be97011845fefd94d0ec926448629f8f5e5cac (diff) |
libkookie: i3: adding module, configurations, and tempest config
Diffstat (limited to 'infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix')
-rw-r--r-- | infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix new file mode 100644 index 000000000000..691e9470db83 --- /dev/null +++ b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix @@ -0,0 +1,15 @@ +/** A utility script to switch to a workspace + * + * This tool relies on i3-msg, jq, and dmenu to switch to a different + * workspace. In the future, maybe the display mechanism (dmenu) + * could be made configurable, so not to rely on nazi code. + */ + +{ pkgs, ... }: with pkgs; writeShellScript "libkookie-i3-switch" '' + + WS=$(${i3}/bin/i3-msg -t get_workspaces | \ + ${jq}/bin/jq -M '.[] | .name' | tr -d '"' \ + | sort -u | ${dmenu}/bin/dmenu -b -i "$@") + + ${i3}/bin/i3-msg workspace $WS +'' |