voidrice
voidrice copied to clipboard
Add a bluetooth manager script with dmenu using blutoothctl
Modification of rofi-bluetooth script to use dmenu
instead of rofi
Upon simple inspection this can be easily re-written in POSIX sh; also avoid using echo
whenever possible.
Code where there is one if and an else and one command per condition, like at line 22,
if bluetoothctl show | grep -q "Powered: yes"; then
return 0
else
return 1
fi
can also be rewritten to this:
bluetoothctl show | grep -q "Powered: yes" &&
return 0 ||
return 1
Also "Rofi" at line 298 should become "Dmenu", and the shebang at the top should be replaced with #!/bin/sh
.
You can easily verify POSIX compliance with the shellcheck
command.
Hey, I tested this script and thought it was very useful. Didn't even know this computer had bluetooth. I also rewrote the script to POSIX sh, which you can find at the pull requests of your fork.
Added sb-bluetooth as well
Added new pull request on your fork with some bug fixes
@mhdzli new commit on the PR on your fork with the fix for the above problem and some other improvements, would you consider merging?