summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accounts/gkleen@sif/default.nix14
-rw-r--r--accounts/gkleen@sif/niri/default.nix22
-rw-r--r--flake.lock8
-rw-r--r--flake.nix2
-rw-r--r--user-profiles/zsh/default.nix3
5 files changed, 39 insertions, 10 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"));
143in { 162in {
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)
diff --git a/flake.lock b/flake.lock
index 64091d39..a884d6c6 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1060,16 +1060,16 @@
1060 ] 1060 ]
1061 }, 1061 },
1062 "locked": { 1062 "locked": {
1063 "lastModified": 1742140394, 1063 "lastModified": 1747383113,
1064 "narHash": "sha256-U1Lp5HZbpnWQRetOLzQl3dURplY2BRfAZYkjBawYrVM=", 1064 "narHash": "sha256-/YW7eOKU3gsNplxvUDpEj1LiXtcCENSFpS1c8kXSDWw=",
1065 "owner": "gkleen", 1065 "owner": "gkleen",
1066 "repo": "Waybar", 1066 "repo": "Waybar",
1067 "rev": "f310667db199c570b599a08152d49b7f80db93f2", 1067 "rev": "919036587381595f15010ac95644992fe6d7343d",
1068 "type": "github" 1068 "type": "github"
1069 }, 1069 },
1070 "original": { 1070 "original": {
1071 "owner": "gkleen", 1071 "owner": "gkleen",
1072 "ref": "feat/niri-workspaces-hide", 1072 "ref": "feat/niri-urgency",
1073 "repo": "Waybar", 1073 "repo": "Waybar",
1074 "type": "github" 1074 "type": "github"
1075 } 1075 }
diff --git a/flake.nix b/flake.nix
index 0745d37c..039dee1f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -187,7 +187,7 @@
187 type = "github"; 187 type = "github";
188 owner = "gkleen"; 188 owner = "gkleen";
189 repo = "Waybar"; 189 repo = "Waybar";
190 ref = "feat/niri-workspaces-hide"; 190 ref = "feat/niri-urgency";
191 inputs = { 191 inputs = {
192 nixpkgs.follows = "nixpkgs"; 192 nixpkgs.follows = "nixpkgs";
193 flake-compat.follows = "flake-compat"; 193 flake-compat.follows = "flake-compat";
diff --git a/user-profiles/zsh/default.nix b/user-profiles/zsh/default.nix
index 973ff775..ab523a52 100644
--- a/user-profiles/zsh/default.nix
+++ b/user-profiles/zsh/default.nix
@@ -21,6 +21,8 @@
21 abbreviations = { 21 abbreviations = {
22 re = "systemctl restart"; 22 re = "systemctl restart";
23 ure = "systemctl --user restart"; 23 ure = "systemctl --user restart";
24 st = "systemctl status";
25 ust = "systemctl --user status";
24 }; 26 };
25 globalAbbreviations = { 27 globalAbbreviations = {
26 "L" = "| less"; 28 "L" = "| less";
@@ -28,6 +30,7 @@
28 "G" = "| grep"; 30 "G" = "| grep";
29 "B" = "&> /dev/null &"; 31 "B" = "&> /dev/null &";
30 "BB" = "&> /dev/null &!"; 32 "BB" = "&> /dev/null &!";
33 "J" = lib.mkIf config.programs.jq.enable "| jq '.'";
31 }; 34 };
32 }; 35 };
33 36