From b532ebb5ae364db3b488bfcc29793bb8ff4fb705 Mon Sep 17 00:00:00 2001 From: Bun Date: Thu, 8 May 2025 21:12:29 -0400 Subject: [PATCH] Add Swayidle and add more monitors to config --- modules/home/variables/displays/default.nix | 3 ++ modules/home/wms/programs/default.nix | 1 + modules/home/wms/programs/kanshi/default.nix | 21 ++++++++++- .../wms/programs/rofi/scripts/default.nix | 1 - .../home/wms/programs/swayidle/default.nix | 35 +++++++++++++++++++ modules/home/wms/sway/autostart/default.nix | 3 ++ modules/home/wms/sway/outputs/default.nix | 7 +++- 7 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 modules/home/wms/programs/swayidle/default.nix diff --git a/modules/home/variables/displays/default.nix b/modules/home/variables/displays/default.nix index e7dbc374..abb3ab4d 100644 --- a/modules/home/variables/displays/default.nix +++ b/modules/home/variables/displays/default.nix @@ -9,5 +9,8 @@ tower2 = "BNQ BenQ GW2270 6CH00781019"; tower3 = "Eizo Nanao Corporation CG223W 23252050"; tower4 = "Samsung Electric Company SAMSUNG Unknown"; + + estradiol1 = "Dell Inc. DELL P2214H KW14V4965YKS"; + estradiol2 = "Toshiba America Info Systems Inc TOSHIBA-TV 0x01010101"; }; } diff --git a/modules/home/wms/programs/default.nix b/modules/home/wms/programs/default.nix index 8231b60f..4828dc84 100644 --- a/modules/home/wms/programs/default.nix +++ b/modules/home/wms/programs/default.nix @@ -5,6 +5,7 @@ ./kanshi ./mako ./rofi + ./swayidle ./swaylock ./waybar ./wlsunset diff --git a/modules/home/wms/programs/kanshi/default.nix b/modules/home/wms/programs/kanshi/default.nix index 51fe1cea..9e04521d 100644 --- a/modules/home/wms/programs/kanshi/default.nix +++ b/modules/home/wms/programs/kanshi/default.nix @@ -28,6 +28,25 @@ ]; }; } + { + profile = { + name = "estradiol"; + outputs = [ + { + criteria = config.displays.estradiol1; + position = "0,0"; + } + { + criteria = config.displays.estradiol2; + position = "1920,0"; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + }; + } { profile = { name = "docked"; @@ -52,7 +71,7 @@ status = "enable"; mode = "800x1280@59.99900"; transform = "270"; - scale = 1.0; + scale = 1.15; } ]; }; diff --git a/modules/home/wms/programs/rofi/scripts/default.nix b/modules/home/wms/programs/rofi/scripts/default.nix index 09ee6b77..66b6f46d 100644 --- a/modules/home/wms/programs/rofi/scripts/default.nix +++ b/modules/home/wms/programs/rofi/scripts/default.nix @@ -15,7 +15,6 @@ Shutdown) poweroff;; Reboot) reboot;; Lock) swaylock;; - Sleep) swaylock & systemctl suspend;; Kill) pkill -9 $XDG_CURRENT_DESKTOP;; esac '') diff --git a/modules/home/wms/programs/swayidle/default.nix b/modules/home/wms/programs/swayidle/default.nix new file mode 100644 index 00000000..d65c2d93 --- /dev/null +++ b/modules/home/wms/programs/swayidle/default.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: +{ + config = lib.mkIf config.home.desktop.enable { + services.swayidle = { + enable = config.home.desktop.enable; + timeouts = [ + { + timeout = 1800; + command = "notify-send 'Locking in 30 seconds'"; + } + { + timeout = 1830; + command = "swaylock"; + } + { + timeout = 3600; + command = "swaymsg 'output * dpms off'"; + resumeCommand = "swaymsg 'output * dpms on'"; + } + { + timeout = 3605; + command = "systemctl suspend"; + } + ]; + events = [ + { + event = "before-sleep"; + command = "swaylock"; + } + ]; + }; + + home.packages = with pkgs; [ sway-audio-idle-inhibit ]; + }; +} diff --git a/modules/home/wms/sway/autostart/default.nix b/modules/home/wms/sway/autostart/default.nix index 02e86307..a1916691 100644 --- a/modules/home/wms/sway/autostart/default.nix +++ b/modules/home/wms/sway/autostart/default.nix @@ -9,6 +9,9 @@ { command = "foot -a music -T Music ncmpcpp"; } { command = "foot -a sound -T Sound pulsemixer"; } + # Daemons and tray + { command = "sway-audio-idle-inhibit"; } + # Foreground { command = "thunderbird"; } { command = "vesktop"; } diff --git a/modules/home/wms/sway/outputs/default.nix b/modules/home/wms/sway/outputs/default.nix index cff20e0b..c7963fa0 100644 --- a/modules/home/wms/sway/outputs/default.nix +++ b/modules/home/wms/sway/outputs/default.nix @@ -40,6 +40,11 @@ (assign "${config.displays.tower1}" workspaces1) ++ (assign "${config.displays.tower2}" workspaces2) ++ (assign "${config.displays.tower3}" workspaces3) ++ - (assign "${config.displays.tower4}" workspaces4); + (assign "${config.displays.tower3}" workspaces4) ++ + + (assign "${config.displays.estradiol1}" workspaces1) ++ + (assign "${config.displays.estradiol1}" workspaces2) ++ + (assign "${config.displays.estradiol1}" workspaces4) ++ + (assign "${config.displays.estradiol2}" workspaces3); }; }