home/services/swaync: theme swaync dynamically (similar to waybar)

This commit is contained in:
Anthony Rodriguez 2024-11-26 15:38:25 +01:00
parent 20bbc9736c
commit b1e6fe4407
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
4 changed files with 471 additions and 8 deletions

View file

@ -1,7 +0,0 @@
{lib, ...}: {
services.swaync = {
enable = true;
};
# systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1";
systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce "";
}

View file

@ -0,0 +1,20 @@
{
osConfig,
lib,
lib',
...
}: let
inherit (lib) optionalString;
inherit (lib') generateGtkColors;
inherit (osConfig.theme.scheme) palette;
inherit (builtins) readFile;
in {
services.swaync = {
enable = true;
style =
optionalString osConfig.theme.enable generateGtkColors lib palette
+ readFile ./style.css;
};
# systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1";
systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce "";
}

View file

@ -0,0 +1,450 @@
* {
all: unset;
font-size: 14px;
font-family: "Ubuntu Nerd Font";
transition:
background 200ms,
border-radius 200ms; /* exclude color from transition so it looks more natural */
}
trough highlight {
background: @base05;
}
scale trough {
margin: 0rem 1rem;
background-color: @base02;
min-height: 8px;
min-width: 70px;
}
slider {
background-color: @base0D;
}
.floating-notifications.background .notification-row .notification-background {
box-shadow:
0 0 8px 0 rgba(0, 0, 0, 0.8),
inset 0 0 0 1px @base02;
border-radius: 12.6px;
margin: 18px;
background-color: @base00;
color: @base05;
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 @base08;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content {
margin: 7px;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.summary {
color: @base05;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.time {
color: @base03;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.body {
color: @base05;
}
.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: @base05;
background-color: @base02;
box-shadow: inset 0 0 0 1px @base03;
margin: 7px;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:hover {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base02;
color: @base05;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:active {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base0C;
color: @base05;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: @base00;
background-color: @base08;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button:hover {
background-color: @base08;
color: @base00;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button:active {
background-color: @base08;
color: @base00;
}
.control-center {
box-shadow:
0 0 8px 0 rgba(0, 0, 0, 0.8),
inset 0 0 0 1px @base02;
border-radius: 12.6px;
margin: 18px;
background-color: @base00;
color: @base05;
padding: 14px;
}
.control-center .widget-title > label {
color: @base05;
font-size: 1.3em;
}
.control-center .widget-title button {
border-radius: 7px;
color: @base05;
background-color: @base02;
box-shadow: inset 0 0 0 1px @base03;
padding: 8px;
}
.control-center .widget-title button:hover {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base04;
color: @base05;
}
.control-center .widget-title button:active {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base0C;
color: @base00;
}
.control-center .notification-row .notification-background {
border-radius: 7px;
color: @base05;
background-color: @base02;
box-shadow: inset 0 0 0 1px @base03;
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 @base08;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content {
margin: 7px;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.summary {
color: @base05;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.time {
color: @base03;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.body {
color: @base05;
}
.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: @base05;
background-color: @base00;
box-shadow: inset 0 0 0 1px @base03;
margin: 7px;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:hover {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base02;
color: @base05;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:active {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base0C;
color: @base05;
}
.control-center .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: @base00;
background-color: @base08;
}
.control-center .notification-row .notification-background .close-button:hover {
background-color: @base08;
color: @base00;
}
.control-center
.notification-row
.notification-background
.close-button:active {
background-color: @base08;
color: @base00;
}
.control-center .notification-row .notification-background:hover {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base04;
color: @base05;
}
.control-center .notification-row .notification-background:active {
box-shadow: inset 0 0 0 1px @base03;
background-color: @base0C;
color: @base05;
}
.notification.critical progress {
background-color: @base08;
}
.notification.low progress,
.notification.normal progress {
background-color: @base0D;
}
.control-center-dnd {
margin-top: 5px;
border-radius: 8px;
background: @base02;
border: 1px solid @base03;
box-shadow: none;
}
.control-center-dnd:checked {
background: @base0C;
}
.control-center-dnd slider {
background: @base0C;
border-radius: 8px;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 8px;
background: @base02;
border: 1px solid @base03;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: @base0C;
color: @base00;
}
.widget-dnd > switch slider {
background: @base03;
border-radius: 8px;
border: 1px solid @base03;
}
.widget-mpris .widget-mpris-player {
background: @base02;
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: @base08;
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: @base02;
}
.control-center .widget-label > label {
color: @base05;
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: @base0C;
}
.widget-volume trough highlight {
background: @base0C;
}
.widget-backlight trough highlight {
background: @base0A;
}
.widget-backlight label {
font-size: 1.5rem;
color: @base0A;
}
.widget-backlight .KB {
padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
}

View file

@ -35,7 +35,7 @@ in {
"${home}/programs/niri"
"${home}/programs/waybar"
"${home}/services/swaync.nix"
"${home}/services/swaync"
"${home}/programs/fuzzel.nix"
"${home}/programs/swaybg.nix"
"${home}/programs/swaylock.nix"