aboutsummaryrefslogblamecommitdiffstats
path: root/doc/examples/audio-volume-control/monitor
blob: 4956f7b58137373f645fb4e87f4bb4cf36f2e7ab (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                      
                                                               
 
#!/bin/sh
if [ $# = 1 ]; then
    if [ "$(echo "${1}" | cut -d ' ' -f 2)" = "volume-changed" ]; then
	printf '\e[H\e[2J'
	amixer get Master
    fi
    exit 0
fi

exec 2>/dev/null

printf '\e[?1049h\e[H\e[2J'
trap -- "printf '\e[?1049l'" SIGINT
bus listen "/tmp/example-bus" \'"${0/\'/\'\\\'\'}"\'' "${msg}"'