Massive change to the structure of the tree.
This commit is contained in:
parent
2fc5f7a514
commit
c71934ed3b
137 changed files with 51 additions and 266 deletions
37
config/linux-gui/_scripts/sb-volume
Executable file
37
config/linux-gui/_scripts/sb-volume
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
key_micmute() {
|
||||
state=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
|
||||
case ${state} in
|
||||
yes)
|
||||
echo 1 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ 0 ;;
|
||||
no)
|
||||
echo 0 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
vol_decrease() {
|
||||
pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
|
||||
notify-send -t 2000 -u low "volume: $volume"
|
||||
}
|
||||
|
||||
vol_increase() {
|
||||
pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
volume=$(pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk -F' / *' '{print $2}')
|
||||
notify-send -t 2000 -u low "volume: $volume"
|
||||
}
|
||||
|
||||
if [ $1 ]; then
|
||||
case $1 in
|
||||
dec) vol_decrease ;;
|
||||
inc) vol_increase ;;
|
||||
micmute) key_micmute ;;
|
||||
esac
|
||||
else
|
||||
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && mute="audio muted" || mute=""
|
||||
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = no ] && printf "${mute} mic unmuted" || printf "${mute}"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue