BIG reorganisation.
This commit is contained in:
parent
3be3ccbbea
commit
e20e00ef8a
122 changed files with 36 additions and 109 deletions
38
_gui/_scripts/sb-volume
Executable file
38
_gui/_scripts/sb-volume
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
key_micmute() {
|
||||
state=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
|
||||
case ${state} in
|
||||
yes)
|
||||
echo 0 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ 0 ;;
|
||||
no)
|
||||
echo 1 | 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 ;;
|
||||
key) key_micmute ;;
|
||||
esac
|
||||
else
|
||||
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
|
||||
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && micmute="mic muted" || micmute=""
|
||||
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 ] && printf "${micmute} audio muted" || printf "$micmute"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue