From 545307cfef1e7c1b3a02e9f6a65b534344227c41 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 7 Feb 2025 16:33:10 +0100 Subject: ... --- accounts/gkleen@sif/niri/default.nix | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 50f8ba44..8b95f00f 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -417,7 +417,7 @@ in { (leaf "position" { x = 2560; y = 0; }) ]) (node "output" "HP Inc. HP 727pu CN4417143K" [ - (leaf "mode" "2560x1440@120") # 119.998 + (leaf "mode" "2560x1440@119.998") (leaf "scale" 1) (leaf "position" { x = 2560; y = 0; }) (flag "variable-refresh-rate") @@ -440,7 +440,7 @@ in { (leaf "top" 0) (leaf "bottom" 0) ]) - (plain "focus-ring" [ + (plain "border" [ (leaf "width" 2) (leaf "active-gradient" { from = "hsla(195 100% 45% 1)"; @@ -455,9 +455,12 @@ in { relative-to = "workspace-view"; }) ]) + (plain "focus-ring" [ + (flag "off") + ]) (plain "preset-column-widths" (map (prop: leaf "proportion" prop) [ - (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) + (1. / 4.) (1. / 3.) (1. / 2.) (2. / 3.) (3. / 4.) (1.) ])) (plain "default-column-width" [ (leaf "proportion" (1. / 2.)) ]) (plain "preset-window-heights" (map (prop: leaf "proportion" prop) [ @@ -467,8 +470,10 @@ in { (flag "always-center-single-column") (plain "tab-indicator" [ - (leaf "gap" (-6)) - (leaf "width" 6) + (leaf "gap" 4) + (leaf "width" 8) + (leaf "gaps-between-tabs" 4) + (flag "place-within-column") (leaf "length" { total-proportion = 1.; }) (leaf "active-gradient" { from = "hsla(195 100% 60% 0.75)"; @@ -498,10 +503,14 @@ in { (leaf "workspace" name) ) ["comm" "web" "vid" "bmr"]) + (plain "window-rule" [ + (leaf "clip-to-geometry" true) + ]) + (plain "window-rule" [ (leaf "match" { is-floating = true; }) (leaf "geometry-corner-radius" 8) - (leaf "clip-to-geometry" true) + (plain "shadow" [ (flag "on") ]) ]) (plain "window-rule" [ @@ -626,6 +635,7 @@ in { exec -- kitty --app-id kitty-play --directory "$HOME"/media mpv "$(wl-paste)" ''; })); + "Mod+Alt+M".action = spawn (lib.getExe' pkgs.screen-message "sm") "-n" "Fira Mono" "-a" "1" "-f" "#fff" "-b" "#000"; "Mod+U".action = spawn (lib.getExe (pkgs.writeShellApplication { name = "qalc-fuzzel"; @@ -810,6 +820,17 @@ in { "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; "Mod+Period".action = spawn makoctl "menu" (lib.getExe config.programs.fuzzel.package) "--dmenu"; "Mod+Comma".action = spawn makoctl "restore"; + + "Mod+Control+W".action = spawn (lib.getExe (pkgs.writeShellApplication { + name = "focus-empty-unnamed-workspace"; + runtimeInputs = [ niri pkgs.gojq pkgs.socat ]; + text = '' + workspaces_json="$(niri msg -j workspaces)" + active_output="$(jq '.[] | select(.is_focused) | .output' <<<"$workspaces_json")" + target_workspace_id="$(jq --argjson active_output "$active_output" 'map(select(.active_window_id == null and .name == null and .output == $active_output)) | sort_by(.idx) | .[0].id' <<<"$workspaces_json")" + jq --argjson workspace_id "$target_workspace_id" -nc '{"Action":{"FocusWorkspace":{"reference":{"Id": $workspace_id}}}}' | tee /dev/stderr | socat STDIO "$NIRI_SOCKET" + ''; + })); })) (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) ] -- cgit v1.2.3