{ lib, osConfig, ... }: let ccfg = import ../../../config.nix; cfg_path = [ ccfg.custom_config_key "desktopEnvironment" "sway" "swaync" ]; cfg = lib.attrsets.getAttrFromPath cfg_path osConfig; in { config = lib.mkIf cfg.enable { services.swaync = { enable = true; settings = { ignore = [ "com.spotify.Client" ]; positionX = "right"; positionY = "top"; layer = "overlay"; control-center-layer = "top"; layer-shell = true; cssPriority = "application"; control-center-margin-top = 0; control-center-margin-bottom = 0; control-center-margin-right = 0; control-center-margin-left = 0; notification-2fa-action = true; notification-inline-replies = false; notification-icon-size = 64; notification-body-image-height = 100; notification-body-image-width = 200; timeout = 10; timeout-low = 5; timeout-critical = 0; control-center-width = 500; control-center-height = 600; notification-window-width = 500; keyboard-shortcuts = true; image-visibility = "when-available"; transition-time = 200; hide-on-clear = false; hide-on-action = true; script-fail-notify = true; widgets = [ "inhibitors" "title" "dnd" "volume" "backlight" "mpris" "buttons-grid#quick" "notifications" ]; widget-config = { inhibitors = { text = "Inhibitors"; button-text = "Clear All"; clear-all-button = true; }; title = { text = "Notifications"; clear-all-button = true; button-text = "Clear All"; }; dnd.text = "Do Not Disturb"; mpris = { image-size = 96; image-radius = 12; }; volume = { label = "󰕾"; show-per-app = true; }; backlight = { label = "󰃟"; device = "intel_backlight"; }; # "buttons-grid#quick" = { # columns = 4; # icon-size = 20; # actions = [ # { label = "󰐥"; tooltip = "Shutdown"; command = "confirm-action 'systemctl poweroff' 'Shutdown?'"; } # { label = "󰜉"; tooltip = "Reboot"; command = "confirm-action 'systemctl reboot' 'Reboot?'"; } # { label = "󰍃"; tooltip = "Logout"; command = "confirm-action 'swaymsg exit' 'Logout?'"; } # ]; # }; }; }; style = '' .control-center { background: #1a1b26; border: 2px solid #7dcae4; border-radius: 12px; } .control-center-list { background: transparent; } .control-center .notification-row:focus, .control-center .notification-row:hover { opacity: 1; background: #24283b; } .notification { border-radius: 8px; margin: 6px 12px; box-shadow: 0 0 0 1px rgba(125,196,228,.3), 0 1px 3px 1px rgba(0,0,0,.7), 0 2px 6px 2px rgba(0,0,0,.3); padding: 0; } .widget-title { margin: 8px; font-size: 1.5rem; color: #c0caf5; } .widget-dnd { margin: 8px; font-size: 1.1rem; color: #c0caf5; } .widget-dnd > switch { font-size: initial; border-radius: 8px; background: #414868; border: 1px solid #7dcae4; } .widget-dnd > switch:checked { background: #7dcae4; } .widget-mpris { color: #c0caf5; background: #24283b; padding: 8px; margin: 8px; border-radius: 8px; } .widget-mpris-player { padding: 8px; margin: 8px; } .widget-mpris-title { font-weight: bold; font-size: 1.25rem; } .widget-mpris-subtitle { font-size: 1.1rem; color: #9ece6a; } .widget-volume, .widget-backlight, .widget-menubar { background: #24283b; padding: 8px; margin: 8px; border-radius: 8px; color: #c0caf5; } .widget-menubar .menu-item button { background: #1f2335; color: #c0caf5; border-radius: 8px; padding: 6px 10px; margin: 4px; border: 1px solid #2e3440; font-family: "JetBrainsMonoNL Nerd Font"; } .widget-menubar .menu-item button:hover { background: #414868; border-color: #7dcae4; } .topbar-buttons button { border: none; background: transparent; color: #c0caf5; font-size: 1.1rem; border-radius: 8px; margin: 0 4px; padding: 8px; } .topbar-buttons button:hover { background: #414868; } .topbar-buttons button:active { background: #7dcae4; color: #1a1b26; } ''; }; }; }