💥 fix(swaync): bluetooth toggle not working, no fit screen size, move notifications up

This commit is contained in:
retrozinndev
2024-11-10 13:00:34 -03:00
parent 4c684f9c14
commit 0c297bb9ff
9 changed files with 576 additions and 514 deletions
+280
View File
@@ -0,0 +1,280 @@
/* Control Center Notifications */
.control-center .notification-row .notification-background .notification {
border-radius: 18px;
background-color: shade(@color1, .7);
border: .15em solid shade(@color1, .85);
padding: 10px;
margin-bottom: 11px;
}
.control-center .notification-row .notification-background .notification:first-child {
margin-top: 8px;
}
.control-center .notification-row .notification-background .notification:last-child {
margin-bottom: 0;
}
.control-center .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 0px 2px @color1;
border: none;
}
.control-center .notification-row .notification-background .notification .notification-content {
margin: 8px;
font-family: "Cantarell", "Noto Sans CJK"
}
.control-center .notification-row .notification-background .notification .notification-content .summary {
font-family: "Cantarell", "Noto Sans CJK";
color: @foreground;
font-size: 1.2em;
font-weight: 600;
}
.control-center .notification-row .notification-background .notification .notification-content .time {
color: @foreground;
}
.control-center .notification-row .notification-background .notification .notification-content .body {
color: @foreground;
}
.control-center .notification-row .notification-background .notification .image {
box-shadow: 0 0 3px 0 black;
}
.control-center .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.control-center .notification-row .close-button {
margin-top: 12px;
margin-right: 2px;
border-radius: 6px;
padding: 1px;
background: @color1;
}
/* Control Center stuff */
.control-center {
box-shadow: 0 2 10px 1px black;
border-radius: 16px;
margin: 14px;
background: @background;
color: @text;
padding: 28px;
}
.widget-title > label {
color: @foreground;
font-size: 1.6em;
font-weight: 600;
margin-bottom: 10px;
}
.widget-title button {
border-radius: 8px;
background: @bg-button;
padding: 6px 8px;
}
.widget-title button:hover {
background-color: @hover;
}
.widget-title button:active {
background-color: @active;
}
.widget-title button label {
color: @foreground;
font-weight: 600;
}
.widget-label {
padding: .2rem;
}
.widget-label > label {
color: @foreground;
font-weight: 600;
font-size: 1.6em;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: 8px;
border-radius: 16px;
background: @background;
box-shadow: inset 0 0 0 1px gray;
}
.widget-dnd > switch slider {
background: @highlight;
border-radius: 16px;
margin: -2px;
}
/* MPRIS */
.widget-mpris {
padding: 0px 0px;
box-shadow: none;
border: .1em solid @color1;
}
.widget-mpris .widget-mpris-player {
box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .3);
padding: 24px;
background-color: transparent;
padding-bottom: 16px;
border-radius: 16px;
outline: none;
padding: 18px;
border: none;
margin: 0 0 0 0;
}
/* mpris controls */
.widget-mpris .widget-mpris-player > *:last-child > button {
border-radius: 8px;
}
.widget-mpris .widget-mpris-player > *:last-child > button:hover {
background: @hover;
}
.widget-mpris .widget-mpris-player > *:last-child > button:active {
background: @active;
}
.widget-mpris > box > button {
box-shadow: none;
}
.widget-mpris .image {
padding-right: 0.5rem;
border-radius: 16px;
}
.widget-mpris .widget-mpris-title {
font-family: "Cantarell", "Noto Sans";
font-weight: 700;
font-size: 1.2rem;
text-shadow: 1px 1px 2px black;
}
.widget-mpris .widget-mpris-subtitle {
font-size: 0.8rem;
text-shadow: 1px 1px 2px black;
}
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: #f38ba8;
}
.widget-buttons-grid {
margin-top: 2px;
}
.widget-buttons-grid button {
background: @bg-button;
padding: 14px 12px;
border-radius: 16px;
margin: 2px;
}
.widget-buttons-grid button:hover {
background: @hover;
}
.widget-buttons-grid button:active {
background: @active;
}
.widget-buttons-grid button:checked {
background: @color2;
}
.widget-buttons-grid button label {
font-size: 1em;
color: @foreground;
font-weight: 600;
}
.horizontal trough { /* slider's background */
background-color: shade(@color1, .4);
margin: 0 4px;
border-radius: 16px;
padding: 4px;
}
.horizontal trough slider { /* slider's dot indicator */
background: @foreground;
box-shadow: inset 0 0 1px .5px @background-alt;
min-width: 24px;
min-height: 24px;
margin: -4px;
border-radius: 50%;
}
.horizontal trough slider:active {
background: shade(@foreground, .75);
}
.horizontal trough highlight {
border-top-left-radius: 14px;
border-bottom-left-radius: 14px;
background: shade(@highlight, .9);
}
.widget-volume {
margin-top: 1rem;
margin-bottom: 0.8rem;
}
.widget-volume label {
font-size: 1.5rem;
color: @text;
margin-left: 5px;
margin-right: 6px;
}
.widget-volume .per-app-volume {
margin-top: 4px;
padding: 6px;
border-radius: 6px;
background: shade(@background, .6);
}
.widget-volume .per-app-volume > * {
margin-bottom: 6px;
}
.widget-volume .per-app-volume > *:last-child {
margin-bottom: 0;
}
.widget-backlight {
margin-bottom: 1rem;
}
.widget-backlight label {
font-size: 1.5rem;
margin-left: 7px;
margin-right: 3px;
color: @text;
}
+91
View File
@@ -0,0 +1,91 @@
.floating-notifications .notification-row .notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #313244;
border-radius: 16px;
margin: 12px;
}
.floating-notifications .notification-row .notification {
border-radius: 16px;
background-color: @background;
color: @foreground;
padding: 8px;
}
.notification-row > * > * > * > * > *:first-child {
min-height: 3.4em;
border-top-left-radius: 32px;
border-top-right-radius: 32px;
}
.notification-row .notification.critical {
box-shadow: none;
box-shadow: inset 0 0 1px 1px @color1;
}
.notification-row .notification-background .notification {
padding: 14px;
}
.notification-row .notification .image {
margin-right: 6px;
border-radius: 8px;
}
.floating-notifications .notification-row .notification-background .close-button {
border-radius: 8px;
margin-top: 4px;
margin-right: 2px;
padding: 2px;
color: @foreground;
background-color: shade(@color1, .7);
}
.notification-row .notification-background .notification .notification-content .summary {
font-size: 1.2em;
margin-bottom: 2px;
font-weight: 600;
color: @foreground;
}
.notification-row .notification-background .notification .notification-content .time {
color: @foreground;
}
.notification-row .notification-background .notification .notification-content .body {
color: @foreground;
margin-bottom: .6em;
}
.notification-row .notification .notification-action:hover {
background-color: @hover;
}
.notification-row .notification .notification-action:active {
background-color: @active;
color: @foreground;
}
/* General Notification Styles */
.notification .notification-action {
border-radius: 16px;
color: @text;
font-weight: 600;
background-color: @bg-button;
border: .6px solid @background;
margin: .3em 0;
}
.close-button:hover {
background-color: @color1;
}
.close-button:active {
background-color: @color3;
}
.notification.critical progress,
.notification.low progress,
.notification.normal progress {
background-color: @color3;
}
+127 -125
View File
@@ -1,129 +1,131 @@
{
"$schema": "configSchema.json",
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "overlay",
"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": 5,
"timeout-low": 3,
"timeout-critical": 0,
"fit-to-screen": true,
"relative-timestamps": true,
"control-center-width": 500,
"control-center-height": 600,
"notification-window-width": 500,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 120,
"hide-on-clear": false,
"hide-on-action": true,
"script-fail-notify": true,
"scripts": {
"example-script": {
"exec": "echo 'Do something...'",
"urgency": "Normal"
"$schema": "configSchema.json",
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "overlay",
"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": 5,
"timeout-low": 3,
"timeout-critical": 0,
"fit-to-screen": false,
"relative-timestamps": true,
"control-center-width": 450,
"control-center-height": 900,
"notification-window-width": 500,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 120,
"hide-on-clear": false,
"hide-on-action": true,
"script-fail-notify": true,
"scripts": {
"example-script": {
"exec": "echo 'Do something...'",
"urgency": "Normal"
},
"example-action-script": {
"exec": "echo 'Do something actionable!'",
"urgency": "Normal",
"run-on": "action"
}
},
"example-action-script": {
"exec": "echo 'Do something actionable!'",
"urgency": "Normal",
"run-on": "action"
"notification-visibility": {
"spotify": {
"state": "muted",
"app-name": "Spotify"
}
},
"widgets": [
"title",
"notifications",
"mpris",
"volume",
"backlight",
"buttons-grid",
"inhibitors"
],
"widget-config": {
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear"
},
"inhibitors": {
"text": "Inhibitors"
},
"dnd": {
"text": "Do Not Disturb"
},
"label": {
"max-lines": 5,
"text": "Label Text"
},
"mpris": {
"image-size": 80,
"image-radius": 16,
"blur": true
},
"volume": {
"label": " ",
"show-per-app": true,
"show-per-app-icon": true,
"collapse-button-label": " ",
"expand-button-label": " "
},
"backlight": {
"label": " ",
"device": "scrollock",
"subsystem": "leds"
},
"buttons-grid": {
"actions": [
{
"label": " Internet",
"type": "toggle",
"active": false,
"command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/internet-toggle.sh; Toggle_state'",
"update-command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/internet-toggle.sh; Update_state'"
},
{
"label": " Bluetooth",
"type": "toggle",
"active": false,
"command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh; Toggle_state'",
"update-command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh; Update_state'"
},
{
"label": "󰒲 DND",
"type": "toggle",
"command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/dnd-toggle.sh; Toggle_state'",
"update-command": "sh -c 'source $HOME/.config/swaync/scripts/control-center/dnd-toggle.sh; Update_state'"
},
{
"label": "󰸉 Wallpaper",
"type": "normal",
"command": "bash -c 'swaync-client -cp; bash $HOME/.config/hypr/scripts/change-wallpaper.sh'"
},
{
"label": " Screenshot",
"type": "normal",
"command": "sh -c 'swaync-client -cp; hyprshot -m region -o $HOME/Screenshots'"
},
{
"label": "󰗽 Logout",
"type": "normal",
"command": "wlogout -b 5"
}
]
}
}
},
"notification-visibility": {
"spotify": {
"state": "muted",
"app-name": "Spotify"
}
},
"widgets": [
"label",
"volume",
"backlight",
"buttons-grid",
"mpris",
"inhibitors",
"title",
"notifications"
],
"widget-config": {
"title": {
"text": "Notifications",
"clear-all-button": true
},
"inhibitors": {
"text": "Inhibitors"
},
"dnd": {
"text": "Do Not Disturb"
},
"label": {
"max-lines": 5,
"text": "Control Center"
},
"mpris": {
"image-size": 96,
"image-radius": 16,
"blur": true
},
"volume": {
"label": "",
"show-per-app": true,
"show-per-app-icon": true,
"expand-button-label": "",
"collapse-button-label": ""
},
"backlight": {
"label": ""
},
"buttons-grid": {
"actions": [
{
"label": " Internet",
"type": "toggle",
"active": false,
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli n on || nmcli n off'",
"update-command": "sh -c '[[ $(nmcli n c) == full ]] && echo true || echo false'"
},
{
"label": " Bluetooth",
"type": "toggle",
"active": false,
"command": "sh -c 'sh $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh Toggle_state'",
"update-command": "sh -c 'echo $(sh $HOME/.config/swaync/scripts/control-center/bluetooth-toggle.sh) Update_state'"
},
{
"label": "󰒲 DNDisturb",
"type": "toggle",
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && swaync-client -dn || swaync-client -df'",
"update-command": "sh -c '[[ $(swaync-client -D) == true ]] && echo true || echo false'"
},
{
"label": "󰸉 Wallpaper",
"type": "normal",
"command": "bash -c 'swaync-client -cp; bash $HOME/.config/hypr/scripts/change-wallpaper.sh'"
},
{
"label": " Screenshot",
"type": "normal",
"command": "sh -c 'swaync-client -cp; hyprshot -m region -o $HOME/Screenshots'"
},
{
"label": "󰗽 Logout",
"type": "normal",
"command": "wlogout -b 5"
}
]
}
}
}
-1
View File
@@ -403,7 +403,6 @@
"image-radius": {
"type": "integer",
"description": "The border radius of the album art. Will be overriden by setting the border-radius in the style.css for the \".widget-mpris-album-art\" class",
"default": 12
},
"blur": {
+2 -2
View File
@@ -12,8 +12,8 @@ Update_state() {
Toggle_state() {
if [[ $SWAYNC_TOGGLE_STATE == "true" ]]
then
bluetoothctl power off
else
bluetoothctl power on
else
bluetoothctl power off
fi
}
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
Update_state() {
if [[ $(swaync-client -D) == true ]]
then
echo true
else
echo false
fi
}
Toggle_state() {
if [[ $SWAYNC_TOGGLE_STATE == true ]]
then
swaync-client -dn
else
swaync-client -df
fi
}
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
Update_state() {
if [[ $(nmcli n c) =~ "partial" ]] || [[ $(nmcli n c) =~ "full" ]]
then
echo true
else
echo false
fi
}
Toggle_state() {
if [[ $SWAYNC_TOGGLE_STATE == true ]]
then
nmcli n on
else
nmcli n off
fi
}
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Bash Script made by retrozinndev
# Dotfiles: https://github.com/retrozinndev/Hyprland-Dots
# This script is not ready to use yet.
local REC_DIR="/tmp/screenRecording"
local REC_FILE="$REC_DIR/recording_swaync"
Update_state() {
if [[ -f $REC_FILE ]]
then
echo true
else
echo false
fi
}
Toggle_state() {
if [[ $SWAYNC_TOGGLE_STATE == true ]]
then
Start_recording
else
Stop_recording
fi
}
Start_recording() {
}
Stop_recording() {
}
Check_if_recording() {
}
+2 -386
View File
@@ -1,5 +1,7 @@
@import "_colors.css";
@import "_notifications.css";
@import "_control-center.css";
* {
all: unset;
@@ -13,389 +15,3 @@ tooltip {
border: .5px solid shade(@highlight, .8);
border-radius: 6px;
}
/* Notifications (Not from control center) */
.floating-notifications .notification-row .notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #313244;
border-radius: 16px;
margin: 18px;
background-color: @background;
color: @text;
padding: 0;
}
.notification-row .notification-background .notification {
padding: 7px;
}
.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 {
border: 2px solid @color2;
}
.notification-row .notification-background .notification {
padding: 14px;
}
.notification-row .notification .image {
margin-right: .5em;
border-radius: 8px;
}
.notification-row .notification-background .notification .notification-content .summary {
font-size: 1.2em;
margin-bottom: 2px;
font-weight: 600;
color: @foreground;
}
.notification-row .notification-background .notification .notification-content .time {
color: @foreground;
}
.notification-row .notification-background .notification .notification-content .body {
color: @foreground;
margin-bottom: .6em;
}
.notification .notification-action {
border-radius: 16px;
color: @text;
font-weight: 600;
background-color: @bg-button;
border: .6px solid @background;
margin: .3em 0;
}
.notification-row .notification .notification-action:hover {
background-color: @hover;
}
.notification-row .notification .notification-action:active {
background-color: @active;
color: @text;
}
.close-button {
border-radius: 8px;
margin: 4px;
padding: 2.5px;
border-radius: 8px;
color: @crust;
background-color: @bg-button;
}
.close-button:hover {
background-color: @hover;
}
.close-button:active {
background-color: @active;
}
/* Control Center Notifications */
.control-center .notification-row .notification-background {
border-radius: 16px;
background-color: @color1;
margin-top: 14px;
}
.control-center .notification-row .notification-background .notification {
padding: 10px;
}
.control-center .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 0px 2px @color3;
border: none;
}
.control-center .notification-row .notification-background .notification .notification-content {
margin: 8px;
font-family: Cantarell, "Noto Sans CJK"
}
.control-center .notification-row .notification-background .notification .notification-content .summary {
font-family: Cantarell, "Noto Sans CJK";
color: @foreground;
font-size: 1.2em;
font-weight: 600;
}
.control-center .notification-row .notification-background .notification .notification-content .time {
color: @foreground;
}
.control-center .notification-row .notification-background .notification .notification-content .body {
color: @foreground;
}
.control-center .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.notification.critical progress,
.notification.low progress,
.notification.normal progress {
background-color: @color3;
}
/* Control Center */
.control-center {
box-shadow: 0 2 10px 1px black, inset 0 0 0px 2px shade(@background, 2);
border-radius: 12.6px;
margin: 18px;
background: @background;
color: @text;
padding: 1.5rem;
}
.control-center .widget-title {
padding: 1rem .2rem;
}
.control-center .widget-title > label {
color: @text;
font-size: 1.6em;
font-weight: 600;
margin-bottom: 10px;
}
.control-center .widget-title button {
border-radius: 8px;
background: @bg-button;
padding: 6px 8px;
}
.control-center .widget-title button:hover {
background-color: @hover;
}
.control-center .widget-title button:active {
background-color: @active;
}
.control-center .widget-title button label {
color: @foreground;
font-weight: 600;
}
.control-center .widget-label {
padding: .2rem;
}
.control-center .widget-label > label {
color: @foreground;
font-weight: 600;
font-size: 1.6em;
}
.control-center-dnd {
margin-top: 5px;
border-radius: 8px;
background: #313244;
border: 1px solid #45475a;
box-shadow: none;
}
.control-center-dnd:checked {
background: #313244;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 16px;
background: @background;
border: 1px solid #45475a;
box-shadow: none;
}
.widget-dnd > switch slider {
background: @highlight;
border-radius: 16px;
border: 1px solid #6c7086;
}
/* MPRIS */
.widget-mpris {
margin-top: 16px;
}
.widget-mpris .widget-mpris-player {
box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .3);
padding: 24px;
background-color: transparent;
padding-bottom: 16px;
border-radius: 16px;
outline: none;
margin-left: 8px;
margin-right: 8px;
}
/* mpris controls */
.widget-mpris .widget-mpris-player > *:last-child > button {
border-radius: 8px;
}
.widget-mpris .widget-mpris-player > *:last-child > button:hover {
background: @hover;
}
.widget-mpris .widget-mpris-player > *:last-child > button:active {
background: @active;
}
.widget-mpris .image {
padding-right: 0.5rem;
border-radius: 16px;
}
.widget-mpris .widget-mpris-title {
font-family: "Cantarell", "Noto Sans";
font-weight: 700;
font-size: 1.2rem;
text-shadow: 1px 1px 2px black;
}
.widget-mpris .widget-mpris-subtitle {
font-size: 0.8rem;
text-shadow: 1px 1px 2px black;
}
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: #f38ba8;
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: #313244;
}
.widget-buttons-grid {
margin-top: 2px;
margin-left: 5px;
}
.widget-buttons-grid button {
background: @bg-button;
padding: 12px;
border-radius: 16px;
margin: 2px;
}
.widget-buttons-grid button:hover {
background: @hover;
}
.widget-buttons-grid button:active {
background: @active;
}
.widget-buttons-grid button:checked {
background: @color3;
}
.widget-buttons-grid button label {
font-size: 1em;
color: @text;
font-weight: 600;
}
.toggle:checked {
color: blue;
}
.widget-volume .per-app-volume {
margin-top: 4px;
padding: 6px;
border-radius: 6px;
background: shade(@background, .6);
}
.widget-volume .per-app-volume > * > * > * {
margin-right: 0;
}
.widget-volume .per-app-volume > * > * > * + * {
margin-left: -5px;
margin-right: -10px;
}
.widget-volume trough,
.widget-backlight trough { /* slider's background */
margin: 0 1.2rem;
background-color: shade(@color1, .4);
min-height: 8px;
min-width: 70px;
border-radius: 14px;
padding: 4px;
}
.widget-volume trough slider,
.widget-backlight trough slider { /* slider's dot indicator */
background: shade(@text, .9);
border-radius: 50%;
padding: 10px;
box-shadow: inset 0 0 1px .5px @background-alt;
}
.widget-volume trough slider:active,
.widget-backlight trough slider:active {
background: shade(@foreground, .75);
}
.widget-volume trough highlight,
.widget-backlight trough highlight { /* slider bar */
border-top-left-radius: 14px;
border-bottom-left-radius: 14px;
background: shade(@highlight, .9);
}
.widget-volume {
margin-top: 1rem;
margin-bottom: 0.8rem;
}
.widget-volume label {
font-size: 1.5rem;
color: @text;
margin-left: 5px;
margin-right: 6px;
}
.widget-backlight {
margin-bottom: 1rem;
}
.widget-backlight label {
font-size: 1.5rem;
margin-left: 7px;
margin-right: 3px;
color: @text;
}
.widget-backlight .KB {
padding-bottom: 1rem;
}