Bug 98840 - klaptop option to execute a script on an event
Summary: klaptop option to execute a script on an event
Status: RESOLVED FIXED
Alias: None
Product: kcontrol
Classification: Miscellaneous
Component: kcmlaptop (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Paul Campbell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 12:46 UTC by Elias Gerber
Modified: 2011-12-03 15:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Gerber 2005-02-08 12:46:17 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages

Hello!

I really like the moudle 'laptop battery' in the kde control center to configure the behaving of my laptop. But my problem is that i need to unload some modules and deconfigure the network before i can send my laptop into supsend mode (mostly some usb modules, if not unloaded before going to suspend, the whole usb-subsystem wont work if i resume from suspend).
That means for me i cannot use the suspend option that comes with the laptop battery-module. instead i am now using acpid to check when the lid gets closed, and then execute a script that unloads the module, goes into suspend, and on coming back of suspend it loads the modules again, something like this:

#!/bin/sh
# /etc/acpi/suspend.sh
ifdown eth0
rmmod ehci_hcd
echo 3 > /proc/acpi/sleep
modprobe ehci_hcd
ifup eth0

now i think it would be quite comfortable to have in 'laptop battery' in the tab 'button actions' and 'power control' also an option 'execute command', like the ones that already exist in 'low battery critical' and 'low battery warning'.
so i could select 'nothing' in 'system state change' ,but check 'execute script', so my script gets started, unloads the modules, goes into suspend mode, and then reloads the modules again when coming out of suspend.

another option would also be to add a feature 'unload modules before suspend', but in my opinion the option with a script would be better, as it is (i think) easier to implement, and the user then has all posibilities.
of course you can say that this is a problem/bug in these modules, but i think there will always be such problems, and with an option like the one mentioned above kde would give a nice workaround for these problems.

if you have any questions feel free to contact me at egerber@gmx.net

Goodbye and of course thanks for the great work done until now!!

Elias Gerber
Comment 1 Vesko Tomov 2005-06-10 15:52:59 UTC
Just want to add my support for Elias's suggestion.  I really like klaptop and if it could execute a custom script (like acpid does) it would really give me a way to set up all power management from one central interface.  In fact, I recently installed swsuspend2 on my computer and was very happy to see that klaptop offered me the option of using that, instead of the built-in suspend, for hibernation.  Now, if I could only get klaptop to execute a custom script during suspend-to-ram...

Vesko
Comment 2 Victor-Philipp Busch 2005-11-24 19:28:10 UTC
I need only the execution of the program "hibernate"... so I vote for this wish! :)
Comment 3 Victor-Philipp Busch 2005-11-24 19:28:28 UTC
*** This bug has been confirmed by popular vote. ***
Comment 4 Thijs 2011-12-03 15:55:55 UTC
With power management so devistatingly different these days let's close this one.