OK, I have the solution using DCOPserver, what I need is help creating a script that will execute each time the user tries a log in to a session this is what I have.
From a KDE standpoint, you can look at a few things with dcop.
If more than one user is logged into KDE, you could see it via the
dcop --list-sessions --user user
Active sessions for user /home/user :
In the above case, you can see that I have 2 users logged into KDE.
If I want the first session for the user logged out, I can run
dcop --user user --session .DCOPserver_x345-2__1 ksmserver default lo
gout 0 0 -1
Now, if I put this in a script inside /home/user/.kde/Autostart/
and make it excutible, and if there are more than one sessions for the
user, I call the above command to force the logout of the __2 session
This check is performed at every login of the user and when a second
login is performed, the user is prevented to do so, what I need is help with a basic script that could run dcop --list-sessions --user user then if more then one exists I want to kill the running session, the reason I need to do this is that the application running on auto log in uses javaPOS and multiple sessions causes issues with the peripherals.
I need help with syntax I woul like to do the following
if a session exists kill it before starting a new one. with the command (dcop --list-sessions --user pos) and this command would kill it (dcop --user user --session .DCOPserver_x345-2__1 ksmserver default lo
gout 0 0 -1 ) i do need to insert the hostname where X345 is, how would that work dont know.
scripting is not something I do so I would like any impute please (perhaps a bash scripting course would be ideal)
I would get a return with a session, if no return with command continue.