[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 1.1.1-2-g6c32972

Darren Salt linux at youmustbejoking.demon.co.uk
Thu Jul 9 22:00:14 UTC 2009


The following commit has been merged in the master branch:
commit 6c3297235b018a0697e20224be5ced861c759b32
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Wed Jul 8 17:00:30 2009 +0100

    Option for preferring "Master" for volume control & muting. Off by default.

diff --git a/debian/changelog b/debian/changelog
index 191398f..79ffa51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 eeepc-acpi-scripts (1.1.2) UNRELEASED; urgency=low
 
+  [ Darren Salt ]
+  * Add an option for preferring to use the 'Master' control for volume
+    control & muting. Off by default; normally takes effect while booting.
+
  -- Darren Salt <linux at youmustbejoking.demon.co.uk>  Thu, 09 Jul 2009 22:56:19 +0100
 
 eeepc-acpi-scripts (1.1.1) unstable; urgency=low
diff --git a/debian/eeepc-acpi-scripts.default b/debian/eeepc-acpi-scripts.default
index b8658d5..a306387 100644
--- a/debian/eeepc-acpi-scripts.default
+++ b/debian/eeepc-acpi-scripts.default
@@ -20,6 +20,10 @@ SOUND_SWITCH=
 # pswitch capabilities only:
 SOUND_SWITCH_EXCLUSIVE=
 
+# If auto-configuring, whether to prefer the Master control over others.
+# Set to 'yes' to enable this. Normally takes effect on reboot.
+SOUND_PREFER_MASTER=no
+
 # Default volume level change.
 # You can specify the change in all ways supported by amixer, e.g.
 # raw value ('5'), percentage ('1.5625%') or decibels ('0.8dB').
diff --git a/etc/acpi/lib/sound.sh b/etc/acpi/lib/sound.sh
index 02c672a..c1be2f3 100644
--- a/etc/acpi/lib/sound.sh
+++ b/etc/acpi/lib/sound.sh
@@ -17,25 +17,44 @@ AMIXER=/usr/bin/amixer
 [ "$SOUND_VOLUME_STEP" = '' ] && SOUND_VOLUME_STEP="$DEF_SOUND_VOLUME_STEP"
 
 configureSoundFilter() {
-  $AMIXER |
   grep -B1 "$1" |
   sed -r "s/^(.*'([^']+)'.*|[^']+())$/\\2/; /^$/ d" |
-  grep -ivF "$(sed -nre "/^#/ d; /!/! {p; d}; /!(.*,)?\b$2\b/ d; s/\s*!.*//; p" /etc/acpi/lib/eeepc-amixer-blacklist)"
+  if [ "$2" = '' ]; then
+    grep ^Master
+  else
+    grep -ivF "$(sed -nre "/^#/ d; /!/! {p; d}; /!(.*,)?\b$2\b/ d; s/\s*!.*//; p" /etc/acpi/lib/eeepc-amixer-blacklist)"
+  fi
 }
 
 # Defaults
 configureSound() {
+    local amixer
+    amixer="$($AMIXER)"
+
+    [ "$SOUND_PREFER_MASTER" != "yes" ] || {
+	[ "$SOUND_LABEL" ] || {
+	    SOUND_LABEL="$(echo "$amixer" | configureSoundFilter pvolume)"
+	}
+
+	[ "$SOUND_SWITCH" ] || {
+	    SOUND_SWITCH="$(echo "$amixer" | configureSoundFilter pswitch)"
+	}
+
+	[ "$SOUND_SWITCH_EXCLUSIVE" ] || {
+	    SOUND_SWITCH_EXCLUSIVE="$(echo "$amixer" | configureSoundFilter ': pswitch$')"
+	}
+    }
 
     [ "$SOUND_LABEL" ] || {
-	 SOUND_LABEL="$(configureSoundFilter pvolume volume)"
+	 SOUND_LABEL="$(echo "$amixer" | configureSoundFilter pvolume volume)"
     }
 
     [ "$SOUND_SWITCH" ] || {
-	 SOUND_SWITCH="$(configureSoundFilter pswitch mute)"
+	 SOUND_SWITCH="$(echo "$amixer" | configureSoundFilter pswitch mute +)"
     }
 
     [ "$SOUND_SWITCH_EXCLUSIVE" ] || {
-	 SOUND_SWITCH_EXCLUSIVE="$(configureSoundFilter ': pswitch$' mute)"
+	 SOUND_SWITCH_EXCLUSIVE="$(echo "$amixer" | configureSoundFilter ': pswitch$' mute)"
     }
 
     [ "$SOUND_VOLUME_STEP" ] || {

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list