From f7f191c7201672f6dd9e488d341ea98f9d3190e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Tue, 16 Jun 2026 14:06:00 +0200 Subject: [PATCH] niri: move back to swayidle --- niri/.config/niri/config.kdl | 25 ++++++++++++++++++++++--- niri/.config/swayidle/config | 11 +++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 niri/.config/swayidle/config diff --git a/niri/.config/niri/config.kdl b/niri/.config/niri/config.kdl index 8667bfb..440fd7b 100644 --- a/niri/.config/niri/config.kdl +++ b/niri/.config/niri/config.kdl @@ -236,6 +236,9 @@ layout { workspace "terminal" { open-on-output "DP-1" } +workspace "passwords" { + open-on-output "DP-1" +} workspace "firefox" { open-on-output "DP-1" @@ -262,7 +265,13 @@ workspace "notes" { // This line starts waybar, a commonly used bar for Wayland compositors. spawn-at-startup "mako" spawn-at-startup "waybar" - spawn-at-startup "hypridle" + spawn-at-startup "keepasxc" + // spawn-at-startup "hypridle" + spawn-at-startup "swayidle" "-w" \ + "timeout" "300" "sh -c 'pgrep waylock || waylock -init-color 0x000000 -input-color 0x0000ff'" \ + "timeout" "305" "sh -c 'niri msg action power-off-monitors'" \ + "resume" "sh -c 'niri msg action power-on-monitors'" \ + "before-sleep" "sh -c 'pgrep waylock || waylock -init-color 0x000000 -input-color 0x0000ff'" //spawn-at-startup "noctalia-shell" // Uncomment this line to ask the clients to omit their client-side decorations if possible. @@ -321,6 +330,12 @@ window-rule { block-out-from "screen-capture" } +window-rule { + match app-id="keepasxc" + open-floating false + block-out-from "screen-capture" +} + // Example: block out two password managers from screen capture. // (This example rule is commented out with a "/-" in front.) /-window-rule { @@ -363,13 +378,15 @@ binds { // Suggested binds for running programs: terminal, app launcher, screen locker. Mod+return hotkey-overlay-title="Open a Terminal: ghostty" { spawn "ghostty"; } Mod+space hotkey-overlay-title="Run an Application: wofi" { spawn "sh" "-c" "wofi --show dmenu,drun"; } - Mod+Delete hotkey-overlay-title="Lock the Screen: hyprlock" { spawn "hyprlock"; } + Mod+Delete hotkey-overlay-title="Lock the Screen: swaylock" { spawn "sh" "-c" "(pgrep swaylock || swaylock -f -c 000000) ; sleep 2 ; niri msg action power-off-monitors"; } + // You can also use a shell. Do this if you need pipes, multiple commands, etc. // Note: the entire command goes as a single argument in the end. // Mod+T { spawn "bash" "-c" "notify-send hello && exec wezterm"; } - Ctrl+Alt+W { spawn "firefox" "--ProfileManager"; } + Ctrl+Alt+W { spawn "firefox" "-P" "Work"; } + Ctrl+Alt+E { spawn "firefox" "--ProfileManager"; } Ctrl+Alt+Q { spawn "chromium-browser" "--ozone-platform=wayland"; } // Brightness control @@ -494,6 +511,7 @@ binds { Mod+2 { focus-workspace "firefox"; } Mod+3 { focus-workspace "notes"; } Mod+4 { focus-workspace "agents"; } + Mod+p { focus-workspace "passwords"; } //Mod+5 { focus-workspace "5"; } //Mod+6 { focus-workspace "6"; } //Mod+7 { focus-workspace "7"; } @@ -505,6 +523,7 @@ binds { Mod+Ctrl+2 { move-column-to-workspace "firefox"; } Mod+Ctrl+3 { move-column-to-workspace "notes"; } Mod+Ctrl+4 { move-column-to-workspace "agents"; } + Mod+Ctrl+p { move-column-to-workspace "passwords"; } //Mod+Ctrl+5 { move-column-to-workspace "5"; } //Mod+Ctrl+6 { move-column-to-workspace "6"; } //Mod+Ctrl+7 { move-column-to-workspace "7"; } diff --git a/niri/.config/swayidle/config b/niri/.config/swayidle/config new file mode 100644 index 0000000..1586ff2 --- /dev/null +++ b/niri/.config/swayidle/config @@ -0,0 +1,11 @@ +# 1. Dim the screens first (after 4.5 minutes) +timeout 270 'niri msg action power-off-monitors' resume 'niri msg action power-on-monitors' + +# 2. Lock the screen (after 5 minutes) +timeout 300 'hyprlock' + +# 3. Turn off screens immediately if already locked (failsafe) +timeout 310 'niri msg action power-off-monitors' resume 'niri msg action power-on-monitors' + +# 4. Lock immediately before the computer goes to sleep/suspend +before-sleep 'hyprlock'