feat: touchpad script
This commit is contained in:
parent
a5f73b3795
commit
487dead221
1 changed files with 20 additions and 8 deletions
|
@ -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"
|
|
||||||
else
|
# Set the icon based on Bluetooth status
|
||||||
xinput disable "Synaptics TM3145-005"
|
if [ "$bluetooth_status" == "yes" ] && [ ! -z "$connected_devices" ]; then
|
||||||
fi
|
# 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"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue