WAYBAR: ajout d'un bouton pour éteindre l'ordinateur

This commit is contained in:
Olivier DOSSMANN 2021-07-01 22:11:30 +02:00
parent e1a1cbea60
commit eb8fb1d960
2 changed files with 10 additions and 1 deletions

View File

@ -2,7 +2,7 @@
"height": 27, // Waybar height (to be removed for auto height) "height": 27, // Waybar height (to be removed for auto height)
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": ["sway/window"], "modules-center": ["sway/window"],
"modules-right": ["backlight", "pulseaudio", "memory", "cpu", "network", "battery", "temperature", "clock", "tray"], "modules-right": ["backlight", "pulseaudio", "memory", "cpu", "network", "battery", "temperature", "clock", "custom/power", "tray"],
// Modules configuration // Modules configuration
"sway/workspaces": { "sway/workspaces": {
"disable-scroll": true, "disable-scroll": true,
@ -97,5 +97,9 @@
"escape": true, "escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/power": {
"format": " ",
"on-click": "swaynag -t warning -m 'Menu gestion alimentation' -b 'Déconnexion' 'swaymsg exit' -b 'Veille' 'swaymsg exec systemctl suspend' -b 'Arrêter' 'shutdown now'"
} }
} }

View File

@ -190,6 +190,11 @@ label:focus {
background-color: #ffa000; background-color: #ffa000;
} }
#custom-power {
margin: 0 10px;
color: red;
}
#temperature { #temperature {
background-color: inherit; background-color: inherit;
border-bottom: 3px solid #f50a4d; border-bottom: 3px solid #f50a4d;