diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-16 10:24:36 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-16 10:24:36 +0200 |
| commit | 1e1cd8cc2924c719a27ab92101e9d4087744c238 (patch) | |
| tree | fe4c494413c013fb4b360b382449e7e8b1e48bd8 /accounts/gkleen@sif | |
| parent | caf7ef8b2f8a5e077da37dbf5c2bcdfa951e77fc (diff) | |
| download | nixos-1e1cd8cc2924c719a27ab92101e9d4087744c238.tar nixos-1e1cd8cc2924c719a27ab92101e9d4087744c238.tar.gz nixos-1e1cd8cc2924c719a27ab92101e9d4087744c238.tar.bz2 nixos-1e1cd8cc2924c719a27ab92101e9d4087744c238.tar.xz nixos-1e1cd8cc2924c719a27ab92101e9d4087744c238.zip | |
...
Diffstat (limited to 'accounts/gkleen@sif')
| -rw-r--r-- | accounts/gkleen@sif/default.nix | 14 | ||||
| -rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 22 |
2 files changed, 31 insertions, 5 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 1686a278..8a848e8f 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
| @@ -282,8 +282,15 @@ 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 = { | 285 | jq.colors = { |
| 286 | "J" = "| jq '.'"; | 286 | arrays = "1;37"; |
| 287 | "false" = "0;37"; | ||
| 288 | "null" = "2;37"; | ||
| 289 | numbers = "0;37"; | ||
| 290 | objectKeys = "1;34"; | ||
| 291 | objects = "1;37"; | ||
| 292 | strings = "0;32"; | ||
| 293 | "true" = "0;37"; | ||
| 287 | }; | 294 | }; |
| 288 | 295 | ||
| 289 | obs-studio = { | 296 | obs-studio = { |
| @@ -323,9 +330,6 @@ in { | |||
| 323 | "kitty_mod+n" = "detach_window"; | 330 | "kitty_mod+n" = "detach_window"; |
| 324 | "kitty_mod+m" = "detach_window ask"; | 331 | "kitty_mod+m" = "detach_window ask"; |
| 325 | }; | 332 | }; |
| 326 | extraConfig = '' | ||
| 327 | envinclude KITTY_CONF_* | ||
| 328 | ''; | ||
| 329 | }; | 333 | }; |
| 330 | fuzzel = { | 334 | fuzzel = { |
| 331 | enable = true; | 335 | enable = true; |
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 09482c51..fde08ae9 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
| @@ -140,6 +140,25 @@ let | |||
| 140 | ''; | 140 | ''; |
| 141 | }; | 141 | }; |
| 142 | with-select-window-action = config.lib.niri.actions.spawn (lib.getExe with_select_window); | 142 | with-select-window-action = config.lib.niri.actions.spawn (lib.getExe with_select_window); |
| 143 | |||
| 144 | with_predicate_window = pred: pkgs.writeShellApplication { | ||
| 145 | name = "with-predicate-window"; | ||
| 146 | runtimeInputs = [ niri pkgs.gojq pkgs.socat config.programs.fuzzel.package pkgs.gawk ]; | ||
| 147 | text = '' | ||
| 148 | action="$1" | ||
| 149 | shift | ||
| 150 | |||
| 151 | windows_json="$(niri msg -j windows)" | ||
| 152 | window_json="$(gojq -rc 'map(select(${pred})) | .[0]' <<<"$windows_json")" | ||
| 153 | |||
| 154 | [[ -z "$window_json" || $window_json = "null" ]] && exit 1 | ||
| 155 | |||
| 156 | jq -c "$action" <<<"$window_json" | socat STDIO "$NIRI_SOCKET" | ||
| 157 | ''; | ||
| 158 | }; | ||
| 159 | |||
| 160 | with-urgent-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_urgent")); | ||
| 161 | with-focused-window-action = config.lib.niri.actions.spawn (lib.getExe (with_predicate_window ".is_focused")); | ||
| 143 | in { | 162 | in { |
| 144 | imports = [ | 163 | imports = [ |
| 145 | ./waybar.nix | 164 | ./waybar.nix |
| @@ -938,6 +957,9 @@ in { | |||
| 938 | "Mod+X".action = set-dynamic-cast-window; | 957 | "Mod+X".action = set-dynamic-cast-window; |
| 939 | "Mod+Shift+X".action = set-dynamic-cast-monitor; | 958 | "Mod+Shift+X".action = set-dynamic-cast-monitor; |
| 940 | "Mod+Control+Shift+X".action = clear-dynamic-cast-target; | 959 | "Mod+Control+Shift+X".action = clear-dynamic-cast-target; |
| 960 | |||
| 961 | "Mod+D".action = with-urgent-window-action "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; | ||
| 962 | "Mod+Shift+D".action = with-focused-window-action "{\"Action\":{\"UnsetUrgent\":{\"id\": .id}}}"; | ||
| 941 | })) | 963 | })) |
| 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) | 964 | (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) | 965 | (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) |
