Skip to content

Instantly share code, notes, and snippets.

@ziogaschr
Last active April 9, 2017 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ziogaschr/09bde797dc65bf1ef174 to your computer and use it in GitHub Desktop.
Save ziogaschr/09bde797dc65bf1ef174 to your computer and use it in GitHub Desktop.
Use cubieboard power button for poweroff on Debian

Use cubieboard power button for poweroff on Debian

install acpid

sudo apt-get install acpid

listen on power button press and execute powerbtn.sh

pico /etc/acpi/events/power

File contents:

	event=button/power
	action=/etc/acpi/powerbtn.sh %e

script that can handle all the button actions for now it poweroffs the cubieboard

pico /etc/acpi/powerbtn.sh

File contents:

	exec poweroff

make the script executable

chmod +x /etc/acpi/powerbtn.sh

start acpi listener on system start

pico /etc/init/acpid.conf

File contents:

	exec acpid -c /etc/acpi/events -s /var/run/acpid.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment