Power-off after mouse inactivity
February 10, 2009 —
BarryK
Thanks to forum member 'steel_i' who thought of this:
http://murga-linux.com/puppy/viewtopic.php?t=36109
Steel-i did 'cat /proc/interrupts' to watch for mouse interrupts. However the interrupt number may vary depending on the hardware, and I don't know any way to definitely determine which one is the mouse.
So, I thought about reading the mouse cursor coordinates, and found this little utility app:
http://dzen.geekmode.org/dwiki/doku.php?id=misc:xget-mouse-position
I have added a new "Power" tab to the EventManager, in which an inactivity interval can be entered (in minutes). This saves to a variable 'POWERTIMEOUT' in /etc/eventmanager.
The frontend pup_event event daemon /sbin/pup_event_frontend_d reads this variable and reads the cursor coords periodically. If inactivity is determined for the specified interval, the computer is powered down.
Comments
OptionsUsername: Pizzasgood
Maybe you should make it so that there is a text field where the user can enter a custom command. Then people could have it run other things like a screen saver, Xlock, logout, or anything they want. Another possibility is to have it start playing an alarm to wake them back up - useful for overworked college kids pulling all-nighters. Maybe Xlock should be a built in option. There could be radio buttons with "Shutdown", "Xlock", and "Custom:", where "Custom:" is followed by the input field.
Options
Username: Sage
"One is profoundly disturbed by the many options being proposed for adding to Puppy & Woof. It is a sobering fact that most putative users will either not understand or not bother to implement options and changes, even those that will massively improve their own "browsing experience", to quote a well-worn and notorious cliché. K.I.S.S. must remain the watchword. Debian, Ubuntu, Slackware repositories might even be a bridge too far. A simple pre-selection made by a wise and experienced developer is much more pertinent and valued. There will always be detractors. Many of those will arise from within the trade, folks who are entirely capable of making their own modifications. The great unwashed have little interest in this flexibility, especially as they can ask for special requests which may or may not be acceded to at a developer's discretion. In the alternative, it's worth remembering that M$DOS went down the drain when both the cost escalated unreasonably and the printed (!) manuals failed to be supplied. Like meeting a Sheila or buying a house, the impression given within the first ten seconds of booting a new distro is likely to cast the runes for it's ultimate success. No good bleating that it shouldn't be like this, better to face the targets as they are; it is unreasonable to expect others to behave according to someone else's preference. At the end of the day, it's the user, not the developer that makes for a success. At present Puppy is doing better than average, but complacency is as much to be avoided as clever stuff is to be kept strictly under the bonnet. The art comes in acceptability. For all these reasons, John's 50Mb MeanPup (oh yes, with Opera!) remains a firm favourite even though he hasn't yet had time or inclination to update it from v2.02.
Tags: woof