mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-17 12:27:22 +00:00
Refactor btre function, update vm_rm, add bspc window rule
This commit is contained in:
parent
3955031560
commit
34ff14442e
4 changed files with 27 additions and 13 deletions
|
|
@ -2,21 +2,33 @@ function btre -a device -d 'Reconnect to a known bluetooth device'
|
|||
set -l devices CC:98:8B:3E:6B:9D 00:1B:66:E3:07:3A
|
||||
set -l index 1
|
||||
|
||||
if test -n "$device"
|
||||
set index $device
|
||||
switch device
|
||||
case sony
|
||||
set index 1
|
||||
return
|
||||
case senn
|
||||
set index 2
|
||||
return
|
||||
case '*'
|
||||
test -n "$device"; and set index $device
|
||||
end
|
||||
|
||||
bluetoothctl power on
|
||||
|
||||
bluetoothctl remove $devices[$index]
|
||||
and bluetoothctl remove $devices[$index]
|
||||
|
||||
nohup bluetoothctl scan on >/dev/null &
|
||||
sleep 2
|
||||
echo \n"--- Press enter to continue ---"\n
|
||||
bluetoothctl scan on &
|
||||
read -P ''
|
||||
|
||||
bluetoothctl pair $devices[$index]
|
||||
bluetoothctl trust $devices[$index]
|
||||
bluetoothctl connect $devices[$index]
|
||||
sleep 2
|
||||
or return $status
|
||||
read -p 'echo \n"--- Press enter to continue ---"\n'
|
||||
|
||||
pkill bluetoothctl
|
||||
bluetoothctl trust $devices[$index]
|
||||
and bluetoothctl connect $devices[$index]
|
||||
or return $status
|
||||
read -p 'echo \n"--- Press enter to continue ---"\n'
|
||||
|
||||
kill %1
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue