diff --git a/hosts/redmond/default.nix b/hosts/redmond/default.nix index 1979372d..cdaa5afc 100644 --- a/hosts/redmond/default.nix +++ b/hosts/redmond/default.nix @@ -16,6 +16,4 @@ desktop.enable = true; stateVersion = "24.05"; }; - - programs.sway.extraSessionCommands = lib.mkForce "WLR_RENDERER=gles2"; } diff --git a/modules/home/default.nix b/modules/home/default.nix index 343ad79b..ed97b6a8 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,7 +1,6 @@ { lib, ... }: { imports = [ - ./files ./programs ./services ./settings diff --git a/modules/home/files/default.nix b/modules/home/files/default.nix deleted file mode 100644 index 0983a710..00000000 --- a/modules/home/files/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, ... }: -{ - imports = [ ./impermanence ]; - - home.file = lib.mkIf config.home.desktop.enable { - ".assets/wallpapers".source = ./wallpapers; - ".assets/lockscreen".source = ./lockscreen; - ".alsoftrc".text = "drivers=pulse"; - }; -} diff --git a/modules/home/settings/default.nix b/modules/home/settings/default.nix index 2175a73e..d6b0502b 100644 --- a/modules/home/settings/default.nix +++ b/modules/home/settings/default.nix @@ -7,6 +7,7 @@ ./environment ./fonts ./gtk + ./impermanence ./locale ./nix ./qt diff --git a/modules/home/files/impermanence/default.nix b/modules/home/settings/impermanence/default.nix similarity index 100% rename from modules/home/files/impermanence/default.nix rename to modules/home/settings/impermanence/default.nix diff --git a/modules/home/variables/displays/default.nix b/modules/home/variables/displays/default.nix index abb3ab4d..99f17bf3 100644 --- a/modules/home/variables/displays/default.nix +++ b/modules/home/variables/displays/default.nix @@ -11,6 +11,6 @@ tower4 = "Samsung Electric Company SAMSUNG Unknown"; estradiol1 = "Dell Inc. DELL P2214H KW14V4965YKS"; - estradiol2 = "Toshiba America Info Systems Inc TOSHIBA-TV 0x01010101"; + estradiol2 = "HannStar Display Corp iP192A 051AW1WY03797"; }; } diff --git a/modules/home/wms/programs/kanshi/default.nix b/modules/home/wms/programs/kanshi/default.nix index 9e04521d..958438cd 100644 --- a/modules/home/wms/programs/kanshi/default.nix +++ b/modules/home/wms/programs/kanshi/default.nix @@ -39,6 +39,7 @@ { criteria = config.displays.estradiol2; position = "1920,0"; + scale = 0.85; } { criteria = "eDP-1"; diff --git a/modules/home/wms/programs/mako/default.nix b/modules/home/wms/programs/mako/default.nix index d0c7a0f9..065026c7 100644 --- a/modules/home/wms/programs/mako/default.nix +++ b/modules/home/wms/programs/mako/default.nix @@ -1,9 +1,5 @@ { config, ... }: { - imports = [ - ./makotoggle - ]; - services.mako = { enable = config.home.desktop.enable; borderColor = "#${config.look.colors.accent}"; diff --git a/modules/home/wms/programs/mako/makotoggle/default.nix b/modules/home/wms/programs/mako/makotoggle/default.nix deleted file mode 100644 index b1bc6a7b..00000000 --- a/modules/home/wms/programs/mako/makotoggle/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: -{ - home.packages = with pkgs; lib.mkIf config.services.mako.enable [ - (pkgs.writeScriptBin "makotoggle" '' - mode_output=$(makoctl mode) - - # Extract the second line after "default" - mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}') - - if [[ "$mode_line" == "do-not-disturb" ]]; then - makoctl mode -r do-not-disturb - notify-send 'Notifications Enabled' - else - notify-send 'Notifications Disabled' - sleep 2 - makoctl mode -a do-not-disturb - fi - '') - ]; -} diff --git a/modules/home/wms/programs/rofi/scripts/default.nix b/modules/home/wms/programs/rofi/scripts/default.nix index 66b6f46d..95efb373 100644 --- a/modules/home/wms/programs/rofi/scripts/default.nix +++ b/modules/home/wms/programs/rofi/scripts/default.nix @@ -14,7 +14,7 @@ case $POWER in Shutdown) poweroff;; Reboot) reboot;; - Lock) swaylock;; + Sleep) 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 index 48ae444a..8babc876 100644 --- a/modules/home/wms/programs/swayidle/default.nix +++ b/modules/home/wms/programs/swayidle/default.nix @@ -1,53 +1,34 @@ { config, lib, pkgs, ... }: -let - lockcommand = "${pkgs.swaylock-effects}/bin/swaylock --daemonize"; - unlockcommand = "pkill -SIGUSR1 swaylock"; - timeoutcommand = "${pkgs.sway}/bin/swaymsg \"output * dpms off\""; - resumecommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; +with pkgs; let + lockCommand = "${swaylock-effects}/bin/swaylock --daemonize"; + sleepCommand = "${systemd}/bin/systemctl suspend"; in { config = lib.mkIf config.home.desktop.enable { services.swayidle = { - enable = config.home.desktop.enable; + enable = true; events = [ { event = "before-sleep"; - command = lockcommand; + command = lockCommand; } { event = "lock"; - command = lockcommand; - } - { - event = "unlock"; - command = unlockcommand; - } - { - event = "after-resume"; - command = resumecommand; + command = lockCommand; } ]; timeouts = [ - { + { + timeout = 900; # 15m + command = lockCommand; + } + { timeout = 1800; # 30m - command = "${pkgs.libnotify}/bin/notify-send \"Locking in 30 seconds\""; - } - { - timeout = 1830; - command = lockcommand; - } - { - timeout = 3600; # 1h - command = timeoutcommand; - resumeCommand = resumecommand; - } - { - timeout = 3605; - command = "${pkgs.systemd}/bin/systemctl suspend"; + command = sleepCommand; } ]; }; - home.packages = with pkgs; [ sway-audio-idle-inhibit ]; + home.packages = with pkgs; [ wayland-pipewire-idle-inhibit ]; }; } diff --git a/modules/home/wms/programs/swaylock/default.nix b/modules/home/wms/programs/swaylock/default.nix index 52c358c5..33b18cfa 100644 --- a/modules/home/wms/programs/swaylock/default.nix +++ b/modules/home/wms/programs/swaylock/default.nix @@ -12,7 +12,7 @@ in { package = pkgs.swaylock-effects; settings = { clock = true; - image = "~/.assets/lockscreen/lock.png"; + image = builtins.toString ./lock.png; font = config.look.fonts.main; font-size = 30; timestr = "%I:%M%p"; diff --git a/modules/home/files/lockscreen/lock.png b/modules/home/wms/programs/swaylock/lock.png similarity index 100% rename from modules/home/files/lockscreen/lock.png rename to modules/home/wms/programs/swaylock/lock.png diff --git a/modules/home/wms/programs/waybar/default.nix b/modules/home/wms/programs/waybar/default.nix index af3b851f..da9d4eff 100644 --- a/modules/home/wms/programs/waybar/default.nix +++ b/modules/home/wms/programs/waybar/default.nix @@ -157,14 +157,11 @@ notificationModule = { exec = pkgs.writeScript "notificationScript" '' - # Run makoctl mode and store the output in a variable - mode_output=$(makoctl mode) - # Extract the second line after "default" - mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}') + mode=$(echo "$(makoctl mode)" | sed -n '/default/{n;p}') # Print the notification status with the tooltip - if [[ "$mode_line" == "do-not-disturb" ]]; then + if [[ "$mode" == "do-not-disturb" ]]; then printf '{"text":"󱆥 Off","class":"disabled","tooltip":"Notifications Disabled."}' else printf '{"text":" On","tooltip":"Notifications Enabled."}'; diff --git a/modules/home/wms/sway/autostart/default.nix b/modules/home/wms/sway/autostart/default.nix index a1916691..ddb9303e 100644 --- a/modules/home/wms/sway/autostart/default.nix +++ b/modules/home/wms/sway/autostart/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { wayland.windowManager.sway.config = { bars = [{ command = "waybar"; }]; @@ -10,7 +10,11 @@ { command = "foot -a sound -T Sound pulsemixer"; } # Daemons and tray - { command = "sway-audio-idle-inhibit"; } + { + command = "kanshictl reload"; + always = true; + } + { command = "wayland-pipewire-idle-inhibit"; } # Foreground { command = "thunderbird"; } diff --git a/modules/home/wms/sway/default.nix b/modules/home/wms/sway/default.nix index 7ec5e4c6..f9a0c5fe 100644 --- a/modules/home/wms/sway/default.nix +++ b/modules/home/wms/sway/default.nix @@ -1,7 +1,8 @@ -{ config, pkgs, ... }: +{ config, ... }: { imports = [ ./autostart + ./extra ./hotkeys ./inputs ./outputs @@ -11,15 +12,12 @@ wayland.windowManager.sway = { enable = config.home.desktop.enable; - package = null; wrapperFeatures.gtk = true; checkConfig = false; - extraConfig = '' - default_floating_border pixel ${config.look.border.string} - hide_edge_borders --i3 smart - titlebar_padding 10 1 - primary_selection disabled - mouse_warping container + extraOptions = [ "--unsupported-gpu" ]; + extraSessionCommands = '' + export ELECTRON_OZONE_PLATFORM_HINT=wayland + export WLR_RENDERER=vulkan ''; }; } diff --git a/modules/home/wms/sway/extra/default.nix b/modules/home/wms/sway/extra/default.nix new file mode 100644 index 00000000..9a0ae172 --- /dev/null +++ b/modules/home/wms/sway/extra/default.nix @@ -0,0 +1,7 @@ +{ config, ... }: +{ + wayland.windowManager.sway.extraConfig = '' + titlebar_padding 10 1 + primary_selection disabled + ''; +} diff --git a/modules/home/wms/sway/hotkeys/default.nix b/modules/home/wms/sway/hotkeys/default.nix index e550d51c..f8bd83b4 100644 --- a/modules/home/wms/sway/hotkeys/default.nix +++ b/modules/home/wms/sway/hotkeys/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { wayland.windowManager.sway.config = let # Set default modifier and variables @@ -55,7 +55,7 @@ ## Miscellaneous # Notifications - "${primeMod}+n" = ''exec makotoggle''; + "${primeMod}+n" = ''exec makoctl mode -t do-not-disturb''; "${primeMod}+Shift+n" = ''exec makoctl restore''; "${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a''; diff --git a/modules/home/wms/sway/inputs/default.nix b/modules/home/wms/sway/inputs/default.nix index 840859b6..512ce6de 100644 --- a/modules/home/wms/sway/inputs/default.nix +++ b/modules/home/wms/sway/inputs/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { # HID devices wayland.windowManager.sway.config.input = { @@ -8,9 +8,6 @@ "9639:64097:Compx_2.4G_Receiver_Mouse" = { pointer_accel = "-0.82"; }; - "1452:627:bcm5974" = { - scroll_factor = "0.3"; - }; "*" = { accel_profile = "flat"; dwt = "disabled"; diff --git a/modules/home/wms/sway/rules/default.nix b/modules/home/wms/sway/rules/default.nix index a563fa35..392dbe0f 100644 --- a/modules/home/wms/sway/rules/default.nix +++ b/modules/home/wms/sway/rules/default.nix @@ -1,7 +1,14 @@ { config, ... }: { wayland.windowManager.sway.config = { - defaultWorkspace = "1:${config.ws.w1}"; + defaultWorkspace = "workspace 1:${config.ws.w1}"; + + focus = { + mouseWarping = "container"; + wrapping = "yes"; + }; + + workspaceAutoBackAndForth = true; window = { titlebar = false; @@ -66,6 +73,5 @@ ]; "44:${config.ws.w4a}" = [{ app_id = "com.obsproject.Studio"; }]; }; - focus.newWindow = "focus"; }; } diff --git a/modules/home/wms/sway/theme/default.nix b/modules/home/wms/sway/theme/default.nix index d6184ecf..29478311 100644 --- a/modules/home/wms/sway/theme/default.nix +++ b/modules/home/wms/sway/theme/default.nix @@ -31,21 +31,31 @@ childBorder = "#${config.look.colors.urgent}"; }; }; + fonts = { names = [ config.look.fonts.main ]; size = 10.5; }; + window = { border = config.look.border.int; + hideEdgeBorders = "smart"; }; + + floating.border = config.look.border.int; + gaps = { inner = 5; smartGaps = true; }; + output = { - "*".bg = "~/.assets/wallpapers/1.png fill"; - "${config.displays.tower2}".bg = "~/.assets/wallpapers/2.png fill"; - "${config.displays.tower3}".bg = "~/.assets/wallpapers/3.png fill"; + "*".bg = "${builtins.toString ./wallpapers/1.png} fill"; + + "${config.displays.tower2}".bg = "${builtins.toString ./wallpapers/2.png} fill"; + "${config.displays.tower3}".bg = "${builtins.toString ./wallpapers/3.png} fill"; + + "${config.displays.estradiol2}".bg = "${builtins.toString ./wallpapers/2.png} fill"; }; }; } diff --git a/modules/home/files/wallpapers/1.png b/modules/home/wms/sway/theme/wallpapers/1.png similarity index 100% rename from modules/home/files/wallpapers/1.png rename to modules/home/wms/sway/theme/wallpapers/1.png diff --git a/modules/home/files/wallpapers/2.png b/modules/home/wms/sway/theme/wallpapers/2.png similarity index 100% rename from modules/home/files/wallpapers/2.png rename to modules/home/wms/sway/theme/wallpapers/2.png diff --git a/modules/home/files/wallpapers/3.png b/modules/home/wms/sway/theme/wallpapers/3.png similarity index 100% rename from modules/home/files/wallpapers/3.png rename to modules/home/wms/sway/theme/wallpapers/3.png diff --git a/modules/system/programs/desktops/default.nix b/modules/system/programs/desktops/default.nix index 3502454e..d693bd1b 100644 --- a/modules/system/programs/desktops/default.nix +++ b/modules/system/programs/desktops/default.nix @@ -1,15 +1,7 @@ { config, lib, ... }: { config = lib.mkIf config.system.desktop.enable { - programs.sway = { - enable = true; - extraOptions = [ "--unsupported-gpu" ]; - extraSessionCommands = '' - export ELECTRON_OZONE_PLATFORM_HINT=wayland - export WLR_RENDERER=vulkan - ''; - wrapperFeatures.gtk = true; - }; + programs.sway.enable = true; services.dbus.enable = true; security.pam.services.swaylock = {};