sway: add wlogout, waybar power button, layer effects

This commit is contained in:
Fabio Scotto di Santolo
2026-05-17 15:32:26 +02:00
parent e2ea8edd9b
commit 901bd46a2e
8 changed files with 84 additions and 15 deletions

View File

@@ -45,6 +45,9 @@ blur_radius 5
shadows enable
default_dim_inactive 0.1
# Layer effects (Waybar etc.) — sfrutta il blur globale già attivo
layer_effects "waybar" blur enable; blur_ignore_transparent enable; shadows disable
# Allow X11 applications
xwayland enable

View File

@@ -6,7 +6,7 @@
"modules-left": ["sway/workspaces"],
"modules-center": [],
"modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock"],
"modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock", "custom/power"],
"sway/workspaces": {
"disable-scroll": true,
@@ -97,5 +97,11 @@
"tray": {
"icon-size": 16,
"spacing": 6
},
"custom/power": {
"format": "⏻",
"tooltip": false,
"on-click": "wlogout -b 3 -c 0 -r 0"
}
}

View File

@@ -5,7 +5,7 @@
}
window#waybar {
background-color: #1f1f28;
background-color: rgba(31, 31, 40, 0.55);
color: #d0d0d0;
border: none;
}
@@ -43,7 +43,8 @@ window#waybar {
#network,
#pulseaudio,
#battery,
#tray {
#tray,
#custom-power {
padding: 0 8px;
}
@@ -65,3 +66,12 @@ window#waybar {
#battery.full { color: #9ec07c; }
#tray { padding: 0 6px; }
#custom-power {
color: #c7162b;
padding: 0 10px;
font-size: 12pt;
}
#custom-power:hover {
background-color: rgba(199, 22, 43, 0.15);
}

View File

@@ -0,0 +1,3 @@
{"label": "logout", "action": "swaymsg exit", "text": "Logout", "keybind": "l"}
{"label": "reboot", "action": "loginctl reboot", "text": "Reboot", "keybind": "r"}
{"label": "shutdown", "action": "loginctl poweroff", "text": "Shutdown", "keybind": "s"}

View File

@@ -0,0 +1,42 @@
* {
background-image: none;
box-shadow: none;
font-family: "LiterationMono Nerd Font", "Symbols Nerd Font Mono", monospace;
font-size: 14pt;
}
window {
background-color: rgba(31, 31, 40, 0.85);
}
button {
color: #d0d0d0;
background-color: #2b2b36;
border: 2px solid #3a3a46;
border-radius: 8px;
margin: 12px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
}
button:focus,
button:active,
button:hover {
color: #ffffff;
background-color: #4a90d9;
border-color: #4a90d9;
outline-style: none;
}
#logout {
background-image: image(url("/usr/share/wlogout/icons/logout.png"));
}
#reboot {
background-image: image(url("/usr/share/wlogout/icons/reboot.png"));
}
#shutdown {
background-image: image(url("/usr/share/wlogout/icons/shutdown.png"));
}