Advertisement
FranzVuttke

.funcs.sh

Jul 28th, 2024 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. #
  5. # created by OuNiS 07.2024
  6. #
  7. # pastebin: https://pastebin.com/RydAtzgD
  8.  
  9. MODULE_NAME=".ounis-funcs"
  10.  
  11. echo "$MODULE_NAME - załadowane..."
  12.  
  13. listBluetoothDevs () {
  14. eche "\nlista urządzeń bluetooth:\n--------------------------"
  15. # bluetoothctl devices > bluet_devices.txt
  16. # for line in $(cat bluet_devices.txt); do
  17. #   echo $line
  18. # done
  19. # see: https://pastebin.com/wy0ZLGRH
  20. # https://computingforgeeks.com/connect-to-bluetooth-device-from-linux-terminal/
  21.     if [[ -n `which bluetoothctl` ]]; then
  22.         (bluetoothctl devices) | while read line || [[ -n $line ]] ;
  23.         do
  24.             eche $CL_BLUE$CL_BOLD"$line"
  25.         done #< <(bluetoothctl devices)
  26.         result=$?
  27.         eche $CL_DEF
  28.         return $result
  29.     else
  30.         return 1
  31.     fi
  32. }
  33.  
  34. funcsList () {
  35.     cat $MODULE_NAME | grep \(\) | cut -d " " -f1,2
  36. }
  37. alias funcs='funcsList'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement