diff options
Diffstat (limited to 'tmux-tsunami/modules/common/keys.nix')
| -rw-r--r-- | tmux-tsunami/modules/common/keys.nix | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/tmux-tsunami/modules/common/keys.nix b/tmux-tsunami/modules/common/keys.nix deleted file mode 100644 index 9e3c1a2..0000000 --- a/tmux-tsunami/modules/common/keys.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - lib, - config, - tsunamiLib, - ... -}: let - inherit (tsunamiLib) scriptPath; - inherit (lib.strings) escapeShellArg; - cfg = config.tsunami.keys; -in { - options = let - tmuxKey = lib.types.strMatching "^((C|M|S)-)*(.|Enter|Escape|Tab|Up|Down|Left|Right)$"; - inherit (lib) mkOption; - in { - tsunami.keys = { - leader = mkOption { - type = with lib.types; - listOf (submodule { - options = { - name = mkOption {type = str;}; - key = mkOption {type = tmuxKey;}; - exec = mkOption {type = str;}; - }; - }); - }; - - global = mkOption { - type = with lib.types; - listOf (submodule { - options = { - key = mkOption {type = tmuxKey;}; - exec = mkOption {type = str;}; - }; - }); - }; - }; - }; - - config = { - tsunami.scripts = { - "menu" = '' - tmux display-menu \ - -x "#{window_width}" -y S \ - -b none \ - -s "bg=#313244,fg=#9399b2" \ - -S "bg=#313244" \ - -H "bg=#45475a fg=#b4befe" \ - "$@" - ''; - - "leader-menu" = let - args = lib.concatStringsSep " " (builtins.map (f: "${escapeShellArg f.name} ${f.key} ${escapeShellArg f.exec}") cfg.leader); - in '' - ${scriptPath "menu"} ${args} - ''; - }; - tsunami.keys.global = [ - { - key = "C-x"; - exec = "run-shell ${scriptPath "leader-menu"}"; - } - ]; - - tsunami.confs."global-keys" = cfg.global |> builtins.map (f: "bind-key -n ${f.key} ${escapeShellArg f.exec}") |> lib.concatStringsSep "\n"; - }; -} |
