--- a/rofi-bluetooth +++ b/rofi-bluetooth @@ -7,14 +7,14 @@ # # Author: Nick Clyde (clydedroid) # -# A script that generates a rofi menu that uses bluetoothctl to +# A script that generates a wofi menu that uses bluetoothctl to # connect to bluetooth devices and display status info. # # Inspired by networkmanager-dmenu (https://github.com/firecat53/networkmanager-dmenu) # Thanks to x70b1 (https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-bluetooth-bluetoothctl) # # Depends on: -# Arch repositories: rofi, bluez-utils (contains bluetoothctl) +# Arch repositories: wofi, bluez-utils (contains bluetoothctl) # Constants divider="---------" @@ -231,8 +231,8 @@ trusted=$(device_trusted "$mac") options="$connected\n$paired\n$trusted\n$divider\n$goback\nExit" - # Open rofi menu, read chosen option - chosen="$(echo -e "$options" | $rofi_command "$device_name")" + # Open wofi menu, read chosen option + chosen="$(echo -e "$options" | $wofi_command "$device_name")" # Match chosen option to command case "$chosen" in @@ -254,7 +254,7 @@ esac } -# Opens a rofi menu with current bluetooth status and options to connect +# Opens a wofi menu with current bluetooth status and options to connect show_menu() { # Get menu options if power_on; then @@ -269,15 +269,16 @@ pairable=$(pairable_on) discoverable=$(discoverable_on) - # Options passed to rofi + # Options passed to wofi options="$devices\n$divider\n$power\n$scan\n$pairable\n$discoverable\nExit" else power="Power: off" options="$power\nExit" fi - # Open rofi menu, read chosen option - chosen="$(echo -e "$options" | $rofi_command "Bluetooth")" + lines="$(echo -e "$options" | wc -l)" + # Open wofi menu, read chosen option + chosen="$(echo -e "$options" | $wofi_command "Bluetooth" -L "$lines")" # Match chosen option to command case "$chosen" in @@ -305,7 +306,7 @@ } # Rofi command to pipe into, can add any options here -rofi_command="rofi -dmenu $* -p" +wofi_command="wofi --color=$HOME/.config/wofi/color -d -i -p " case "$1" in --status)