Index: src/platform/acpi/action_hotkey.sh |
diff --git a/src/platform/acpi/action_hotkey.sh b/src/platform/acpi/action_hotkey.sh |
index 7e3c28765d8e86ada366b0760f02b05d5fea905b..57cf831ca10288c96b925359e359aca7df1eb243 100755 |
--- a/src/platform/acpi/action_hotkey.sh |
+++ b/src/platform/acpi/action_hotkey.sh |
@@ -6,15 +6,28 @@ |
# TODO: This is specific to eeepc. Figure out a way to generalize and |
# add support for additional hotkeys. |
+# |
+# TODO(ajwong): Find a better way to talk to pulseaudio than changing to the |
+# chronos user and talking to pulseaudio via amixer. |
+ |
+USER_ID="$(/usr/bin/id -u chronos)" |
+MINIJAIL_FLAGS="--use-capabilities" |
+ |
+# Needed by amixer to so that the alsa pulseaudio plugin, can locate the |
+# correct ${HOME}/.pulse directory. |
+export HOME=/home/chronos/user |
case "$3" in |
00000013) # Toggle sound |
- amixer set Master toggle |
+ /sbin/minijail ${MINIJAIL_FLAGS} --uid=${USER_ID} -- \ |
+ /usr/bin/amixer set Master toggle |
;; |
00000014) # Decrease volume |
- amixer set Master 5%- |
+ /sbin/minijail ${MINIJAIL_FLAGS} --uid=${USER_ID} -- \ |
+ /usr/bin/amixer set Master 5%- |
;; |
00000015) # Increase volume |
- amixer set Master 5%+ |
+ /sbin/minijail ${MINIJAIL_FLAGS} --uid=${USER_ID} -- \ |
+ /usr/bin/amixer set Master 5%+ |
;; |
esac |