bt_connect now accepts an argument to pass to bluetoothctl

Allows to me to setup bindings for disconnecting or connecting a
bluetooth device.
This commit is contained in:
2025-11-26 19:35:26 +00:00
parent fdd92a07fe
commit d239dc5ffe
2 changed files with 8 additions and 2 deletions

View File

@@ -33,7 +33,10 @@ super + minus
$HOME/.local/scripts/act_display "--off"; $HOME/.local/scripts/act_display "--off";
super + numbersign super + numbersign
$HOME/.local/scripts/bt_connect; $HOME/.local/scripts/bt_connect connect;
super + asciitilde
$HOME/.local/scripts/bt_connect disconnect;
super + underscore super + underscore
notify-send -u normal "Turning off screentimer"; \ notify-send -u normal "Turning off screentimer"; \

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
choice=$(bluetoothctl devices | sed 's/Device \([A-Z0-9:]*\) \(.*\)/\2\t\1/g' | dmenu -i -p "Device: " | sed 's/.*\t//') choice=$(bluetoothctl devices | sed 's/Device \([A-Z0-9:]*\) \(.*\)/\2\t\1/g' | dmenu -i -p "Device: " | sed 's/.*\t//')
[ ! -z $choice ] && bluetoothctl connect $choice if [ ! -z $choice ]
then
bluetoothctl $1 $choice
fi