From 67bd3003d82e7b93f3d48a2605c8c8172e5f2cde Mon Sep 17 00:00:00 2001 From: Thomas Schneider Date: Mon, 27 Jul 2026 19:27:22 +0200 Subject: waybar: Various config updates and new modules --- dot.config-waybar-config | 65 ++++++++++++++++++++++++++++++---- dot.config-waybar-style.css | 85 ++++++++++++++++++++++++++++++++++++++++++--- dot.local-bin-bt--toggle.sh | 15 ++++++++ 3 files changed, 154 insertions(+), 11 deletions(-) create mode 100755 dot.local-bin-bt--toggle.sh diff --git a/dot.config-waybar-config b/dot.config-waybar-config index c5287fc..463b8bc 100644 --- a/dot.config-waybar-config +++ b/dot.config-waybar-config @@ -1,17 +1,19 @@ -// -*- javascript -*- vim:ft=javascript sw=4 et +// -*- jsonc -*- vim:ft=javascript sw=4 et { "include": ".config/waybar/local.conf", + "reload_style_on_change": true, "layer": "top", // Waybar at top layer "position": "top", // Waybar position (top|bottom|left|right) // "width": 1280, // Waybar width // Choose the order of the modules + "fixed-center": false, "modules-left": [ "sway/workspaces", "sway/mode" // , // "custom/media" ], - "modules-center": ["sway/window"], + //"modules-center": ["sway/window"], // Modules configuration // "sway/workspaces": { // "disable-scroll": true, @@ -65,15 +67,38 @@ } }, "tray": { - "spacing": 10 + "spacing": 10, + "show-passive-items": true, }, "clock": { "interval": 1, - "tooltip-format": "{:%Y %B}\n{calendar}", + //"tooltip-format": "{:%Y %B}\n{calendar}", + "tooltip-format": "{calendar}", + "calendar": { + "mode" : "year", + "mode-mon-col" : 3, + "weeks-pos" : "right", + "on-scroll" : 1, + "format": { + "months": "{}", + "days": "{}", + "weeks": "W{}", + "weekdays": "{}", + "today": "{}" + } + }, + "actions": { + "on-click-right": "mode", + "on-scroll-up": "tz_up", + "on-scroll-down": "tz_down", + "on-scroll-up": "shift_up", + "on-scroll-down": "shift_down" + }, }, "cpu": { "format": "{usage}% ", - "tooltip": false + "format-alt": "{load} ", + "interval": 5, }, "memory": { "format": "{}% " @@ -143,7 +168,35 @@ "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 - } + }, + "bluetooth": { + "on-click": "blueman-manager", + "on-click-right": "$HOME/.local/bin/bt-toggle.sh", + "format": "{status} ", + "format-on": "{status} {num_connections}", + "format-connected": "{device_alias} {num_connections}", + "format-connected-battery": "{device_alias} ({device_battery_percentage}%) {num_connections}", + "format-device-preference": ["qsx 35", "OpenRun by Shokz"], + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%", + }, + "power-profiles-daemon": { + "format": "{icon}", + "format-icons": { + "default": "", + "performance": "", + "balanced": "", + "power-saver": "", + }, + }, + "privacy": { + "icon-size": 14, + }, + "systemd-failed-units": { + "format": "✗ {nr_failed}", + }, } // Local Variables: diff --git a/dot.config-waybar-style.css b/dot.config-waybar-style.css index 994b09f..403293d 100644 --- a/dot.config-waybar-style.css +++ b/dot.config-waybar-style.css @@ -1,8 +1,8 @@ -* { +button, .module { border: none; border-radius: 0; /* `otf-font-awesome` is required to be installed for icons */ - font-family: "Source Code Pro", "Font Awesome 5 Free"; + font-family: "Source Code Pro", "Font Awesome 6 Free"; font-size: 12px; min-height: 0; } @@ -68,6 +68,8 @@ window#waybar.chromium { #clock, #battery, +#bluetooth, +#upower, #cpu, #memory, #disk, @@ -79,6 +81,9 @@ window#waybar.chromium { #tray, #mode, #idle_inhibitor, +#power-profiles-daemon, +#systemd-failed-units, +#privacy, #mpd { padding: 0 10px; margin: 0 4px; @@ -104,12 +109,12 @@ window#waybar.chromium { background-color: #64727D; } -#battery { +#battery, #upower { background-color: #ffffff; color: #000000; } -#battery.charging, #battery.plugged { +#battery.charging, #battery.plugged, #upower.charging { color: #ffffff; background-color: #26A65B; } @@ -126,7 +131,7 @@ window#waybar.chromium { color: #ffffff; animation-name: blink; animation-duration: 0.5s; - animation-timing-function: linear; + animation-timing-function: steps(12); animation-iteration-count: infinite; animation-direction: alternate; } @@ -160,6 +165,35 @@ label:focus { background-color: #f53c3c; } +#bluetooth { + background-color: rgb(0, 51, 171); +} + +#bluetooth.on { + background-color: rgba(0, 51, 171, 0.7); +} + +#bluetooth.disabled, #bluetooth.off { + font-style: italic; + background-color: rgba(0, 51, 171, 0.4); +} + +#bluetooth.discoverable { + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#bluetooth.discovering { + animation-name: blink; + animation-duration: 2s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + #pulseaudio { background-color: #f1c40f; color: #000000; @@ -196,6 +230,19 @@ label:focus { background-color: #2980b9; } +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#tray menu * { + font: initial; +} + #idle_inhibitor { background-color: #2d3436; } @@ -205,6 +252,21 @@ label:focus { color: #2d3436; } +#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; +} + #mpd { background-color: #66cc99; color: #2a5c45; @@ -229,3 +291,16 @@ label:focus { margin: 0 5px; min-width: 16px; } + +#privacy { + background: white; + color: #eb4d4b; +} + +#systemd-failed-units.degraded { + background-color: #f53c3c; +} + +#custom-notification { + font-family: "Symbols Nerd Font Mono"; +} diff --git a/dot.local-bin-bt--toggle.sh b/dot.local-bin-bt--toggle.sh new file mode 100755 index 0000000..198fcfe --- /dev/null +++ b/dot.local-bin-bt--toggle.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +state=$(gdbus call --system --dest org.bluez --object-path /org/bluez/hci0 --method org.freedesktop.DBus.Properties.Get "org.bluez.Adapter1" "Powered") +case ${state} in + "(,)") + new="" + ;; + "(,)") + new="" + ;; + *) + exit 1 +esac +gdbus call --system --dest org.bluez --object-path /org/bluez/hci0 --method org.freedesktop.DBus.Properties.Set "org.bluez.Adapter1" "Powered" $new >/dev/null -- cgit v1.2.3