From ae9d11f899ec73862fa583989ad7060f2990c4be Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:28 +0100 Subject: feat(waybar): more clickable modules + load avg in CPU readout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cpu: append 'LOAD {load:0.2f}' (1-min load average) to every state - custom/wifi: left click toggles iwd Powered via D-Bus (new wifi-toggle.sh) - custom/notifications: left click opens fuzzel history picker (mako-history.sh, previously bound to middle-click); the awkward per-click 'makoctl dismiss' is dropped — dismiss-all stays on right, restore stays on middle - clock: left click runs tb-toggle.sh (closest practical proxy for 'open Calendar tab' — Thunderbird hasn't shipped a -calendar CLI flag since Lightning was integrated, so the user lands on whatever tab TB was last on) --- dot_config/waybar/executable_wifi-toggle.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dot_config/waybar/executable_wifi-toggle.sh (limited to 'dot_config/waybar/executable_wifi-toggle.sh') diff --git a/dot_config/waybar/executable_wifi-toggle.sh b/dot_config/waybar/executable_wifi-toggle.sh new file mode 100644 index 0000000..68e77ab --- /dev/null +++ b/dot_config/waybar/executable_wifi-toggle.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Toggle wifi (wlan0) Powered state via iwd's D-Bus API. Driven by waybar +# on-click on the custom/wifi module. +set -eu + +iface=wlan0 +svc=net.connman.iwd + +device=$(busctl --system --json=short call "$svc" / \ + org.freedesktop.DBus.ObjectManager GetManagedObjects | + jq -r --arg iface "$iface" ' + (.data[0] // .data) as $objs + | $objs | to_entries[] + | select(.value["net.connman.iwd.Device"].Name.data == $iface) + | .key') + +[ -n "$device" ] || { notify-send -u critical "wifi" "iwd device $iface not found"; exit 1; } + +powered=$(busctl --system --json=short get-property "$svc" "$device" \ + net.connman.iwd.Device Powered | jq -r '.data') + +if [ "$powered" = "true" ]; then + busctl --system set-property "$svc" "$device" net.connman.iwd.Device Powered b false +else + busctl --system set-property "$svc" "$device" net.connman.iwd.Device Powered b true +fi -- cgit v1.3.1