aboutsummaryrefslogtreecommitdiff
path: root/tmux-tsunami/modules/common/keys.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-07-15 12:03:58 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-07-15 12:03:58 -0500
commitd2aecd69c17fa64305c07333686576152432993d (patch)
tree2f52c7808a6cbd57ef60284947d3728a38cfab34 /tmux-tsunami/modules/common/keys.nix
parentf5ef0cf848e65d4fea2be8dee7bc1c72ad67046f (diff)
changes.
Diffstat (limited to 'tmux-tsunami/modules/common/keys.nix')
-rw-r--r--tmux-tsunami/modules/common/keys.nix66
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";
- };
-}