system/users/jan/scripts/get_volume.sh

8 lines
189 B
Bash
Executable file

#!/bin/sh
enabled=$(amixer sget Master | egrep -o "\[on\]" | wc -l)
if [[ $enabled == "0" ]]; then
echo "off"
else
echo $(amixer sget Master | egrep -o "[0-9]+%" | head -n 1)
fi
exit 0