├── README.md ├── bluetooth.sh ├── screenshots ├── connected.png ├── off.png └── on.png └── toggle_bluetooth.sh /README.md: -------------------------------------------------------------------------------- 1 | # Polybar bluetooth module 2 | A fully functional bluetooth module for polybar that adds an icon that changes dinamically accordingly to the bluetooth status. 3 | 4 | ![on](https://github.com/msaitz/polybar-bluetooth/blob/master/screenshots/on.png) When the bluetooth is on 5 | 6 | ![off](https://github.com/msaitz/polybar-bluetooth/blob/master/screenshots/off.png) When the bluetooth is off 7 | 8 | ![connected](https://github.com/msaitz/polybar-bluetooth/blob/master/screenshots/connected.png) When the bluetooth is connected to a device 9 | 10 | ## Dependencies 11 | - Font Awesome 5 Free 12 | - Systemd 13 | - Blueberry 14 | 15 | ## Installation 16 | 17 | Place the shell script files in your preferred sctipt directory. 18 | 19 | Add the module to your polybar config file 20 | ```ini 21 | [module/bluetooth] 22 | type = custom/script 23 | exec = path/to/scripts/bluetooth.sh 24 | interval = 2 25 | click-left = exec blueberry 26 | click-right = exec path/to/scripts/config/polybar/toggle_bluetooth.sh 27 | format-padding = 1 28 | format-background = #000000 29 | format-foreground = #ffffff 30 | ``` 31 | ## Usage 32 | Left click on the bluetooth icon launches blueberry or the bluetooth configuration tool of your choice. 33 | 34 | Right click on the bluetooth icon toggles the bluetooth power status. 35 | -------------------------------------------------------------------------------- /bluetooth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] 3 | then 4 | echo "%{F#66ffffff}" 5 | else 6 | if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ] 7 | then 8 | echo "" 9 | fi 10 | echo "%{F#2193ff}" 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /screenshots/connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msaitz/polybar-bluetooth/44ae51f5d78e7e26810a59eaaf381f7bee887585/screenshots/connected.png -------------------------------------------------------------------------------- /screenshots/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msaitz/polybar-bluetooth/44ae51f5d78e7e26810a59eaaf381f7bee887585/screenshots/off.png -------------------------------------------------------------------------------- /screenshots/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msaitz/polybar-bluetooth/44ae51f5d78e7e26810a59eaaf381f7bee887585/screenshots/on.png -------------------------------------------------------------------------------- /toggle_bluetooth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] 3 | then 4 | bluetoothctl power on 5 | else 6 | bluetoothctl power off 7 | fi 8 | --------------------------------------------------------------------------------