This commit is contained in:
2025-09-18 11:35:56 +02:00
commit 2203d6075f
45 changed files with 935 additions and 0 deletions

17
shell/get_vol.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Get the current active sink
active_sink=$(pactl info | grep 'Default Sink:' | awk '{print $3}')
# Check which sink is active and get its volume
if [ "$active_sink" == "alsa_output.pci-0000_01_00.1.hdmi-stereo" ] || [ "$active_sink" == "alsa_output.pci-0000_00_1f.3.analog-stereo" ]; then
volume=$(pactl list sinks | grep -A 10 "Name: $active_sink" | grep -m 1 'Volume:' | awk '{print $5}')
pre=''
if [ "$active_sink" == "alsa_output.pci-0000_01_00.1.hdmi-stereo" ]; then pre='M'; elif [ "$active_sink" == "alsa_output.pci-0000_00_1f.3.analog-stereo" ]; then pre='H'; fi
if [ $(pulsemixer --get-mute) -eq 0 ]; then echo "($pre) $volume"; else echo "($pre) Muted"; fi
else
echo "Active sink not recognized."
fi