From f4d232e2c19ad1093e48214954a80323602a5502 Mon Sep 17 00:00:00 2001 From: thek4n Date: Mon, 3 Aug 2026 13:18:57 +0300 Subject: [PATCH] waybar style --- home/user/.config/waybar/config | 48 ++++++++++++++++++------- home/user/.config/waybar/power_menu.xml | 38 ++++++++++++++++++++ home/user/.config/waybar/style.css | 36 +++++++++++++++---- 3 files changed, 103 insertions(+), 19 deletions(-) create mode 100644 home/user/.config/waybar/power_menu.xml diff --git a/home/user/.config/waybar/config b/home/user/.config/waybar/config index 158390c..71148c6 100644 --- a/home/user/.config/waybar/config +++ b/home/user/.config/waybar/config @@ -4,10 +4,11 @@ "position": "bottom", "height": 30, "spacing": 4, + "reload_style_on_change": true, "modules-left": [ "sway/workspaces", - "sway/mode" + "sway/mode", ], "modules-right": [ @@ -15,18 +16,25 @@ "custom/bluetooth", "custom/diskroot", "custom/diskhome", - "custom/memory", - "custom/cpu_usage", + "memory", + "cpu", "custom/cpu_temp", "custom/battery", "custom/pomodoro", "custom/volume", "custom/language", "custom/userhost", - "custom/time", - "tray" + "clock", + "tray", + "custom/power", ], + "clock": { + "format": " {:%d.%m.%y %a  %H:%M}", + "format-alt": "{:%H:%M}", + "interval": 30 + }, + "custom/wireless": { "exec": "~/.config/waybar/scripts/builder.sh wireless", "interval": 10, @@ -42,15 +50,14 @@ "interval": 30, "return-type": "text" }, - "custom/memory": { - "exec": "~/.config/waybar/scripts/builder.sh memory", + "memory": { "interval": 5, - "return-type": "text" + "format": "{used:0.1f}G/{total:0.1f}G " }, - "custom/cpu_usage": { - "exec": "~/.config/waybar/scripts/builder.sh cpu_usage", - "interval": 5, - "return-type": "text" + "cpu": { + "interval": 1, + "format": "{icons} {usage:>2}% ", + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], }, "custom/cpu_temp": { "exec": "~/.config/waybar/scripts/builder.sh cpu_temp", @@ -77,6 +84,7 @@ "custom/language": { "exec": "~/.config/waybar/scripts/builder.sh language", "return-type": "text", + "on-click": "swaymsg input type:keyboard xkb_switch_layout next", "signal": 3 }, "custom/userhost": { @@ -92,5 +100,19 @@ "exec": "~/.config/waybar/scripts/builder.sh time", "interval": 30, "return-type": "text" - } + }, + "custom/power": { + "format" : "⏻", + "tooltip": false, + "menu": "on-click", + "menu-file": "~/.config/waybar/power_menu.xml", + "menu-actions": { + "exit": "swaymsg exit", + "reboot": "reboot", + "shutdown": "shutdown -h now", + "suspend": "~/.config/sway/scripts/lock-telegram.sh && systemctl suspend", + "lock": "~/.config/sway/scripts/lock-telegram.sh && swaylock -f", + "uefi_reboot": "systemctl reboot --firmware-setup", + }, + }, } diff --git a/home/user/.config/waybar/power_menu.xml b/home/user/.config/waybar/power_menu.xml new file mode 100644 index 0000000..892aff5 --- /dev/null +++ b/home/user/.config/waybar/power_menu.xml @@ -0,0 +1,38 @@ + + + + + + 🚪 Exit + + + + + 🔄 Reboot + + + + + ⏻ Shutdown + + + + + 💤 Suspend + + + + + 🔒 Lock + + + + + + + + ⚙️ UEFI + + + + diff --git a/home/user/.config/waybar/style.css b/home/user/.config/waybar/style.css index d4365aa..4d2e20c 100644 --- a/home/user/.config/waybar/style.css +++ b/home/user/.config/waybar/style.css @@ -34,8 +34,8 @@ window#waybar { #custom-wireless, #custom-diskroot, #custom-diskhome, -#custom-memory, -#custom-cpu_usage, +#memory, +#cpu, #custom-cpu_temp, #custom-bluetooth, #custom-volume, @@ -43,7 +43,7 @@ window#waybar { #custom-language, #custom-userhost, #custom-battery, -#custom-time { +#clock { padding: 0 6px; margin: 0 1px; } @@ -68,7 +68,7 @@ window#waybar { color: #E57373; } -#custom-cpu_usage { +#cpu { color: #A5D6A7; } @@ -76,7 +76,7 @@ window#waybar { color: #FFAB91; } -#custom-memory { +#memory { color: #90CAF9; } @@ -92,7 +92,7 @@ window#waybar { color: #80DEEA; } -#custom-time { +#clock { color: #E0E0E0; } @@ -104,3 +104,27 @@ window#waybar { #custom-bluetooth { color: #4FC3F7; } + +menu { + border-radius: 5px; + background: #161320; + color: #B5E8E0; +} +menuitem { + border-radius: 5px; +} + +#custom-power { + padding: 0 10px; + color: #ffffff; + background: red; + border-bottom: 2px solid transparent; + font-size: 22px; + transition-duration: .3s; + border-radius: 3px; +} + +#custom-power:hover { + background: inherit; + box-shadow: inset 0 +1px #ffffff; +}