From beb292462d022fba724091b11cb988ca17c07f76 Mon Sep 17 00:00:00 2001 From: datalore Date: Mon, 4 Dec 2023 12:16:55 +0100 Subject: [PATCH] Added wlogout --- .config/waybar/config.jsonc | 7 +++++- .config/waybar/style.css | 5 +++++ .config/wlogout/layout | 36 ++++++++++++++++++++++++++++++ .config/wlogout/style.css | 44 +++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .config/wlogout/layout create mode 100644 .config/wlogout/style.css diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index d85693e..060a1b8 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -7,7 +7,7 @@ // Choose the order of the modules "modules-left": ["hyprland/workspaces", "custom/media"], "modules-center": ["hyprland/window"], - "modules-right": ["pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "clock", "tray"], + "modules-right": ["pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "clock", "tray", "custom/wlogout"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -110,6 +110,11 @@ } // "on-click": "pavucontrol" }, + "custom/wlogout": { + "format": "", + "on-click": "wlogout", + "tooltip": false + }, "custom/media": { "format": "{icon} {}", "return-type": "json", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 74d09a0..3143f94 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -92,6 +92,11 @@ button:hover { color: #ffffff; } +#custom-wlogout { + padding-right: 10px; + color: #ffffff; +} + #window, #workspaces { margin: 0 4px; diff --git a/.config/wlogout/layout b/.config/wlogout/layout new file mode 100644 index 0000000..488aa5b --- /dev/null +++ b/.config/wlogout/layout @@ -0,0 +1,36 @@ +{ + "label" : "lock", + "action" : "swaylock", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "hibernate", + "action" : "systemctl hibernate", + "text" : "Hibernate", + "keybind" : "h" +} +{ + "label" : "logout", + "action" : "loginctl terminate-user $USER", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "suspend", + "action" : "systemctl suspend", + "text" : "Suspend", + "keybind" : "u" +} +{ + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "Reboot", + "keybind" : "r" +} diff --git a/.config/wlogout/style.css b/.config/wlogout/style.css new file mode 100644 index 0000000..d0212a9 --- /dev/null +++ b/.config/wlogout/style.css @@ -0,0 +1,44 @@ +* { + background-image: none; +} +window { + background-color: rgba(12, 12, 12, 0.9); +} +button { + color: #FFFFFF; + background-color: #1E1E1E; + border-style: solid; + border-width: 2px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; +} + +button:focus, button:active, button:hover { + background-color: #00CDCD; + outline-style: none; +} + +#lock { + background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); +} + +#logout { + background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); +} + +#suspend { + background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); +} + +#hibernate { + background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); +} + +#shutdown { + background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); +} + +#reboot { + background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); +}