Configure power button to shutdown on Debian/Mac Mini G4
Brought to you by:
matthiasgrimm
|
From: Mathieu M. <ma...@de...> - 2015-01-03 14:26:25
|
Dear pbbuttons user,
I am trying to get pbbuttons to handle the following simple task: when
I press the power button, I'd like the box to shutdown nicely.
I have build pbbuttons with debug info (--enable-debug), and I am
running it like this:
$ sudo /usr/bin/pbbuttonsd --configfile=/etc/pbbuttonsd.conf
WARNING: No backlight driver available - check your Kernel configuration.
WARNING: Card 'default' has no 'Master' element.
WARNING: Card 'default' has no 'PC Speaker' element.
WARNING: Option 'ALSA_Elements' contains no valid elements
INFO: Soundsystem requested: ALSA and at least activated: none.
INFO: saving of config enabled to /etc/pbbuttonsd.conf.
pbbuttonsd 0.7.9: Unknown PowerBook - PMU version: 85
INFO: Script '/etc/power/pmcs-pbbuttonsd performance ac ' lauched but
exitcode is not null
However as noted above, nothing happen in the output when I press the
power button (single short pression). Reading the source code it
should however do something (AFAIK):
$ cat src/module_pmac.c
[...]
/* n = 2 && intr[1] = 0x0c = %01100 power
button on mac-mini */
[...]
#if defined(DEBUG) && PMUINTR
printf ("\nPMU interrupt: ");
for (i=0; i < n; i++)
printf ("%.2x ", intr[i]);
printf ("\n");
#endif
If needed I can send the full configuration but the main options I
played with are:
$ grep Sleep /etc/pbbuttonsd.conf
onAC_KeyAction = shutdown ; SleepKey
onBattery_KeyAction = shutdown ; SleepKey
SleepKey = 116
SleepKeyDelay = 0 ; values > 0 may be dangerous, if the power
key is used to trigger sleep
Any suggestion would be very appreciated !
Happy New Year
|