From eb8fb1d96092e56d1d18494abb27658f8a0ed8aa Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 1 Jul 2021 22:11:30 +0200 Subject: [PATCH] =?UTF-8?q?WAYBAR:=20ajout=20d'un=20bouton=20pour=20=C3=A9?= =?UTF-8?q?teindre=20l'ordinateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/waybar/config | 6 +++++- .config/waybar/style.css | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.config/waybar/config b/.config/waybar/config index a0164e4..99fda57 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -2,7 +2,7 @@ "height": 27, // Waybar height (to be removed for auto height) "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], "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 "sway/workspaces": { "disable-scroll": true, @@ -97,5 +97,9 @@ "escape": true, "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 + }, + "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'" } } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 39b7d28..3591b12 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -190,6 +190,11 @@ label:focus { background-color: #ffa000; } +#custom-power { + margin: 0 10px; + color: red; +} + #temperature { background-color: inherit; border-bottom: 3px solid #f50a4d;