This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SINK=$(pacmd list-cards | grep bluez) | |
MAC=${SINK:19:17} | |
SINK=$(pacmd list-sinks | grep index | grep -vw "index: 0") | |
INDEX=${SINK:11:2} | |
BT_SINK="bluez_card.$MAC" | |
A2DP="a2dp_sink" | |
HSP="headset_head_unit" | |
SINK=$(pacmd list-sinks | grep bluetooth.protocol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
device=11 | |
state=`xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$"` | |
if [ $state == '1' ];then | |
xinput --disable $device | |
else | |
xinput --enable $device | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SINK=$(pacmd list-sinks | grep index) | |
INDEX_1=${SINK:11:2} | |
SINK=$(pacmd list-sinks | grep index | grep -vw "index: 1") | |
INDEX_2=${SINK:11:2} | |
SINK=$(pacmd list-sinks | grep "* index") | |
ACTIVE_SINK=${SINK:11:2} | |
if [ $ACTIVE_SINK = $INDEX_2 ]; then |