Announcement

Collapse
No announcement yet.

Running scripts when a user performs a gui login or logout

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Running scripts when a user performs a gui login or logout

    I have two scripts that I want run when a particular user performs a gui login. One performs a task (disable the touchpad). The other supplies a service (ssh tunnels to a remote mail server).

    Two approaches come to mind for running these scripts as stated but I can't figure out how to make either one of them work.

    1) Autostart:

    K->Computer->System Settings->System Administration->Startup and Shutdown->Autostart->Add Script

    Having both Startup and Shutdown options here looks like a good thing but no script that I specify remains specified after I close System Settings. There is no "apply" or "save" button that I can see.

    2) Upstart (init)

    My reading of man pages for Upstart leads me to believe that an event consisting of a user's gui login or logout can be used to start a task or service but I have been unable to find what "event" serves as the trigger for these actions. "man 8 upstart" lists "$HOME/.init/" under "files." This leads me to believe that things can be done by init for a particular user. This further implies that events like login or logout may exist.

    Maybe Upstart is not yet mature enough to do what I want. I don't know.

    I would appreciate any help in finding how to accomplish my desired functionalities. The people at the lugs in which I participate don't like KDE so everyone there is at least as ignorant about these matters as I am.

    #2
    Re: Running scripts when a user performs a gui login or logout

    One way to do this is to call the script from /etc/rc.local for actions you want for all users at every log in or for a particular user - in that users .bashrc file.

    You can either call the scripts or put the script commands into the above files directly. You'll need to have permissions correct for the users involved also.

    Please Read Me

    Comment


      #3
      Re: Running scripts when a user performs a gui login or logout

      Originally posted by oshunluvr
      One way to do this is to call the script from ... for a particular user - that users .bashrc file.
      Thank you. I'll give that a try.

      Comment

      Working...
      X