SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I require a particular command to run as soon as my xsession starts. I am using KDE on my Suse 10.1 box.
I am running synergy on my Suse 10.1 linux box so that i can share my mouse and keyboard between my Windows XP (synergy server) and my Suse 10.1 (synergy client) boxes.
At present to get this working, i make sure my XP machine is running with the synergy server service also running. I then boot up my Suse 10.1 machine and use the keyboard and mouse connected to that PC to log in to my KDE session. Once i am in the KDE session i open terminal and run the following command after running SU command:
# cd /usr/bin
# ./synergyc -f --daemon 161.50.17.154
This command connects the synergy client to my synergy windows xp server service and i can then put aside the keyboard and mouse connected to my linux box and use the keyboard and mouse connected to my XP machine to control both desktops.
How do i automate these commands as soon as the xsession starts. If i can get it to run as soon as the xsession login page comes up that would be totally awesome and would mean i can discard the keyboard and mouse completely on my linux box.
Please help!! If you have to spell out the exact procedure for a dummy like me i would be totally appreciative. Im sure this is such an easy thing to do but im still new to all this. Please help me remove this clutter from my desk!!
Find the directory /home/[username]/.kde/autostart/
now in this directory make a shell script. If you are using gui use kate or similar and enter the following:
now save as /home/[username]/.kde/autostart/synergyc
Next in konqueror right click on the new file created and under permissions tab check the 'is executable' box. Or from command line run:
chmod +x /home/[username]/.kde/autostart/synergyc
Hi EFiNi7
I think that if you need root privileges to launch the synergic daemon, the liaty method will not work, unless you use sudo.
But I think that using a shell script in the /etc/init.d directory is better, for at this time the script has already root privileges.
So you may create a shell script in /etc/init.d, using the 'skeleton' script as a model.
Then run YaST and go to System/Run Level Editor
you should find your script there in the list where you can enable it, and in 'expert mode' choose the runlevels you want to launch it in.
This method is a good way to learn about the boot procedure in Linux.
But it's all your choice.
I realised i dont need to be super user to run this command.
So i tried your way Berbae and this command runs but only after i log in, go into YAST and open the runlevel editor. As soon as i open the run level editor it runs. Very strange. Do you know why this happens? I tried all sorts of enabling and runlevel options with no success.
So then i tried Liaty method putting the script in .kde/autostart and this worked automatically as soon as KDE started.
However what i really need is for this script to run as soon as the username and password login page appears. At the moment i still need to use the other keyboard and mouse to enter my username and password.
Any further tips/ideas?
Maybe check out /etc/X11/kdm (if it's that similar to gdm) for any subdir named "presession" which should contain a "default" file to which you can add commands. this file will be run each time when a session (needs to | will) be started.
The problem with boot.local is that it is executed before the run level scripts. It,s worth a try, but if any services that are needed by synergyc are started in runlevel it will not work.
The problem with berbae's solution may well be a dependency one. If synergyc requires network for example, it may be executed before network is finished loading.
You could try making the synergyc pause before executing by adding:
Had a look and there is nothing along those lines for KDE
Way too terse reply.
Look for /etc/kde/kdm/Xsession. It should be linked to /etc/X11/xdm/Xsession which is run as root before a session starts, satisfying requirement wrt login screen. Adding a line to start a command as lesser privileged user should be trivial. Else switch to Gdm. At least it has a clearly labelled /etc/X11/gdm/PreSession/Default in which you can add the command.
This sounds a lot like remote login. Have you checked out NX/FreeNX? I don't know what the synergy app is - but with NX you can open a session from one computer in a window on another computer.
You could also try VNC.
Disregard this if it doesn't apply to what you are trying to do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.