Where are startup commands stored?

50,000

Solution 1

As per the Desktop Application Autostart Specification, which Ubuntu and all major desktop environments like Gnome, LXDE, XFCE follow, the Startup Applications are .desktop files stored per-user in

~/.config/autostart

And also globally, for all users, in

/etc/xdg/autostart

(this is a simplification, the real directories are determined by XDG Base Directory Specification)

The enable/disable feature is provided by this attribute in each .desktop file:

X-GNOME-Autostart-enabled=true (or false)

If a user toggles enable/disable status of a given application (without deleting it) that was in the system folder, it is copied to the user directory and then the attribute X-GNOME-Autostart-enabled is changed. If a user deletes a given application from the list, the .desktop is copied to user folder with the Hidden=true attribute (or the file is simply deleted if it was present just in the user directory)

Files in both user and system folder does not need to be marked as executable. Default permission is 644 (rw-r--r--). Executable permission for .desktop files are only useful for launchers in your desktop area (the workspace), so they show their icon and allow double-click to start the application. For Dash, Launcher, Autostart and menus in general the executable bit is irrelevant.

Solution 2

I use xfce and what I have found is most of system related autostart commands such as

power-managers, gnome-keyring, ubuntuone, blueman etc

are stored in /etc/xdg/autostart while most of user specific autostart are located at

$HOME/.config/autostart You may have a look at those 2 places.

To disable something to autostart, set Hidden=false under [Desktop Entry] section in the respective file under $HOME. You may have to create the file.

Solution 3

In KDE it's in

~/.kde/Autostart

This has been depreciated, KDE Plasma now follows the XDG spec. System wide startup dir is found in /etc/xdg/autostart and user specific ones in ~/.config/autostart

I have a script there which starts Krusader:

 #!/bin/bash
 krusader &

Don't forget to make the scripts You'll put in Autostart - to be executable.

Share:
50,000

Related videos on Youtube

user1036005
Author by

user1036005

Machine Learning Engineer

Updated on September 18, 2022

Comments

  • user1036005
    user1036005 over 1 year

    When you go to "Startup Applications", you see a list of commands that are executed at startup and you can add your own.

    I would like to know where this list is stored. Is it in gconf somewhere?

    There are two reasons I want to know this:

    • add commands programmatically
    • disable some commands (in Oneiric, the default ones are not shown anymore)
  • ctd
    ctd over 12 years
    Thanks, this was helpful. The same paths also work for Kubuntu.
  • MestreLion
    MestreLion over 11 years
    @ctd: (most of) it should work in other desktops as well, like XFCE and LXDE, since this is a standard made by FreeDesktop.org and aimed at cross-desktop compatibility.
  • MestreLion
    MestreLion almost 11 years
    KDE used to have its own autostart directories, but nowadays they follow the XDG spec. Maybe ~/.kde/Autostart still works too, but for cross-compability it's better to use the XDG dirs
  • Pavak Paul
    Pavak Paul about 10 years
    /etc/xdg/autostart are for system and will work for all users
  • nhorning
    nhorning over 6 years
    Awesome! This means one could use the startup applications to mount encrypted veracypt containers, and the command including the key would be safe in the user's encrypted home directory. They would just have to use visudo to allow root permissions to veracrypt without password for that user.
  • artu-hnrq
    artu-hnrq over 4 years
    Well, I've searched and tried a lot of alternatives, but just desktop file on /etc/xdg/autostart worked for me at Bionic Beaver (18.04). Thanks!
  • MestreLion
    MestreLion over 4 years
    @ArthurHenriqueDellaFraga, I've just tested, and ~/.config/autostart is still valid for Ubuntu 18.04. Try to add any launcher using Startup Applications (search it in your applications), and it will create a .desktop file there
  • artu-hnrq
    artu-hnrq over 4 years
    18.04 minimal installation didn't come with ~/.config/autostart directory, furthermore I want it for all users. But thanks anyway, it was helpful!
  • jarno
    jarno almost 4 years
    X-GNOME-Autostart-enabled seems to be Gnome specific.
  • jarno
    jarno almost 4 years
    For some reason the disabling trick did not work for xfce4-screensaver in 20.04, though :(
  • jarno
    jarno almost 4 years
    bug report for the above issue.
  • MestreLion
    MestreLion almost 4 years
    @jarno: It is, but other DEs have their equivalents. MATE, for example, has X-MATE-Autostart-enabled