Advertisement
Guest User

Untitled

a guest
Jul 28th, 2019
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. nl='\n'
  4. devices=$(echo list | bluetoothctl | grep Device | cut -d' ' -f5-)
  5.  
  6. # DEBUG LINE:
  7. echo "$(echo list | bluetoothctl)" | rofi -dmenu
  8.  
  9. menu="${devices}${nl}Disconnect"
  10. cmd="$(echo "$menu" | rofi -dmenu -p bluetooth)"
  11.  
  12. case $cmd in
  13.     Disconnect) echo disconnect | bluetoothctl ;;
  14.     *) echo connect $(echo list | bluetoothctl | grep "$cmd" | cut -d' ' -f4) | bluetoothctl ;;
  15. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement