LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   running a command everytime kde starts (https://www.linuxquestions.org/questions/linux-newbie-8/running-a-command-everytime-kde-starts-184423/)

Menestrel 05-22-2004 06:01 AM

running a command everytime kde starts
 
how do I run a program everytime kde starts? (I want to autostart a network chat program everytime kde starts... )

b0uncer 05-22-2004 06:12 AM

you might want to try adding the command to the .xinitrc -file (notice the dot before the actual name; dot-xinitrc) in your home directory. if such file doesn't exist, create one; just plain text file, and add a new line to it like

exec /usr/bin/xmms

this should start xmms (if you have it) every time X starts....I don't know how this works if you have graphical login, but try it out. might work :) and you lose nothing if it doesn't...

Demonbane 05-22-2004 06:14 AM

Try writing a script to launch the program and put it in ~/.kde/Autostart

Menestrel 05-22-2004 07:11 AM

ok, thanks for the prompt replies. The strangest thing happens when I edit ~/.xinitrc, my program runs only when I shutdown KDE. I couldn't find a workaround so I used a script placed in /.kde/Autostart and it worked. But now I have another problem, I want to run that program like I'm a differnet user. So in KDE I login in as root, and I want to use that program as a regular user. How can I execute form within a script a program with a different user id ?

<edit>
I solved it by using kdesu, i put a command like kdesu -c command -u user in an executable bash script file in ~/.kde/Autostart and BANG it stared the way I wanted

</edit>


All times are GMT -5. The time now is 05:40 AM.