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 f7e7313246
commit a69edfbf43
8 changed files with 84 additions and 15 deletions

View File

@@ -178,29 +178,33 @@ desktop_i3_dotfiles:
mode: "0644"
desktop_sway_dotfiles:
- name: sway config
src: .config/sway/
dest: .config/sway/
- name: alacritty config
src: .config/alacritty/
dest: .config/alacritty/
mode: preserve
- name: dunst config
src: .config/dunst/
dest: .config/dunst/
mode: preserve
- name: flameshot config
src: .config/flameshot/
dest: .config/flameshot/
mode: preserve
- name: rofi config
src: .config/rofi/
dest: .config/rofi/
mode: preserve
- name: sway config
src: .config/sway/
dest: .config/sway/
mode: preserve
- name: waybar config
src: .config/waybar/
dest: .config/waybar/
mode: preserve
- name: flameshot config
src: .config/flameshot/
dest: .config/flameshot/
mode: preserve
- name: alacritty config
src: .config/alacritty/
dest: .config/alacritty/
- name: wlogout config
src: .config/wlogout/
dest: .config/wlogout/
mode: preserve
desktop_flatpak_packages:

View File

@@ -168,6 +168,7 @@ desktop_sway_packages:
- SwayOSD
- Waybar
- wl-clipboard
- wlogout
- xdg-desktop-portal-wlr
- xorg-server-xwayland

View File

@@ -10,11 +10,11 @@
loop:
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/dunst"
- "{{ user_home }}/.config/flameshot"
- "{{ user_home }}/.config/rofi"
- "{{ user_home }}/.config/sway"
- "{{ user_home }}/.config/sway/scripts"
- "{{ user_home }}/.config/sway/wallpapers"
- "{{ user_home }}/.config/waybar"
- "{{ user_home }}/.config/wlogout"
when: "'sway' in (desktop_sessions_enabled | default([]))"
- name: Install allowed emptty Wayland sessions

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"));
}