feat: touchpad script

This commit is contained in:
filippo-ferrari 2024-02-18 23:42:33 +01:00
parent a5f73b3795
commit 487dead221

View file

@ -1,9 +1,21 @@
#!/bin/bash #!/bin/bash
# xinput disable "Synaptics TM3145-005"
value=$(xinput --list-props "Synaptics TM3145-005" | head -n 2 | tail -c 2) # Check the status of the Bluetooth
if [[ $value -eq 0 ]] bluetooth_status=$(bluetoothctl show | awk '/Powered/ {print $2}')
then connected_devices=$(bluetoothctl info | grep -iE 'Connected: yes')
xinput enable "Synaptics TM3145-005"
# 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 else
xinput disable "Synaptics TM3145-005" # Bluetooth is off
icon="❌"
fi fi
# Print the icon
echo "$icon"