diff --git a/home/sway/default.nix b/home/sway/default.nix index fd3c496..046cee7 100644 --- a/home/sway/default.nix +++ b/home/sway/default.nix @@ -9,6 +9,7 @@ imports = [ ./swayidle.nix ./swaylock.nix + ./swaync ./waybar ]; diff --git a/home/sway/swaync/config.nix b/home/sway/swaync/config.nix new file mode 100644 index 0000000..8223d62 --- /dev/null +++ b/home/sway/swaync/config.nix @@ -0,0 +1,108 @@ +{ + #"$schema" = "/etc/xdg/swaync/configSchema.json"; + control-center-height = 1025; + control-center-margin-bottom = 10; + control-center-margin-left = 10; + control-center-margin-right = 10; + control-center-margin-top = 10; + control-center-width = 500; + fit-to-screen = true; + hide-on-action = true; + hide-on-clear = false; + image-visibility = "when-available"; + keyboard-shortcuts = true; + notification-body-image-height = 100; + notification-body-image-width = 200; + notification-icon-size = 64; + notification-visibility = { + nextcloud = { + desktop-entry = "com.nextcloud.desktopclient.nextcloud"; + state = "muted"; + }; + }; + notification-window-width = 500; + positionX = "right"; + positionY = "top"; + script-fail-notify = true; + timeout = 10; + timeout-critical = 0; + timeout-low = 5; + transition-time = 200; + widget-config = { + #"buttons-grid" = { + #actions = [ + #{ + #command = "systemctl poweroff"; + #label = "󰐥"; + #} + #{ + #command = "systemctl reboot"; + #label = "󰜉"; + #} + #{ + #command = "swaylock"; + #label = "󰌾"; + #} + #{ + #command = "swaymsg exit"; + #label = "󰍃"; + #} + #{ + #command = "systemctl suspend"; + #label = "󰏥"; + #} + #{ + #command = "pactl set-sink-mute @DEFAULT_SINK@ toggle"; + #label = "󰕾"; + #} + #{ + #command = "pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + #label = "󰍬"; + #} + #{ + #command = "nmtui"; + #label = "󰖩"; + #} + #{ + #command = "blueman-manager"; + #label = "󰂯"; + #} + #{ + #command = "kooha"; + #label = ""; + #} + #]; + #}; + backlight = { + label = "󰃟"; + }; + dnd = { + text = "Do Not Disturb"; + }; + label = { + max-lines = 1; + text = "Notification Center"; + }; + mpris = { + image-radius = 7; + image-size = 96; + }; + title = { + button-text = "Clear"; + clear-all-button = true; + text = "Notifications"; + }; + volume = { + label = "󰕾"; + }; + }; + widgets = [ + "dnd" + "buttons-grid" + "mpris" + "volume" + "backlight" + "title" + "notifications" + ]; +} diff --git a/home/sway/swaync/default.nix b/home/sway/swaync/default.nix new file mode 100644 index 0000000..aade8b1 --- /dev/null +++ b/home/sway/swaync/default.nix @@ -0,0 +1,31 @@ +{ lib, ... }: +let + enable = true; + swayncFolder = ".config/swaync"; + themes = import ./themes; +in +{ + + home.file = + { + swaync-config = { + inherit enable; + target = "${swayncFolder}/config.json"; + text = builtins.toJSON (import ./config.nix); + }; + + swaync-theme = { + inherit enable; + target = "${swayncFolder}/style.css"; + text = themes.gruvbox; + }; + } + // lib.mapAttrs' ( + name: value: + lib.nameValuePair "swaync-theme-${name}" { + inherit enable; + target = "${swayncFolder}/${name}.css"; + text = value; + } + ) themes; +} diff --git a/home/sway/swaync/themes/catppuccin.css b/home/sway/swaync/themes/catppuccin.css new file mode 100644 index 0000000..aa5d373 --- /dev/null +++ b/home/sway/swaync/themes/catppuccin.css @@ -0,0 +1,342 @@ +* { + all: unset; + font-size: 14px; + font-family: "Ubuntu Nerd Font"; + transition: 200ms; +} + +trough highlight { + background: #c6d0f5; +} + +scale trough { + margin: 0rem 1rem; + background-color: #414559; + min-height: 8px; + min-width: 70px; +} + +slider { + background-color: #8caaee; +} + +.floating-notifications.background .notification-row .notification-background { + box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #414559; + border-radius: 12.6px; + margin: 18px; + background-color: #303446; + color: #c6d0f5; + padding: 0; +} + +.floating-notifications.background .notification-row .notification-background .notification { + padding: 7px; + border-radius: 12.6px; +} + +.floating-notifications.background .notification-row .notification-background .notification.critical { + box-shadow: inset 0 0 7px 0 #e78284; +} + +.floating-notifications.background .notification-row .notification-background .notification .notification-content { + margin: 7px; +} + +.floating-notifications.background .notification-row .notification-background .notification .notification-content .summary { + color: #c6d0f5; +} + +.floating-notifications.background .notification-row .notification-background .notification .notification-content .time { + color: #a5adce; +} + +.floating-notifications.background .notification-row .notification-background .notification .notification-content .body { + color: #c6d0f5; +} + +.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * { + min-height: 3.4em; +} + +.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action { + border-radius: 7px; + color: #c6d0f5; + background-color: #414559; + box-shadow: inset 0 0 0 1px #51576d; + margin: 7px; +} + +.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:hover { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #414559; + color: #c6d0f5; +} + +.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:active { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #85c1dc; + color: #c6d0f5; +} + +.floating-notifications.background .notification-row .notification-background .close-button { + margin: 7px; + padding: 2px; + border-radius: 6.3px; + color: #303446; + background-color: #e78284; +} + +.floating-notifications.background .notification-row .notification-background .close-button:hover { + background-color: #ea999c; + color: #303446; +} + +.floating-notifications.background .notification-row .notification-background .close-button:active { + background-color: #e78284; + color: #303446; +} + +.control-center { + box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #414559; + border-radius: 12.6px; + margin: 18px; + background-color: #303446; + color: #c6d0f5; + padding: 14px; +} + +.control-center .widget-title > label { + color: #c6d0f5; + font-size: 1.3em; +} + +.control-center .widget-title button { + border-radius: 7px; + color: #c6d0f5; + background-color: #414559; + box-shadow: inset 0 0 0 1px #51576d; + padding: 8px; +} + +.control-center .widget-title button:hover { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #626880; + color: #c6d0f5; +} + +.control-center .widget-title button:active { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #85c1dc; + color: #303446; +} + +.control-center .notification-row .notification-background { + border-radius: 7px; + color: #c6d0f5; + background-color: #414559; + box-shadow: inset 0 0 0 1px #51576d; + margin-top: 14px; +} + +.control-center .notification-row .notification-background .notification { + padding: 7px; + border-radius: 7px; +} + +.control-center .notification-row .notification-background .notification.critical { + box-shadow: inset 0 0 7px 0 #e78284; +} + +.control-center .notification-row .notification-background .notification .notification-content { + margin: 7px; +} + +.control-center .notification-row .notification-background .notification .notification-content .summary { + color: #c6d0f5; +} + +.control-center .notification-row .notification-background .notification .notification-content .time { + color: #a5adce; +} + +.control-center .notification-row .notification-background .notification .notification-content .body { + color: #c6d0f5; +} + +.control-center .notification-row .notification-background .notification > *:last-child > * { + min-height: 3.4em; +} + +.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action { + border-radius: 7px; + color: #c6d0f5; + background-color: #232634; + box-shadow: inset 0 0 0 1px #51576d; + margin: 7px; +} + +.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:hover { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #414559; + color: #c6d0f5; +} + +.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:active { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #85c1dc; + color: #c6d0f5; +} + +.control-center .notification-row .notification-background .close-button { + margin: 7px; + padding: 2px; + border-radius: 6.3px; + color: #303446; + background-color: #ea999c; +} + +.close-button { + border-radius: 6.3px; +} + +.control-center .notification-row .notification-background .close-button:hover { + background-color: #e78284; + color: #303446; +} + +.control-center .notification-row .notification-background .close-button:active { + background-color: #e78284; + color: #303446; +} + +.control-center .notification-row .notification-background:hover { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #838ba7; + color: #c6d0f5; +} + +.control-center .notification-row .notification-background:active { + box-shadow: inset 0 0 0 1px #51576d; + background-color: #85c1dc; + color: #c6d0f5; +} + +.notification.critical progress { + background-color: #e78284; +} + +.notification.low progress, +.notification.normal progress { + background-color: #8caaee; +} + +.control-center-dnd { + margin-top: 5px; + border-radius: 8px; + background: #414559; + border: 1px solid #51576d; + box-shadow: none; +} + +.control-center-dnd:checked { + background: #414559; +} + +.control-center-dnd slider { + background: #51576d; + border-radius: 8px; +} + +.widget-dnd { + margin: 0px; + font-size: 1.1rem; +} + +.widget-dnd > switch { + font-size: initial; + border-radius: 8px; + background: #414559; + border: 1px solid #51576d; + box-shadow: none; +} + +.widget-dnd > switch:checked { + background: #414559; +} + +.widget-dnd > switch slider { + background: #51576d; + border-radius: 8px; + border: 1px solid #737994; +} + +.widget-mpris .widget-mpris-player { + background: #414559; + padding: 7px; +} + +.widget-mpris .widget-mpris-title { + font-size: 1.2rem; +} + +.widget-mpris .widget-mpris-subtitle { + font-size: 0.8rem; +} + +.widget-menubar > box > .menu-button-bar > button > label { + font-size: 3rem; + padding: 0.5rem 2rem; +} + +.widget-menubar > box > .menu-button-bar > :last-child { + color: #e78284; +} + +.power-buttons button:hover, +.powermode-buttons button:hover, +.screenshot-buttons button:hover { + background: #414559; +} + +.control-center .widget-label > label { + color: #c6d0f5; + font-size: 2rem; +} + +.widget-buttons-grid { + padding-top: 1rem; +} + +.widget-buttons-grid > flowbox > flowboxchild > button label { + font-size: 2.5rem; +} + +.widget-volume { + padding-top: 1rem; +} + +.widget-volume label { + font-size: 1.5rem; + color: #85c1dc; +} + +.widget-volume trough highlight { + background: #85c1dc; +} + +.widget-backlight trough highlight { + background: #e5c890; +} + +.widget-backlight label { + font-size: 1.5rem; + color: #e5c890; +} + +.widget-backlight .KB { + padding-bottom: 1rem; +} + +.image { + padding-right: 0.5rem; +} diff --git a/home/sway/swaync/themes/default.nix b/home/sway/swaync/themes/default.nix new file mode 100644 index 0000000..5279457 --- /dev/null +++ b/home/sway/swaync/themes/default.nix @@ -0,0 +1,4 @@ +{ + gruvbox = builtins.readFile ./gruvbox.css; + catppuccin = builtins.readFile ./catppuccin.css; +} diff --git a/home/sway/swaync/themes/gruvbox.css b/home/sway/swaync/themes/gruvbox.css new file mode 100644 index 0000000..c5336c4 --- /dev/null +++ b/home/sway/swaync/themes/gruvbox.css @@ -0,0 +1,238 @@ +@define-color dark0_hard #1d2021; +/*{{{*/ +@define-color dark0 #282828; +@define-color dark0_soft #32302f; +@define-color dark1 #3c3836; +@define-color dark2 #504945; +@define-color dark3 #665c54; +@define-color dark4 #7c6f64; +@define-color dark4_256 #7c6f64; +@define-color gray_245 #928374; +@define-color gray_244 #928374; +@define-color light0_hard #f9f5d7; +@define-color light0 #fbf1c7; +@define-color light0_soft #f2e5bc; +@define-color light1 #ebdbb2; +@define-color light2 #d5c4a1; +@define-color light3 #bdae93; +@define-color light4 #a89984; +@define-color light4_256 #a89984; +@define-color bright_red #fb4934; +@define-color bright_green #b8bb26; +@define-color bright_yellow #fabd2f; +@define-color bright_blue #83a598; +@define-color bright_purple #d3869b; +@define-color bright_aqua #8ec07c; +@define-color bright_orange #fe8019; +@define-color neutral_red #cc241d; +@define-color neutral_green #98971a; +@define-color neutral_yellow #d79921; +@define-color neutral_blue #458588; +@define-color neutral_purple #b16286; +@define-color neutral_aqua #689d6a; +@define-color neutral_orange #d65d0e; +@define-color faded_red #9d0006; +@define-color faded_green #79740e; +@define-color faded_yellow #b57614; +@define-color faded_blue #076678; +@define-color faded_purple #8f3f71; +@define-color faded_aqua #427b58; +@define-color faded_orange #af3a03; +/*}}}*/ + +* { + font-family: FiraCode; +} + +.widget-buttons-grid .text-button, +.widget-mpris-player, +.control-center, +.control-center-clear-all, +.notification { + border: 5px solid black; + border-radius: 10px; + box-shadow: 5px 5px black; +} + +.control-center { + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + background-color: @neutral_yellow; +} + +.widget-dnd, +.widget-title { + color: black; + font-size: 16px; + font-weight: bold; +} + +.widget-dnd>switch { + border-radius: 5px; + background: #665c54; + border: 3px solid black; +} + +.widget-dnd>switch:checked { + background: @neutral_red; +} + +.widget-dnd>switch slider { + background: black; + border-radius: 3px +} + +.widget-mpris-player { + background-color: @neutral_blue; +} + +.widget-mpris-album-art { + box-shadow: none; +} + +.widget-mpris>.horizontal>.image-button { + margin-top: 60px; + margin-bottom: 60px; + border-radius: 15px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border: 5px solid black; + border-left: none; + background-color: @faded_blue; + box-shadow: 0px 5px black; +} + +.widget-mpris>.horizontal>.image-button:nth-child(3) { + border-radius: 15px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border: 5px solid black; + border-right: none; +} + +.widget-buttons-grid { + background: none; + padding: 0px 10px; + margin-top: 1px; +} + +/* move buttons grid 20px up if there's the mpris player above it */ +.widget-mpris+.widget-buttons-grid { + margin-top: -20px; +} + +.widget-buttons-grid .text-button { + background-color: @neutral_red; + font-size: 20px; +} + +.widget-buttons-grid .text-button:hover { + background-color: @bright_red; +} + +.control-center-clear-all { + background-color: @faded_purple; +} + +.control-center-clear-all:hover { + background-color: @neutral_purple; +} + +/* The "No Notifications" text and image */ +.control-center-list-placeholder { + color: black; +} + +/* Notification popup styling follows. */ + +.notification { + border: 5px solid black; + box-shadow: 5px 5px black; + background-color: @neutral_yellow; +} + +.control-center .notification { + background-color: @faded_orange; +} + +.body, +.summary, +.notification-action { + color: black; +} + +.control-center .body, +.control-center .summary, +.control-center .notification-action { + color: white; +} + +.notification-action { + border-color: black; +} + +/* .control-center .notification-action { */ +/* border-color: white; */ +/* } */ + +.notification-action:hover { + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + background-color: @bright_yellow; +} + +.notification-default-action:hover { + border-top-left-radius: 6px; + border-top-right-radius: 6px; + background-color: @bright_yellow; +} + + +.control-center .notification-action:hover { + background-color: @neutral_orange; +} + +.control-center .notification-default-action:hover { + background-color: @neutral_orange; +} + +.close-button { + border: 4px solid black; + border-radius: 10px; + margin: 6px; + padding: 0px; + background-color: @neutral_red; + color: black; +} + +.close-button:hover { + background-color: @bright_red; +} + +.time { + margin-right: 40px; +} + +.notification-group-header, +.notification-group-icon { + color: black; +} + +.notification-group-close-all-button, +.notification-group-collapse-button { + border: 4px solid black; + border-radius: 10px; + padding: 2px; + margin: 3px; + box-shadow: 3px 3px black; + color: black; +} + +.notification-group-close-all-button { + background-color: @neutral_red; +} + +.notification-group-collapse-button { + background-color: @neutral_blue; +}