diff --git a/.local/bin/touchpad b/.local/bin/touchpad index dbceff9..9ab6ebd 100755 --- a/.local/bin/touchpad +++ b/.local/bin/touchpad @@ -1,9 +1,21 @@ #!/bin/bash -# xinput disable "Synaptics TM3145-005" -value=$(xinput --list-props "Synaptics TM3145-005" | head -n 2 | tail -c 2) -if [[ $value -eq 0 ]] -then - xinput enable "Synaptics TM3145-005" -else - xinput disable "Synaptics TM3145-005" -fi + + # Check the status of the Bluetooth + bluetooth_status=$(bluetoothctl show | awk '/Powered/ {print $2}') + connected_devices=$(bluetoothctl info | grep -iE 'Connected: yes') + + # Set the icon based on Bluetooth status + if [ "$bluetooth_status" == "yes" ] && [ ! -z "$connected_devices" ]; then + # Bluetooth is on and connected to a device + icon=" " + elif [ "$bluetooth_status" == "yes" ]; then + # Bluetooth is on but not connected to a device + icon="" + else + # Bluetooth is off + icon="❌" + fi + + # Print the icon + echo "$icon" +