Menu

#1 Run user-apps on hardware events

open
nobody
None
2
2012-09-16
2005-09-29
No

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 :-/)

Discussion

  • Matthias Grimm

    Matthias Grimm - 2005-10-06

    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

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-06

    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 ?

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-10

    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.

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-10

    A quick patch allowing to call xscreensaver-command when going to sleep.

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-10

    Logged In: YES
    user_id=1161817

    A mistake in the former patch ;).

     
  • Matthias Grimm

    Matthias Grimm - 2005-10-16

    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

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-17

    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.

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-17

    Logged In: YES
    user_id=1161817

    The script was not installed as an executable in the last
    patch. This one does the job.

     
  • Olivier Mehani

    Olivier Mehani - 2005-10-17

    A patch against gtkpbbuttons 0.6.8 to handle hardware event in every user's session.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.