/** 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. */ { bottom, pkgs, ... }: with pkgs; let dmenu-cmd = if bottom then "${dmenu}/bin/dmenu -b -i \"$@\"" else "${dmenu}/bin/dmenu -i \"$@\""; in writeShellScript "libkookie-i3-switch" '' WS=$(${i3}/bin/i3-msg -t get_workspaces | \ ${jq}/bin/jq -r -M '.[] | .name' | sort -u | \ ${dmenu-cmd}) ${i3}/bin/i3-msg workspace $WS ''