diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-15 13:52:39 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-15 13:52:39 +0200 |
commit | 42b152de6aef86f94e825062a68655305b986b0c (patch) | |
tree | f9259d1d41f9876d27744894fd36eb2579028663 | |
parent | 726af5454eda3aa44b97312b856977a766e52615 (diff) | |
download | nixos-42b152de6aef86f94e825062a68655305b986b0c.tar nixos-42b152de6aef86f94e825062a68655305b986b0c.tar.gz nixos-42b152de6aef86f94e825062a68655305b986b0c.tar.bz2 nixos-42b152de6aef86f94e825062a68655305b986b0c.tar.xz nixos-42b152de6aef86f94e825062a68655305b986b0c.zip |
...
-rw-r--r-- | accounts/gkleen@sif/default.nix | 3 | ||||
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 15 |
2 files changed, 16 insertions, 2 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 36a81f83..1686a278 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -282,6 +282,9 @@ in { | |||
282 | pro = "$HOME/projects/pro"; | 282 | pro = "$HOME/projects/pro"; |
283 | media = "$HOME/media"; | 283 | media = "$HOME/media"; |
284 | }; | 284 | }; |
285 | zsh.zsh-abbr.globalAbbreviations = { | ||
286 | "J" = "| jq '.'"; | ||
287 | }; | ||
285 | 288 | ||
286 | obs-studio = { | 289 | obs-studio = { |
287 | enable = true; | 290 | enable = true; |
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index af1af07a..0fae56a7 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
@@ -45,7 +45,6 @@ let | |||
45 | ''; | 45 | ''; |
46 | }; | 46 | }; |
47 | focus-or-spawn-action = config.lib.niri.actions.spawn (lib.getExe focus_or_spawn); | 47 | focus-or-spawn-action = config.lib.niri.actions.spawn (lib.getExe focus_or_spawn); |
48 | focus-or-spawn-action-app_id = app_id: focus-or-spawn-action ''select(.app_id == "${app_id}")''; | ||
49 | 48 | ||
50 | with_adjacent_workspace = pkgs.writeShellApplication { | 49 | with_adjacent_workspace = pkgs.writeShellApplication { |
51 | name = "with-adjacent-workspace"; | 50 | name = "with-adjacent-workspace"; |
@@ -171,6 +170,17 @@ in { | |||
171 | type = lib.types.nullOr lib.types.str; | 170 | type = lib.types.nullOr lib.types.str; |
172 | default = null; | 171 | default = null; |
173 | }; | 172 | }; |
173 | moveKey = lib.mkOption { | ||
174 | type = lib.types.nullOr lib.types.str; | ||
175 | default = let | ||
176 | keys = lib.splitString "+" config.key; | ||
177 | defMoveKey = lib.concatStringsSep "+" (lib.flatten [ | ||
178 | (lib.take (lib.length keys - 1) keys) | ||
179 | ["Shift"] | ||
180 | (lib.takeEnd 1 keys) | ||
181 | ]); | ||
182 | in if config.key == null then null else defMoveKey; | ||
183 | }; | ||
174 | spawn = lib.mkOption { | 184 | spawn = lib.mkOption { |
175 | type = lib.types.nullOr (lib.types.listOf lib.types.str); | 185 | type = lib.types.nullOr (lib.types.listOf lib.types.str); |
176 | default = null; | 186 | default = null; |
@@ -923,13 +933,14 @@ in { | |||
923 | "Mod+Comma".action = spawn makoctl "restore"; | 933 | "Mod+Comma".action = spawn makoctl "restore"; |
924 | 934 | ||
925 | "Mod+Control+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"FocusWorkspace\":{\"reference\":{\"Id\": $workspace_id}}}}"; | 935 | "Mod+Control+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"FocusWorkspace\":{\"reference\":{\"Id\": $workspace_id}}}}"; |
926 | "Mod+Control+Shift+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"MoveColumnToWorkspace\":{\"reference\":{\"Id\": $workspace_id}}}}"; | 936 | "Mod+Control+Shift+W".action = with-empty-unnamed-workspace-action "{\"Action\":{\"MoveColumnToWorkspace\":{\"reference\":{\"Id\": $workspace_id}, \"focus\": true}}}"; |
927 | 937 | ||
928 | "Mod+X".action = set-dynamic-cast-window; | 938 | "Mod+X".action = set-dynamic-cast-window; |
929 | "Mod+Shift+X".action = set-dynamic-cast-monitor; | 939 | "Mod+Shift+X".action = set-dynamic-cast-monitor; |
930 | "Mod+Control+Shift+X".action = clear-dynamic-cast-target; | 940 | "Mod+Control+Shift+X".action = clear-dynamic-cast-target; |
931 | })) | 941 | })) |
932 | (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) | 942 | (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) |
943 | (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) | ||
933 | ] | 944 | ] |
934 | )) | 945 | )) |
935 | ]; | 946 | ]; |