diff options
| author | Thomas Schneider <qsx@chaotikum.eu> | 2026-07-27 19:27:22 +0200 |
|---|---|---|
| committer | Thomas Schneider <qsx@chaotikum.eu> | 2026-07-27 20:02:43 +0200 |
| commit | 67bd3003d82e7b93f3d48a2605c8c8172e5f2cde (patch) | |
| tree | 2664d6439890d14701936bd3022411832221ccc0 /dot.local-bin-bt--toggle.sh | |
| parent | c595672d72b25dec03389cd6872fd2566058ef35 (diff) | |
waybar: Various config updates and new modules
Diffstat (limited to 'dot.local-bin-bt--toggle.sh')
| -rwxr-xr-x | dot.local-bin-bt--toggle.sh | 15 |
1 files changed, 15 insertions, 0 deletions
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 + "(<false>,)") + new="<true>" + ;; + "(<true>,)") + new="<false>" + ;; + *) + 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 |
