From 002be9364c867b84db1bc49e448030404519877c Mon Sep 17 00:00:00 2001 From: "molly.computer" Date: Wed, 12 Aug 2026 13:49:49 -0400 Subject: [PATCH] improve niri workflow and idle handling --- home/default.nix | 1 + home/niri.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ home/swayidle.nix | 25 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 home/swayidle.nix diff --git a/home/default.nix b/home/default.nix index 43ba328..be77e58 100644 --- a/home/default.nix +++ b/home/default.nix @@ -9,6 +9,7 @@ ./opencode.nix ./scripts.nix ./shell.nix + ./swayidle.nix ./stylix.nix ./tablet.nix ./ironbar.nix diff --git a/home/niri.nix b/home/niri.nix index 546ce0a..60e91c5 100644 --- a/home/niri.nix +++ b/home/niri.nix @@ -9,12 +9,21 @@ touchpad = { tap = true; natural-scroll = true; + dwt = true; + click-method = "clickfinger"; }; }; layout = { gaps = 12; center-focused-column = "never"; + always-center-single-column = true; + preset-column-widths = [ + {proportion = 1.0 / 3.0;} + {proportion = 0.5;} + {proportion = 2.0 / 3.0;} + {proportion = 1.0;} + ]; default-column-width.proportion = 0.5; focus-ring = { width = 4; @@ -25,6 +34,22 @@ }; window-rules = [ + { + matches = [ + { + app-id = "firefox$"; + title = "^Picture-in-Picture$"; + } + ]; + open-floating = true; + default-column-width.fixed = 480; + default-window-height.fixed = 270; + default-floating-position = { + x = 24; + y = 24; + relative-to = "bottom-right"; + }; + } { matches = [{app-id = "net-runelite-launcher-Launcher";}]; open-floating = true; @@ -66,6 +91,8 @@ action.spawn = ["foot" "-e" "nmtui"]; }; "Super+Alt+L" = { + repeat = false; + allow-inhibiting = false; hotkey-overlay.title = "Lock Screen: swaylock"; action.spawn = "swaylock"; }; @@ -123,12 +150,30 @@ "Mod+R".action.switch-preset-column-width = []; "Mod+Shift+R".action.switch-preset-column-width-back = []; + "Mod+Comma".action.consume-window-into-column = []; + "Mod+Period".action.expel-window-from-column = []; + "Mod+BracketLeft".action.consume-or-expel-window-left = []; + "Mod+BracketRight".action.consume-or-expel-window-right = []; + "Mod+F".action.maximize-column = []; "Mod+Shift+F".action.fullscreen-window = []; + "Mod+C".action.center-column = []; + "Mod+W".action.toggle-column-tabbed-display = []; "Mod+V".action.toggle-window-floating = []; "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = []; + "Mod+Shift+P" = { + repeat = false; + hotkey-overlay.title = "Power Off Monitors"; + action.power-off-monitors = []; + }; + "Mod+Escape" = { + repeat = false; + hotkey-overlay.title = "Release Captured Shortcuts"; + action.toggle-keyboard-shortcuts-inhibit = []; + }; + "XF86AudioRaiseVolume" = { allow-when-locked = true; action.spawn-sh = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; diff --git a/home/swayidle.nix b/home/swayidle.nix new file mode 100644 index 0000000..cf062e3 --- /dev/null +++ b/home/swayidle.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + ... +}: let + lock = "${pkgs.swaylock}/bin/swaylock -f"; + niri = "${config.programs.niri.package}/bin/niri msg action"; +in { + services.swayidle = { + enable = true; + systemdTargets = ["niri.service"]; + events.before-sleep = lock; + timeouts = [ + { + timeout = 600; + command = lock; + } + { + timeout = 630; + command = "${niri} power-off-monitors"; + resumeCommand = "${niri} power-on-monitors"; + } + ]; + }; +} -- 2.51.2