Run user-apps on hardware events
Brought to you by:
matthiasgrimm
A missing feature, in my opinion, of gtkpbbuttonsd is
the possibility to run an (arbitrary) program as the
user who started it when going to sleep/lid is
closed/whatever PMU related event happens.
The usage I'm thinking about of this feature would be
to run "xscreensaver-command -lock" whenever my
computer goes to sleep (or whenever I close the lid).
(sorry for the duplicate post in the bug reports :-/)
Logged In: YES
user_id=466936
pbbuttonsd is already able to launch programs at certain
events (sleep, lid close, wakeup, etc). These scripts (or
commands) will always be executed with the same permissions
as pbbuttonsd (usually root).
Because pbbuttonsd is a daemon running usually with root
permissions, it is not designed to execute user commands.
Currently there is no convenient
way to run "xscreensaver-command -lock" whenever sleep was
triggered, sorry.
Best Regards
Matthias
Logged In: YES
user_id=1161817
Maybe I can try and do this myself in the code of
gtkpbbuttons then submit a patch or don't you like the idea ?
Logged In: YES
user_id=1161817
Here is a quick and not so generic patch. It allows for
calling a single command upon sleep. I'm thinkin about a
more generic way to do that, ie calling a script with a
parameter depending on the event. But this patch provides
the basic function. I will work more on it later. Tell me
what you think about it.
A quick patch allowing to call xscreensaver-command when going to sleep.
Logged In: YES
user_id=1161817
A mistake in the former patch ;).
Logged In: YES
user_id=466936
Hi,
please feel free to make the changes you need to the code of
pbbuttonsd. Its GPL.
If you like to discuss your ideas with other people, please
subscribe to the pbbuttonsd mailinglist here on sourceforge.
This forum is not used very frequent :-)
You could send your patches to this mailinglist too.
Best regards
Matthias
Logged In: YES
user_id=1161817
OK, here is the new generic patch. It adds the
/usr/share/gtkpbbuttons /gtkpbbuttons-event.sh file which
can be used by every user's instance of gtkpbbuttons to
handle hardware events (currently, only the sleep section
does something useful). By default (no command line
argument) this behavior is NOT enabled but
gtkpbbuttons -e|--eventcmd
/usr/share/gtkpbbuttons/gtkpbbuttons-event.sh
will do the job. Every event which displays a popup window
also generates a call to thise script with the name of the
event as a first argument and the value (or 0) as the second
argument.
Logged In: YES
user_id=1161817
The script was not installed as an executable in the last
patch. This one does the job.
A patch against gtkpbbuttons 0.6.8 to handle hardware event in every user's session.