From bead40c7d0d8782f84749e610d2422b802101782 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 25 Apr 2015 15:09:25 +0200 Subject: add example audio-volume-control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/examples/audio-volume-control/monitor | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 doc/examples/audio-volume-control/monitor (limited to 'doc/examples/audio-volume-control/monitor') diff --git a/doc/examples/audio-volume-control/monitor b/doc/examples/audio-volume-control/monitor new file mode 100755 index 0000000..82fe7bc --- /dev/null +++ b/doc/examples/audio-volume-control/monitor @@ -0,0 +1,15 @@ +#!/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/\'/\'\\\'\'}"\'' "${arg}"' + -- cgit v1.2.3-70-g09d2