2

I'm using debian with kde4 I have a script that i need to be executed after a user loggins to kde. The system is setup to auto-login a user and lock the session. I tried to add the script to kde's autostart but it seams that it's not executed if the auto-login user is set to lock session right away. It only starts after the session is unlocked. How can i make the script run after the aut-login but before the auto-lock?

1
  • I added an answer below, but had another thought: There is a change the script is catching a term signal with the lock. Have you tried adding an "&" and the end of the call for the script? So in the hook you have it would be script_name.sh &?
    – nerdwaller
    Dec 3, 2012 at 20:56

2 Answers 2

0

One option is to disable the auto-lock by the system and call it after the script is done. Assuming that you are able or willing to do that:

I don't use KDE, but I think this is the script for KDE 4.x+:

qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock

4
  • I just tried your initial solution. Looks like it's working. The downside is that for a couple of seconds (while the desktop loads and stats the screen) the desktop is visible and user can interact with it. I'm waiting for a better solution that works straight with auto-login and auto-lock.
    – AlexL
    Dec 3, 2012 at 21:01
  • @AlexLinte I am downloading KDE to try to find a solution for you, assuming no one does in the mean time.
    – nerdwaller
    Dec 3, 2012 at 21:43
  • Looks like this is the best solution so far. Thanks nerdwaller
    – AlexL
    Dec 4, 2012 at 10:51
  • Sure thing, I apologize for not getting to test KDE much yet. Had some school stuff I had to get done. If I come up with anything, I'll be back in touch.
    – nerdwaller
    Dec 4, 2012 at 13:38
2

The desktop-agnostic way to autostart apps in xorg is by placing *.desktop launcher files in the following folder:

~/.config/autostart

Apparently KDE respects the convention and it might work.

The launchers can be copied/symlinked/drag-and-dropped from /user/share/applications.

See also https://raspberrypi.stackexchange.com/a/74407/74631 for alternative options (it applies to most modern generic linuces).

2
  • This only works if i login to desktop. What i want is the script to execute post auto-login, pre auto-lock session.
    – AlexL
    Dec 4, 2012 at 0:07
  • @AlexLinte: In that case you probably need to look at the options offered by your login manager: gmd, kdm, lxdm... If you use gdm then look at /etc/gdm/PostLogin/Default. Also look at /etc/X11/Xsession.d and/or /etc/X11/xinit/xinitrc.d.
    – ccpizza
    Dec 4, 2012 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .