voidrice icon indicating copy to clipboard operation
voidrice copied to clipboard

Add a bluetooth manager script with dmenu using blutoothctl

Open mhdzli opened this issue 2 years ago • 4 comments

Modification of rofi-bluetooth script to use dmenu instead of rofi

mhdzli avatar Jul 20 '22 22:07 mhdzli

Upon simple inspection this can be easily re-written in POSIX sh; also avoid using echo whenever possible.

anntnzrb avatar Jul 22 '22 16:07 anntnzrb

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.

appeasementPolitik avatar Jul 22 '22 17:07 appeasementPolitik

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.

appeasementPolitik avatar Sep 12 '22 19:09 appeasementPolitik

Added sb-bluetooth as well

appeasementPolitik avatar Sep 13 '22 09:09 appeasementPolitik

Added new pull request on your fork with some bug fixes

appeasementPolitik avatar Oct 21 '22 07:10 appeasementPolitik

@mhdzli new commit on the PR on your fork with the fix for the above problem and some other improvements, would you consider merging?

appeasementPolitik avatar May 14 '23 09:05 appeasementPolitik