From 88f40ff6f47c017b69e8e88ead9ba3235c6b7a63 Mon Sep 17 00:00:00 2001 From: francois Date: Mon, 25 May 2026 11:51:23 +0200 Subject: [PATCH] Waybar tweak --- private_dot_config/waybar/config.jsonc | 220 ++++++++++++++----------- private_dot_config/waybar/style.css | 129 ++++++++------- 2 files changed, 187 insertions(+), 162 deletions(-) diff --git a/private_dot_config/waybar/config.jsonc b/private_dot_config/waybar/config.jsonc index b3e8fd5..1f97217 100644 --- a/private_dot_config/waybar/config.jsonc +++ b/private_dot_config/waybar/config.jsonc @@ -1,8 +1,8 @@ // -*- mode: jsonc -*- { - // "layer": "top", // Waybar at top layer - // "position": "bottom", // Waybar position (top|bottom|left|right) - "height": 30, // Waybar height (to be removed for auto height) + "layer": "top", // Waybar at top layer + "position": "top", // Waybar position (top|bottom|left|right) + //"height": 50, // Waybar height (to be removed for auto height) //"width": 1280, // Waybar width "spacing": 4, // Gaps between modules (4px) // Choose the order of the modules @@ -19,19 +19,15 @@ "mpd", "idle_inhibitor", "pulseaudio", - "network", - "network#wired", - "power-profiles-daemon", - "cpu", - "memory", - "temperature", "backlight", + "tray", "keyboard-state", "sway/language", - "battery", - "battery#bat2", + "bluetooth", + "group/nw", + "group/hw", + "group/power", "clock", - "tray", "custom/power" ], // Modules configuration @@ -107,79 +103,11 @@ // "icon-size": 21, "spacing": 10 }, - "clock": { - // "timezone": "America/New_York", - "tooltip-format": "{:%Y %B}\n{calendar}", - "format-alt": "{:%Y-%m-%d}" - }, - "cpu": { - "format": "{usage}% ", - "tooltip": false - }, - "memory": { - "format": "{}% " - }, - "temperature": { - // "thermal-zone": 2, - "hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input", - "critical-threshold": 80, - // "format-critical": "{temperatureC}°C {icon}", - "format": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""] - }, "backlight": { // "device": "acpi_video1", "format": "{percent}% {icon}", "format-icons": ["", "", "", "", "", "", "", "", ""] }, - "battery": { - "states": { - // "good": 95, - "warning": 30, - "critical": 15 - }, - "format": "{capacity}% {icon}", - "format-full": "{capacity}% {icon}", - "format-charging": "{capacity}% 󱊥", - "format-plugged": "{capacity}% ", - "format-alt": "{time} {icon}", - // "format-good": "", // An empty format will hide the module - // "format-full": "", - "format-icons": ["", "", "", "", ""] - }, - "battery#bat2": { - "bat": "BAT2" - }, - "power-profiles-daemon": { - "format": "{icon}", - "tooltip-format": "Power profile: {profile}\nDriver: {driver}", - "tooltip": true, - "format-icons": { - "default": "", - "performance": "", - "balanced": "", - "power-saver": "" - } - }, - "network": { - "interface": "wlp2*", // (Optional) To force the use of this interface - "family": "ipv4", - "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "{ipaddr}/{cidr} ", - "tooltip-format": "{ifname} via {gwaddr} ", - "format-linked": "{ifname} (No IP) ", - "format-disconnected": "Disconnected ⚠", - "format-alt": "{ifname}: {ipaddr}/{cidr}" - }, - "network#wired": { - "interface": "enp*", // (Optional) To force the use of this interface - "family": "ipv4", - "format-ethernet": "{ipaddr}/{cidr} ", - "tooltip-format": "{ifname} via {gwaddr} ", - "format-linked": "{ifname} (No IP) ", - "format-disconnected": "Disconnected ⚠", - "format-alt": "{ifname}: {ipaddr}/{cidr}" - }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{volume}% {icon} {format_source}", @@ -199,28 +127,122 @@ }, "on-click": "pavucontrol" }, - "custom/media": { - "format": "{icon} {text}", - "return-type": "json", - "max-length": 40, - "format-icons": { - "spotify": "", - "default": "🎜" + "bluetooth": { + "format": "󰂯 {status}", + "format-no-controller": "", + "format-on": "󰂯", + "format-off": "󰂲", + "format-connected": "󰂱 ({num_connections})", + "format-connected-battery": "󰂱 {device_alias}: {device_battery_percentage}% ({num_connections})", + "tooltip": true, + "tooltip-format": "{device_alias}: {device_address},{device_address_type}" + + }, + "group/nw": { + "orientation": "vertical", + "modules": [ + "network", + "network#wired" + ] + }, + "network": { + "interface": "wlp2*", // (Optional) To force the use of this interface + "family": "ipv4", + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "network#wired": { + "interface": "enp*", // (Optional) To force the use of this interface + "family": "ipv4", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "group/hw": { + "orientation": "vertical", + "modules": [ + "cpu", + "memory", + "temperature" + ], + "drawer": { + "transition-duration": 500, + "children-class": "not-power", + "transition-left-to-right": true, }, - "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 + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + "hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "group/power": { + "orientation": "vertical", + "modules": [ + "battery", + "power-profiles-daemon" + ] + }, + "battery": { + "states": { + "good": 70, + "warning": 30, + "critical": 20 + }, + "format": "{capacity}% {icon}", + "format-full": "{capacity}% {icon}", + "format-charging": "{capacity}% 󱊥", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""], + "tooltip": true, + "tooltip-format": "{timeTo}\n{power}W\nHealth: {health}%\n{cycles} cycles seen" + }, + "power-profiles-daemon": { + "format": "{icon}", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, + "format-icons": { + "default": "", + "performance": "", + "balanced": "", + "power-saver": "" + } + }, + "clock": { + // "timezone": "America/New_York", + "format": "{0:%H:%M}\n{0:%Y-%m-%d}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" }, "custom/power": { "format" : "⏻ ", - "tooltip": false, - "menu": "on-click", - "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder - "menu-actions": { - "shutdown": "shutdown", - "reboot": "reboot", - "suspend": "systemctl suspend", - "hibernate": "systemctl hibernate" - } + "tooltip": false, + "menu": "on-click", + "menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder + "menu-actions": { + "shutdown": "shutdown", + "reboot": "reboot", + "suspend": "systemctl suspend", + "hibernate": "systemctl hibernate" + } } } diff --git a/private_dot_config/waybar/style.css b/private_dot_config/waybar/style.css index 8169938..0f38ba2 100644 --- a/private_dot_config/waybar/style.css +++ b/private_dot_config/waybar/style.css @@ -1,6 +1,6 @@ * { - font-family: Hack Nerd Font; - font-size: 12px; + font-family: Hack Nerd Font Mono; + font-size: 12px; } window#waybar { @@ -10,9 +10,9 @@ window#waybar { transition-duration: .5s; } window#waybar:first-child > box { - margin-top: 6px; - padding: 8px 4px 4px 4px; - border-radius: 20px 20px 20px 20px; + margin: 6px; + padding: 4px; + border-radius: 20px; background-color: rgba(46, 52, 64, 0.5); border: 2px solid #88c0d0; } @@ -100,9 +100,12 @@ button:hover { #power-profiles-daemon, #keyboard-state, #mpd { - padding: 0 10px; - color: #ffffff; + /*padding: 0px; + color: #ffffff;*/ border-radius: 20px; + margin: 2px; + padding-left: 5px; + padding-right: 5px; } #window, @@ -119,57 +122,6 @@ button:hover { margin-right: 0; } -#clock { - background-color: #64727D; -} - -#battery { - background-color: #ffffff; - color: #000000; -} - -#battery.charging, #battery.plugged { - color: #ffffff; - background-color: #26A65B; -} - -@keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } -} - -/* Using steps() instead of linear as a timing function to limit cpu usage */ -#battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: steps(12); - animation-iteration-count: infinite; - animation-direction: alternate; -} - -#power-profiles-daemon { - padding-right: 15px; -} - -#power-profiles-daemon.performance { - background-color: #f53c3c; - color: #ffffff; -} - -#power-profiles-daemon.balanced { - background-color: #2980b9; - color: #ffffff; -} - -#power-profiles-daemon.power-saver { - background-color: #2ecc71; - color: #000000; -} - label:focus { background-color: #000000; } @@ -286,21 +238,21 @@ label:focus { #language { background: #00b093; color: #740864; - padding: 0 5px; - margin: 0 5px; + /*padding: 0 5px; + margin: 0 5px;*/ min-width: 16px; } #keyboard-state { background: #97e1ad; color: #000000; - padding: 0 0px; - margin: 0 5px; + /*padding: 0 0px; + margin: 0 5px;*/ min-width: 16px; } #keyboard-state > label { - padding: 0 5px; + /*padding: 0 5px;*/ } #keyboard-state > label.locked { @@ -334,3 +286,54 @@ label:focus { #privacy-item.audio-out { background-color: #0069d4; } + +#battery { +background-color: #ffffff; +color: #000000; +} + +#battery.charging, #battery.plugged { +color: #ffffff; +background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +/* Using steps() instead of linear as a timing function to limit cpu usage */ +#battery.critical:not(.charging) { +background-color: #f53c3c; +color: #ffffff; +animation-name: blink; +animation-duration: 0.5s; +animation-timing-function: steps(12); +animation-iteration-count: infinite; +animation-direction: alternate; +} + +#power-profiles-daemon { +/*padding-right: 15px;*/ +} + +#power-profiles-daemon.performance { +background-color: #f53c3c; +color: #ffffff; +} + +#power-profiles-daemon.balanced { +background-color: #2980b9; +color: #ffffff; +} + +#power-profiles-daemon.power-saver { +background-color: #2ecc71; +color: #000000; +} + +#clock { + background-color: #64727D; +}