From e2d3ca987b83a63aa39f7288c3fb7116c3fb0a00 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 21 May 2026 17:48:47 -0400 Subject: feat(hyprland): add airplane-mode waybar toggle I added a laptop-only waybar button that drops the machine into a low-power state and restores it on a second click. Engaging turns wifi off, sets the CPU energy-performance preference to power, dims the backlight to 35%, and stops network-only services (tailscale, proton-vpn, avahi, cups, wsdd, geoclue, sshd, fail2ban, syncthing). Bluetooth is left alone so earbuds keep working. Disengaging replays the state recorded when airplane mode was engaged rather than writing hardcoded defaults. A lever already in its low-power position is left untouched: wifi that was already off stays off, and a service that was already stopped isn't restarted. The indicator hides itself on machines with no battery, so desktops never show the button. State lives in $XDG_RUNTIME_DIR/airplane-state, and the bar refreshes the moment the toggle fires via a realtime signal. --- dotfiles/hyprland/.config/waybar/config | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dotfiles/hyprland/.config/waybar/config') diff --git a/dotfiles/hyprland/.config/waybar/config b/dotfiles/hyprland/.config/waybar/config index 2ae43fe..97fb3b7 100644 --- a/dotfiles/hyprland/.config/waybar/config +++ b/dotfiles/hyprland/.config/waybar/config @@ -18,6 +18,7 @@ "custom/netspeed", "pulseaudio", "custom/touchpad", + "custom/airplane", "idle_inhibitor", "custom/pocketbook", "tray", @@ -149,6 +150,13 @@ "on-click": "toggle-touchpad" }, + "custom/airplane": { + "exec": "waybar-airplane", + "return-type": "json", + "signal": 10, + "on-click": "airplane-mode" + }, + "idle_inhibitor": { "format": "{icon}", "format-icons": { -- cgit v1.2.3