--- /dev/null
+# When the lid is closed, go into suspend to ram
+event=button/lid
+action=/etc/acpi/suspend2ram.sh button-lid
--- /dev/null
+# When the power button is pressed, shutdown the system.
+event=button/power
+action=/etc/acpi/shutdown.sh
--- /dev/null
+# When the lid is closed, go into suspend to ram
+event=button/sleep
+action=/etc/acpi/suspend2ram.sh button-sleep
--- /dev/null
+event=button/mute
+action=/usr/bin/amixer set Master toggle
--- /dev/null
+event=button/volumedown
+action=/etc/acpi/vol.sh -
--- /dev/null
+event=button/volumeup
+action=/etc/acpi/vol.sh +
+
#!/bin/sh
-if [ -f /proc/acpi/button/lid/LID/state ]; then
- if grep -q open /proc/acpi/button/lid/LID/state; then
- # Do not act on lid opened event. Only on lid closed.
- exit 0
- fi
-fi
+case "$1" in
+ button-sleep)
+ logger "Sleep button pressed"
+ ;;
+ button-lid)
+ if [ -f /proc/acpi/button/lid/LID/state ]; then
+ if grep -q open /proc/acpi/button/lid/LID/state; then
+ logger "Lid opened detected, do nothing"
+ # Do not act on lid opened event. Only on lid closed.
+ exit 0
+ fi
+
+ logger "Lid closed detected"
+ fi
+ ;;
+ *)
+ logger "Unknown event: ${1}"
+ ;;
+esac
+
+logger "Going to sleep"
# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`
{
install -v -d -m755 /etc/acpi/events
- cat > /etc/acpi/events/button-lid << EOF
-# When the lid is closed, go into suspend to ram
-event=button/lid
-action=/etc/acpi/suspend2ram.sh
-EOF
-
- cat > /etc/acpi/events/button-power << EOF
-# When the power button is pressed, shutdown the system.
-event=button/power
-action=/etc/acpi/shutdown.sh
-EOF
+ install -v -m644 ${SCRDIR}/misc/acpi/events/* /etc/acpi/events
install -v -m755 ${SCRDIR}/misc/acpi/suspend2ram.sh /etc/acpi
install -v -m755 ${SCRDIR}/misc/acpi/shutdown.sh /etc/acpi