system/home/modules/window_manager/scripts/get_volume.sh

10 lines
200 B
Bash
Raw Normal View History

#!/usr/bin/env bash
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