Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # List ble devices in rofi
  4. ROFIRESULT=$(bluetoothctl devices | cut -f 2- -d ' ' | sed -r 's/\s+/;/' | rofi -dmenu -i -p "Focus on window")
  5.  
  6. # Read id of device selected in rofi
  7. IFS=';' read -ra RESSPLIT <<< "$ROFIRESULT"
  8.  
  9. # Connect and pipe output to notify-send
  10. # bluetoothctl connect "$RESSPLIT" #| xargs -n1 -d '\n' notify-send
  11. # notify-send "$(bluetoothctl connect "$RESSPLIT")"
  12. bluetoothctl connect "$RESSPLIT" | while read -r BTOUTPUT; do notify-send "$BTOUTPUT"; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement