LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-10-2006, 10:00 AM   #1
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Rep: Reputation: 30
Autostart in KDE. How is it done?


Hello

I'd like to run automatically at startup two programs.
irxevent and irexec. I use KDE version 3.4.1. I'd like to use KDE Autostart for it. What should I do to run these programs with KDE?.
Or maybe there is some other way, independent of window managers?.
My distro is Aurox 11.0, it's based on Fedora Core 3.

Cheers
 
Old 05-10-2006, 10:28 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009
Assuming you only need to run them in userspace, then it's simple. Just put/create a shortcut link to the programs in .kde/Autostart. It's analogous to the Startup Menu item in Windows in this way.

If you want something independent of a window manager, you should probably put a line in your .xsession or a related file. There are lots of pages on the web explaining it if you want to know how to do that.
 
Old 05-10-2006, 11:14 AM   #3
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
I tried it. I added to /home/mac/.kde/Autostart/Autorun.desktop following lines (last lines of this file):
Exec=/home/mac/lirc-0.8.0/tools/irxevent
Exec=/home/mac/lirc-0.8.0/tools/irexec

But it's not working. Why?.

Is there no graphical interface or something like it is in Windows?. Something like Autostart folder and it's enough to drag'n'drop exec file to it to get it done?.
 
Old 05-10-2006, 11:19 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 76
Are you using the right syntax? As far as I know, entries in ~/.kde/Autostart should be something like
Code:
[Desktop Entry]
Exec=/path/to/some/app
Name=SomeApp
Type=Application
X-KDE-StartupNotify=false
The file would be saved as SomeApp.desktop.
 
Old 05-10-2006, 12:59 PM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009
Open the location up in Konqueror (the official integrated KDE file browser/web browser) and you can right click to get "create new->link to application", which you can then use to create your shortcut. You also get the same menu when you click on the desktop, so you could also create the link there and then move or copy it into the Autostart folder. You can even d&d a link directly from your K menu. As you can see, there are quite a few options available.

And just to be clear, you want to create a separate link, not modify an existing file. As redazz pointed out, the format should be that of a KDE application link, with the syntax he spelled out.

the Exec commands you tried, OTOH, are what you'd use in .xsession, I believe.
 
Old 05-10-2006, 02:20 PM   #6
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
OK, I've got it. My mistake was that I edited Autorun.desktop, file which shows contents of CD-Rom at startup. I created another desktop file (or rather two files - Irexec.desktop and Irxevent.desktop) and
irxevent is working fine but there is still problem with irexec. It works only when I run it from the console. When I create shortcut in desktop it fails even if I turn on "run in terminal" option. The same is with creating Irexec.desktop in Autostart folder. It doesn't run this irexec automatically. Generally speaking are there programs that can be run only from the console and programs that can be run at start up?. It seems to me that there is such difference between irexec and irxevent.

Last edited by mac1234mac; 05-10-2006 at 02:26 PM.
 
Old 05-10-2006, 11:12 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009
I really couldn't tell you. But I have experienced situations where something would run from a console, but not from a shortcut, and I have no idea why it wouldn't work. Maybe there's something about the way KDE launches applications that causes problems in some rare situations.

You might try this though. I didn't know if it would work when I made my last post, but I've just experimented, and I found that Autostart will also run scripts and symlinks to exectuables in addition to KDE shortcuts (I guess it just tries to run whatever it finds in there). So try creating a symlink directly to /home/mac/lirc-0.8.0/tools/irexec and see if it will run then. If that doesn't work, you can also try launching it through a simple bash script (don't forget to chmod u+x it):
Code:
#! /bin/bash

/home/mac/lirc-0.8.0/tools/irexec
Hopefully one of these ways will work for you.
 
Old 05-11-2006, 08:58 AM   #8
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
Quote:
So try creating a symlink directly to /home/mac/lirc-0.8.0/tools/irexec and see if it will run then.
You mean I should create symlink and put it in Autostart, or in the entry of Autostart .desktop file?.

Quote:
If that doesn't work, you can also try launching it through a simple bash script (don't forget to chmod u+x it):
Running such script from Autostart is different from running irexec itself?.
 
Old 05-11-2006, 11:11 AM   #9
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009Reputation: 2009
Yes, I mean simply create the link in the Autostart folder. Autostart will try to run whatever's in it.

And while I don't know exactly how Autostart runs it's programs, I don't think it goes through a shell (I believe it uses kdeinit). The script does use bash, however, and therefore it should launch the program exactly as if you ran it in a bash shell. So it might be more likely to work, considering your situation.

And while it may not be important here, a script of some kind is the only way you would be able run a program that had options or arguments, since you can't very well add flags to a symlink. :P
 
Old 05-11-2006, 12:11 PM   #10
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
OK, it helped very much. Now I can run tvtime and then change channels from my remote. Great fun!!!.
Thanks very much
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kde Autostart questions aldar Slackware 1 12-15-2005 03:10 PM
SUSE 9.3 KDE autostart ionmich SUSE / openSUSE 1 10-17-2005 07:28 AM
autostart kde ZaphyR Linux - Software 8 12-15-2004 04:52 AM
KDE Autostart Shafted Linux - Software 2 12-01-2004 08:14 PM
Kde 2 Autostart folder rfc1700 Linux - General 1 03-12-2001 08:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration