From kde-commits Tue Jan 06 22:34:50 2015 From: Christian Esken Date: Tue, 06 Jan 2015 22:34:50 +0000 To: kde-commits Subject: [kmix] apps: Make kmixremote sh compatible. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=142058369908295 Git commit bc607e91429c9d49b3f2c52648f869c89ef81387 by Christian Esken. Committed on 06/01/2015 at 22:34. Pushed by esken into branch 'master'. Make kmixremote sh compatible. BUGS: 341640 M +9 -8 apps/kmixremote http://commits.kde.org/kmix/bc607e91429c9d49b3f2c52648f869c89ef81387 diff --git a/apps/kmixremote b/apps/kmixremote index 2f21209..a9468c5 100755 --- a/apps/kmixremote +++ b/apps/kmixremote @@ -7,7 +7,7 @@ # Mute ##########################################################################= ####### = -function usage +usage() { echo "Usage:" echo "List mixers # $0 list" @@ -15,19 +15,19 @@ function usage echo "Get Volume # $0 get [--master | ]" echo "Set Volume # $0 set [--master | ] <0..100>" echo "Mute/Unmute # $0 mute [--master | ] true|fal= se" - echo = + echo } = -function exit_with_error +exit_with_error() { echo "Error: $1" - echo = + echo usage exit 1 } = # Prints the mixer DBUS ID's on the console. leaving out the "/Mixers/" pr= efix -function listMixers +listMixers() { qdbus org.kde.kmix /Mixers org.freedesktop.DBus.Properties.Get org.kde.K= Mix.MixSet mixers | cut -f3 -d/ errorCode=3D$? @@ -37,7 +37,7 @@ function listMixers } = # Prints the mixer control DBUS ID's of the given mixer on the console. le= aving out the "/Mixers/" prefix -function listControls +listControls() { qdbus org.kde.kmix $1 org.freedesktop.DBus.Properties.Get org.kde.KMix.M= ixer controls | cut -f4 -d/ errorCode=3D$? @@ -55,10 +55,11 @@ fi # Read args while true; do arg=3D$1 - shift if test -z "$arg"; then break - elif test "x--master" =3D "x$arg"; then + fi + shift + if test "x--master" =3D "x$arg"; then mixer=3D`qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.currentMasterM= ixer` control=3D`qdbus org.kde.kmix /Mixers org.kde.KMix.MixSet.currentMaste= rControl` elif test "x--help" =3D "x$arg" -o "x-h" =3D "x$arg"; then