♻️ refactor(swaync): change a lot of stuff

This commit is contained in:
retrozinndev
2024-10-21 21:08:21 -03:00
parent d6a45631d0
commit 44c403b7bb
3 changed files with 144 additions and 118 deletions
+3 -4
View File
@@ -1,5 +1,5 @@
{ {
"$schema": "/etc/xdg/swaync/configSchema.json", "$schema": "configSchema.json",
"positionX": "right", "positionX": "right",
"positionY": "top", "positionY": "top",
"layer": "overlay", "layer": "overlay",
@@ -43,7 +43,6 @@
"notification-visibility": { "notification-visibility": {
"spotify": { "spotify": {
"state": "muted", "state": "muted",
"urgency": "Low",
"app-name": "Spotify" "app-name": "Spotify"
} }
}, },
@@ -100,8 +99,8 @@
"label": " Bluetooth", "label": " Bluetooth",
"type": "toggle", "type": "toggle",
"active": false, "active": false,
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && bluetoothctl power off || bluetoothctl power on'", "command": "sh -c 'sh $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh Toggle_state'",
"update-command": "sh -c '[[ $(bluetoothctl show | grep Powered | sed 's/Powered: //') =~ true ]] && echo true || echo false'" "update-command": "sh -c 'echo $(sh $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh) Update_state'"
}, },
{ {
"label": "󰒲 DNDisturb", "label": "󰒲 DNDisturb",
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
Update_state() {
if [[ $(bluetoothctl show | grep "Powered" | sed "s/Powered: //" | xargs) == "yes" ]]
then
echo true
else
echo false
fi
}
Toggle_state() {
if [[ $SWAYNC_TOGGLE_STATE == "true" ]]
then
bluetoothctl power off
else
bluetoothctl power on
fi
}
+122 -114
View File
@@ -17,17 +17,26 @@ tooltip {
/* Notifications (Not from control center) */ /* Notifications (Not from control center) */
.floating-notifications .notification-row .notification-background { .floating-notifications .notification-row .notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #313244; box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #313244;
border-radius: 16px; border-radius: 16px;
margin: 18px; margin: 18px;
background-color: @background; background-color: @background;
color: @text; color: @text;
padding: 0; padding: 0;
} }
.notification-row .notification-background .notification { .notification-row .notification-background .notification {
padding: 7px; padding: 7px;
border-radius: 16px; }
.notification-row > * > * > * > * > *:first-child {
min-height: 3.4em;
border-top-left-radius: 32px;
border-top-right-radius: 32px;
}
.notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
} }
.notification-row .notification-background .notification.critical { .notification-row .notification-background .notification.critical {
@@ -35,119 +44,120 @@ tooltip {
} }
.notification-row .notification-background .notification { .notification-row .notification-background .notification {
padding: 14px; padding: 14px;
}
.notification-row .notification .image {
margin-right: .5em;
border-radius: 8px;
} }
.notification-row .notification-background .notification .notification-content .summary { .notification-row .notification-background .notification .notification-content .summary {
font-size: 1.2em; font-size: 1.2em;
margin-bottom: 2px; margin-bottom: 2px;
font-weight: 600; font-weight: 600;
color: @foreground; color: @foreground;
} }
.notification-row .notification-background .notification .notification-content .time { .notification-row .notification-background .notification .notification-content .time {
color: @foreground; color: @foreground;
} }
.notification-row .notification-background .notification .notification-content .body { .notification-row .notification-background .notification .notification-content .body {
color: @foreground; color: @foreground;
margin-bottom: .6em; margin-bottom: .6em;
}
.notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
} }
.notification .notification-action { .notification .notification-action {
border-radius: 16px; border-radius: 16px;
color: @text; color: @text;
font-weight: 600; font-weight: 600;
background-color: @bg-button; background-color: @bg-button;
border: .6px solid @background; border: .6px solid @background;
margin: .3em 0; margin: .3em 0;
} }
.notification-row .notification .notification-action:hover { .notification-row .notification .notification-action:hover {
background-color: @hover; background-color: @hover;
} }
.notification-row .notification .notification-action:active { .notification-row .notification .notification-action:active {
background-color: @active; background-color: @active;
color: @text; color: @text;
} }
.close-button { .close-button {
border-radius: 8px; border-radius: 8px;
margin: 4px; margin: 4px;
padding: 2.5px; padding: 2.5px;
border-radius: 8px; border-radius: 8px;
color: @crust; color: @crust;
background-color: @bg-button; background-color: @bg-button;
} }
.close-button:hover { .close-button:hover {
background-color: @hover; background-color: @hover;
} }
.close-button:active { .close-button:active {
background-color: @active; background-color: @active;
} }
/* Control Center Notifications */ /* Control Center Notifications */
.control-center .notification-row .notification-background { .control-center .notification-row .notification-background {
border-radius: 16px; border-radius: 16px;
background-color: @color1; background-color: @color1;
margin-top: 14px; margin-top: 14px;
} }
.control-center .notification-row .notification-background .notification { .control-center .notification-row .notification-background .notification {
padding: 10px; padding: 10px;
} }
.control-center .notification-row .notification-background .notification.critical { .control-center .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 0px 2px @color3; box-shadow: inset 0 0 0px 2px @color3;
border: none; border: none;
} }
.control-center .notification-row .notification-background .notification .notification-content { .control-center .notification-row .notification-background .notification .notification-content {
margin: 8px; margin: 8px;
font-family: Cantarell, "Noto Sans CJK" font-family: Cantarell, "Noto Sans CJK"
} }
.control-center .notification-row .notification-background .notification .notification-content .summary { .control-center .notification-row .notification-background .notification .notification-content .summary {
font-family: Cantarell, "Noto Sans CJK"; font-family: Cantarell, "Noto Sans CJK";
color: @foreground; color: @foreground;
font-size: 1.2em; font-size: 1.2em;
font-weight: 600; font-weight: 600;
} }
.control-center .notification-row .notification-background .notification .notification-content .time { .control-center .notification-row .notification-background .notification .notification-content .time {
color: @foreground; color: @foreground;
} }
.control-center .notification-row .notification-background .notification .notification-content .body { .control-center .notification-row .notification-background .notification .notification-content .body {
color: @foreground; color: @foreground;
} }
.control-center .notification-row .notification-background .notification > *:last-child > * { .control-center .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em; min-height: 3.4em;
} }
.notification.critical progress, .notification.critical progress,
.notification.low progress, .notification.low progress,
.notification.normal progress { .notification.normal progress {
background-color: @color3; background-color: @color3;
} }
/* Control Center */ /* Control Center */
.control-center { .control-center {
box-shadow: 0 2 10px 1px black, inset 0 0 0px 2px shade(@background, 2); box-shadow: 0 2 10px 1px black, inset 0 0 0px 2px shade(@background, 2);
border-radius: 12.6px; border-radius: 12.6px;
margin: 18px; margin: 18px;
background: @background; background: @background;
color: @text; color: @text;
padding: 1.5rem; padding: 1.5rem;
} }
.control-center .widget-title { .control-center .widget-title {
@@ -155,10 +165,10 @@ tooltip {
} }
.control-center .widget-title > label { .control-center .widget-title > label {
color: @text; color: @text;
font-size: 1.6em; font-size: 1.6em;
font-weight: 600; font-weight: 600;
margin-bottom: 10px; margin-bottom: 10px;
} }
.control-center .widget-title button { .control-center .widget-title button {
@@ -168,11 +178,11 @@ tooltip {
} }
.control-center .widget-title button:hover { .control-center .widget-title button:hover {
background-color: @hover; background-color: @hover;
} }
.control-center .widget-title button:active { .control-center .widget-title button:active {
background-color: @active; background-color: @active;
} }
.control-center .widget-title button label { .control-center .widget-title button label {
@@ -185,41 +195,40 @@ tooltip {
} }
.control-center .widget-label > label { .control-center .widget-label > label {
color: @foreground; color: @foreground;
font-weight: 600; font-weight: 600;
font-size: 1.6em; font-size: 1.6em;
} }
.control-center-dnd { .control-center-dnd {
margin-top: 5px; margin-top: 5px;
border-radius: 8px; border-radius: 8px;
background: #313244; background: #313244;
border: 1px solid #45475a; border: 1px solid #45475a;
box-shadow: none; box-shadow: none;
} }
.control-center-dnd:checked { .control-center-dnd:checked {
background: #313244; background: #313244;
} }
.widget-dnd { .widget-dnd {
margin: 0px; margin: 0px;
font-size: 1.1rem; font-size: 1.1rem;
} }
.widget-dnd > switch { .widget-dnd > switch {
font-size: initial; font-size: initial;
border-radius: 16px; border-radius: 16px;
background: @background; background: @background;
border: 1px solid #45475a; border: 1px solid #45475a;
box-shadow: none; box-shadow: none;
} }
.widget-dnd > switch slider { .widget-dnd > switch slider {
background: @highlight; background: @highlight;
border-radius: 16px; border-radius: 16px;
border: 1px solid #6c7086; border: 1px solid #6c7086;
} }
/* MPRIS */ /* MPRIS */
@@ -229,14 +238,14 @@ tooltip {
} }
.widget-mpris .widget-mpris-player { .widget-mpris .widget-mpris-player {
box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .3);
padding: 24px; padding: 24px;
background-color: transparent; background-color: transparent;
padding-bottom: 16px; padding-bottom: 16px;
border-radius: 16px; border-radius: 16px;
outline: none; outline: none;
margin-left: 8px; margin-left: 8px;
margin-right: 8px; margin-right: 8px;
} }
/* mpris controls */ /* mpris controls */
@@ -252,6 +261,11 @@ tooltip {
background: @active; background: @active;
} }
.widget-mpris .image {
padding-right: 0.5rem;
border-radius: 16px;
}
.widget-mpris .widget-mpris-title { .widget-mpris .widget-mpris-title {
font-family: "Cantarell", "Noto Sans"; font-family: "Cantarell", "Noto Sans";
font-weight: 700; font-weight: 700;
@@ -260,24 +274,24 @@ tooltip {
} }
.widget-mpris .widget-mpris-subtitle { .widget-mpris .widget-mpris-subtitle {
font-size: 0.8rem; font-size: 0.8rem;
text-shadow: 1px 1px 2px black; text-shadow: 1px 1px 2px black;
} }
.widget-menubar > box > .menu-button-bar > button > label { .widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem; font-size: 3rem;
padding: 0.5rem 2rem; padding: 0.5rem 2rem;
} }
.widget-menubar > box > .menu-button-bar > :last-child { .widget-menubar > box > .menu-button-bar > :last-child {
color: #f38ba8; color: #f38ba8;
} }
.power-buttons button:hover, .power-buttons button:hover,
.powermode-buttons button:hover, .powermode-buttons button:hover,
.screenshot-buttons button:hover { .screenshot-buttons button:hover {
background: #313244; background: #313244;
} }
.widget-buttons-grid { .widget-buttons-grid {
@@ -349,7 +363,6 @@ tooltip {
} }
.widget-volume trough slider:active, .widget-volume trough slider:active,
.widget-backlight trough slider:active { .widget-backlight trough slider:active {
padding: 10px;
background: shade(@foreground, .75); background: shade(@foreground, .75);
} }
@@ -366,10 +379,10 @@ tooltip {
} }
.widget-volume label { .widget-volume label {
font-size: 1.5rem; font-size: 1.5rem;
color: @text; color: @text;
margin-left: 5px; margin-left: 5px;
margin-right: 6px; margin-right: 6px;
} }
.widget-backlight { .widget-backlight {
@@ -377,17 +390,12 @@ tooltip {
} }
.widget-backlight label { .widget-backlight label {
font-size: 1.5rem; font-size: 1.5rem;
margin-left: 7px; margin-left: 7px;
margin-right: 3px; margin-right: 3px;
color: @text; color: @text;
} }
.widget-backlight .KB { .widget-backlight .KB {
padding-bottom: 1rem; padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
border-radius: 16px;
} }