Acpid scripte

Aus Bennys Wiki
Wechseln zu: Navigation, Suche

/etc/acpi/events/[Bearbeiten]

powerbtn[Bearbeiten]

event=button[ /]power
action=/etc/acpi/powerbtn.sh

lidbtn[Bearbeiten]

event=button[ /]lid
action=/etc/acpi/lidbtn.sh

/etc/acpi/[Bearbeiten]

powerbtn.sh[Bearbeiten]

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a suspend to disk when the power putton has been
# pressed.

su user -c xlock &
sleep 1 
/etc/init.d/acpid stop
echo disk >/sys/power/state
sleep 10 
/etc/init.d/acpid start

lidbtn.sh[Bearbeiten]

#!/bin/sh
# /etc/acpi/lidbtn.sh
# Initiates a suspend when the display been closed.

# stop acpid and suspend
su user -c xlock &
sleep 1
/etc/init.d/acpid stop
sleep 1
echo mem >/sys/power/state

# wait and restart scpid
sleep 10
/etc/init.d/acpid start