system/users/jan/scripts/get_volume.sh

9 lines
189 B
Bash
Raw Normal View History

2022-08-27 15:02:09 +03:00
#!/bin/sh
2022-08-27 23:41:37 +03:00
enabled=$(amixer sget Master | egrep -o "\[on\]" | wc -l)
2022-04-12 23:15:05 +03:00
if [[ $enabled == "0" ]]; then
echo "off"
else
2022-08-27 23:41:37 +03:00
echo $(amixer sget Master | egrep -o "[0-9]+%" | head -n 1)
2022-04-12 23:15:05 +03:00
fi
exit 0