{ config, lib, options, pkgs, ... }: { config = { gtk.enable = lib.mkDefault config.desktop.sessions.sway.enable; home.packages = lib.mkIf config.desktop.sessions.sway.enable [ pkgs.grim pkgs.slurp ]; programs = { foot.enable = lib.mkDefault config.desktop.sessions.sway.enable; fuzzel.enable = lib.mkDefault config.desktop.sessions.sway.enable; librewolf.enable = lib.mkDefault config.desktop.sessions.sway.enable; swaylock = { enable = lib.mkDefault config.desktop.sessions.sway.enable; settings = { bs-hl-color = "f38ba8"; caps-lock-bs-hl-color = "f38ba8"; color = "000000"; font = "Fira Code"; font-size = config.desktop.defaultFontSize; image = "~/.local/share/wallpaper.png"; indicator-caps-lock = true; inside-clear-color = "b4befe"; inside-color = "1e1e2e"; inside-ver-color = "f9e2af"; inside-wrong-color = "f38ba8"; key-hl-color = "585b70"; line-caps-lock-color = "00000000"; line-clear-color = "00000000"; line-color = "00000000"; line-ver-color = "00000000"; line-wrong-color = "00000000"; ring-clear-color = "b4befe"; ring-color = "313244"; ring-ver-color = "f9e2af"; ring-wrong-color = "f38ba8"; scaling = "fill"; separator-color = "00000000"; text-caps-lock-color = "cdd6f4"; text-clear-color = "1e1e2e"; text-color = "cdd6f4"; text-ver-color = "1e1e2e"; text-wrong-color = "1e1e2e"; }; }; }; wayland.windowManager.sway = { enable = lib.mkDefault config.desktop.sessions.sway.enable; config = { bars = [ ]; bindswitches = let display = "eDP-1"; in { "lid:on" = { action = "output ${display} disable"; locked = true; reload = true; }; "lid:off" = { action = "output ${display} enable"; locked = true; reload = true; }; }; colors = { focused = { background = "#cba6f7"; border = "#cba6f7"; childBorder = "#cba6f7"; indicator = "#f5c2e7"; text = "#1e1e2e"; }; focusedInactive = { background = "#585b70"; border = "#585b70"; childBorder = "#585b70"; indicator = "#585b70"; text = "#cdd6f4"; }; unfocused = { background = "#313244"; border = "#313244"; childBorder = "#313244"; indicator = "#313244"; text = "#a6adc8"; }; urgent = { background = "#f38ba8"; border = "#f38ba8"; childBorder = "#f38ba8"; indicator = "#f38ba8"; text = "#1e1e2e"; }; }; defaultWorkspace = "workspace number 1"; floating = { criteria = [ # TODO ]; titlebar = false; }; focus.followMouse = false; fonts = { names = [ "Fira Code" ]; size = 8.0; }; gaps = { inner = 2; outer = 4; }; input = { "*" = { accel_profile = "flat"; }; "type:keyboard" = { xkb_layout = "us,ca"; }; "type:touchpad" = { drag = "enabled"; dwt = "enabled"; natural_scroll = "enabled"; tap = "enabled"; }; }; keybindings = let mod = config.wayland.windowManager.sway.config.modifier; terminal = "${pkgs.foot}/bin/foot"; in { "${mod}+Return" = "exec ${terminal}"; "${mod}+R" = "exec ${pkgs.fuzzel}/bin/fuzzel"; "${mod}+B" = "exec ${pkgs.librewolf}/bin/librewolf"; "${mod}+Shift+S" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" ~/Pictures/screenshot.png"; "${mod}+Alt+L" = "exec ${pkgs.swaylock}/bin/swaylock"; "${mod}+Alt+K" = "input type:keyboard xkb_switch_layout next"; "${mod}+Alt+Q" = "exit"; "${mod}+Q" = "kill"; "${mod}+1" = "workspace 1"; "${mod}+2" = "workspace 2"; "${mod}+3" = "workspace 3"; "${mod}+4" = "workspace 4"; "${mod}+5" = "workspace 5"; "${mod}+6" = "workspace 6"; "${mod}+7" = "workspace 7"; "${mod}+8" = "workspace 8"; "${mod}+9" = "workspace 9"; "${mod}+Shift+1" = "move workspace 1"; "${mod}+Shift+2" = "move workspace 2"; "${mod}+Shift+3" = "move workspace 3"; "${mod}+Shift+4" = "move workspace 4"; "${mod}+Shift+5" = "move workspace 5"; "${mod}+Shift+6" = "move workspace 6"; "${mod}+Shift+7" = "move workspace 7"; "${mod}+Shift+8" = "move workspace 8"; "${mod}+Shift+9" = "move workspace 9"; "${mod}+F" = "floating toggle"; "${mod}+H" = "focus left"; "${mod}+J" = "focus down"; "${mod}+K" = "focus up"; "${mod}+L" = "focus right"; "${mod}+Shift+H" = "move left"; "${mod}+Shift+J" = "move down"; "${mod}+Shift+K" = "move up"; "${mod}+Shift+L" = "move right"; "${mod}+Equal" = "resize grow width"; "${mod}+Minus" = "resize shrink width"; "${mod}+Shift+Equal" = "resize grow height"; "${mod}+Shift+Minus" = "resize shrink height"; "${mod}+P" = "focus parent"; "${mod}+Shift+F" = "fullscreen"; "${mod}+V" = "splitt"; "${mod}+G" = "layout toggle tabbed split"; "${mod}+S" = "sticky toggle"; "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_SINK@ toggle"; "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_SINK@ 5%-"; "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_SINK@ 5%+"; "XF86MonBrightnessDown" = "exec brightnessctl --class=backlight s 5%-"; "XF86MonBrightnessUp" = "exec brightnessctl --class=backlight s +5%"; }; modifier = "Mod4"; output = { "eDP-1" = { bg = "~/.local/share/wallpaper.png fill #000000"; scale = "1.5"; }; "DP-1" = { bg = "~/.local/share/wallpaper.png fill #000000"; mode = "1920x1080@165Hz"; pos = "0 0"; }; "DP-2" = { bg = "~/.local/share/wallpaper.png fill #000000"; mode = "1920x1080@75Hz"; pos = "1920 0"; }; }; seat."seat0".xcursor_theme = "catppuccin-mocha-dark-cursors 24"; window = { commands = [ ]; titlebar = false; }; workspaceOutputAssign = [ { output = "eDP-1"; workspace = "1"; } { output = "DP-1"; workspace = "1"; } { output = "DP-2"; workspace = "2"; } ]; }; swaynag = { enable = lib.mkDefault config.desktop.sessions.sway.enable; settings = lib.mkDefault { }; }; }; xdg.dataFile."wallpaper.png".enable = config.desktop.sessions.sway.enable; }; options.desktop.sessions.sway.enable = lib.mkEnableOption "the sway window manager"; }