[vox-tech] Kubuntu (KDE4) and power button

Ken Bloom kbloom at gmail.com
Mon Aug 3 15:27:48 PDT 2009


On Mon, 2009-08-03 at 15:19 -0700, Bill Kendrick wrote:
> Ok, I have not figured out where, in KDE4, to tell my system to _NOT_
> "shut down immediately, no questions asked" when the power button is pushed.
> (Which my son loves to do, so he can see the big kubuntu logo during shutdown.)
> 
> When I click the batter icon in the Plasma taskbar, "Guidance Power Manager"
> comes up, but the closest thing I see is for "When Laptop Lid Closed", which
> is not it.  (It's set to 'Suspend', which works fine.)
> 
> 
> I tried hitting [Alt]+[F2] to bring up KRunner, and typed "power"...
> 
> The "Power Control" control module allows configuration for external displays;
> not what I'm looking for.
> 
> Under "Power Management" control module, there's an "Edit Profiles" section.
> Inside there, under 'Actions', there is a "When Power Button Pressed" setting.
> Under all 5 categories ("Aggressive Powersave", "Performance", etc.), I made
> sure it's set to "Do nothing."  However, hit the power button and Linux
> begins shutting down immediately.
> 
> Finally, there's "Power Management Backend" section in the "Hardware"
> control module.  The only option is "HAL-Power."
> 
> 
> See a script, 'powerbtn.sh', in my /etc/acpi/ directory.
> Just glancing at it, and not trying to invoke my limited knowledge of
> BASH syntax, it looks like it first tries to talk to GNOME, then KDE,
> then as a last resort, issues an '/sbin/shutdown -h now'.
> 
> I guess I should just blow away, chmod or modify that script, eh?
> Or is there something I can do to 'fix' it, so that when the power button is
> hit, KDE does the right thing?

One option: blow it away.

The other option: look in /etc/acpi/events for a bunch of files that
tell acpi which script to call when specific buttons are pressed, and
blow away whichever file has the line "event=button[ /]power". This
would have the effect that the script isn't called anymore.

> Since my laptop had Ubuntu factory-installed, and hence started life
> with GNOME, perhaps there's some GNOME setting that's getting picked
> up by the ACPI script first.  (i.e., I'm telling KDE "do nothing," but
> GNOME is telling it "shutdown", and it's NOT a matter of the ACPI script
> hitting its "if all else failed, just initiate a plain shutdown" logic.)

I doubt it. In Debian, at least, all of the acpi scripts are in
desktop-neutral packages related specifically to power management. Run
"dpkg -S /etc/acpi" and check whether there are any desktop-specific
packages on Ubuntu that touch this, but it's probably kept separate.

--Ken


More information about the vox-tech mailing list