You are here

KDE: autostart programs upon login

Submitted by Druss on Thu, 2007-05-24 12:14

The following applies only for KDE 3.x and was the original article:

KDE for all its eye candy and general slickness really sucks on some basic points. One of these is with auto-starting programs upon login. Suggestions to get this working almost always involve having the use the command-line or following a prolonged series of steps for a task which should ideally involve no more than a few clicks. Usually, most people suggest the following as a solution even to newbies:

  1. Open up Konqueror. Navigate to your home folder.
  2. Click on View. Select Show Hidden Files.
  3. Look for a folder named .kde and open it.
  4. Look for a folder named Autostart and open it.
  5. Right click inside Konqueror. Select Create New and
    Text File<code>.</li>
      <li>Give the text file the name of the program you would like to autostart.</li>
      <li>Open the file using Kate or the text editor of your choice.</li>
      <li>Type <code>#!/bin/bash
    on the first line.
  6. Type the command to launch your program along with any necessary switches.
  7. Save the file.
  8. Right click on the file, select Properties and the Permissions tab.
  9. Finally, check the is executable box and click OK to complete the process.

Are you fucking kidding me? I know that user-friendly Linux is still something of an oxymoron. However, this is really pushing it. Convinced that there had to be a better solution, I decided to google some more and eventually found that the recommended procedure is actually the following:

  1. Open up Konqueror. Navigate to your home folder.
  2. Click on View. Select Show Hidden Files.
  4. Look for a folder named Autostart and open it.
  5. Click on the K Menu icon and navigate to the program that you would like to auto-start.
  6. Drag the icon for said program into the Konqueror window and select Copy Here when prompted.

And that's it! No text editors. No jargon. No code. If you bookmark the Autostart folder, then it becomes an even easier process very similar to that in Windoze. That said, the whole idea of placing the Autostart folder inside a hidden folder smacks of idiocy.

A commenter - Mike - has suggested that installing kcontrol-autostart is the way to go and this is indeed the case. While it might not support drag and drop or provide short-cuts to easily add programs to the autostart list, it is still simple and intuitive enough to be very useful.

To install it, either type sudo apt-get install kcontrol-autostart in a terminal or search for the term autostart in your package manager of choice. It looks like it might be a recent addition as it is only at version 0.1.

Once you've installed it, the next hurdle is to find it :S The autostart component is a part of the KDE control centre - KControl - which is apparently not good enough for Kubuntu, as it is not accessible via K Menu. To run KControl and thereby access autostart:

  1. Click on the K Menu icon and select run.
  2. Type kcontrol and click OK to launch it.
  3. In the navigation pane on the left, select KDE components and choose Autostart Applications.

To make things easier, you might want to create a desktop / K Menu short-cut to kcontrol.


While I do agree with your final point on where the Autostart folder is located, I have to admit I've never seen that 12-step process you mentioned recommended anywhere (although I have used it myself at times, and it is a method worth knowing if you want applications to start in a certain order).

One easy way to get around this, if you're on a Debian-based system (e.g., Ubuntu), is to run this command:
$ sudo apt-get install kcontrol-autostart
That will install a handy module for adding autostart applications from within KControl.

Lastly, the first four steps in the second method mentioned can be reduced to one step: Press Alt+F2 (or click Run Command from KMenu), type "konqueror ~/.kde/Autostart" and press Enter.

kcontrol-autostart: This is excellent advice - thanks! I've also updated the post with this information.

12-step process: Actually, this is what I've seen most people recommend in the help channels on IRC (freenode).

No need to go through this procedure in KDE4.

Open the system settings option from inside K -> Computer, then choose "startup and shutdown" underneath the system administration heading. Click the autostart option on the left column, then click the "Add program" button. It will give you the traditional KDE3 style tree menu from which to choose a program to start when KDE loads.

For the CLI user amongst us, this creates a .desktop file in ~/.config/autostart/ called with some options you may or may not need to edit.

echo "/usr/bin/myprogram" > ~/.kde/Autostart/myprogram
chmod +x ~/.kde/Autostart/myprogram

Was that so "effing" hard? Actually the process is exactly the same as MS windows In both you can use an executable text file or a link, or even a binary though it's silly, using a browser or a command prompt. The only difference being that the kde folder isn't linked from the system-settings, which it probably should be. You don't need to show hidden files to type the directory in the path bar either.

for presenting these two alternatives!
Being bound to the command line, the first explanation did the trick.