[Nottingham] smart-arsed acpi

Michael Erskine msemtd at yahoo.co.uk
Fri Feb 17 14:17:23 GMT 2006

At Wednesday night's excellent meeting I raised the question of how to tell my 
machine not to shut down when the power button is pressed. I just implemented 
a humorous solution that puts a knotes post-it note on my screen saying 
"Don't do that again!". In /etc/acpi/powerbtn.sh (on this Breezy box) there 
happened to be a section instructing all ksmserver sessions to logout which I 
hijacked to do this instead...

if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
    dcop --all-sessions --all-users knotes KNotesIface newNote Warning "don't 
do that again"

Now, this won't work unless knotes is already running on each users' KDE. If 
any dcop experts out there can tell me how to make dcop launch knotes if not 
found on each KDE session or some other way of popping up a warning dialog 
I'll have a complete and very funny feature.

Michael Erskine

<|ryan|> I don't use deb
<netgod> u poor man
<Disconnect> netgod: heh
<Kingsqueak> apt-get install task-p0rn

Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry

More information about the Nottingham mailing list