5

I tried really hard to avoid posting a new question for something so basic and already answered in a hundred places, but after spending two hours on this and trying every solution out there I'm thinking they're either outdated or don't apply to the current version of Fedora.

What I tried (among other things):

  • gnome-session-properties (doesn't exist anymore)
  • gnome-tweak-tool (can only add existing applications to startup, ie: can't add custom commands)
  • my working .sh script in ~/.config/autostart (chmodded executable)
  • .desktop file in ~/.config/autostart
  • script in rc.local (this appears to be ignored now)
  • script in /etc/init.d(chmodded executable with sudo)

The above all fail to run my script on start up.

The script I'm trying to run:

#!/bin/sh
xcompmgr

Or even simply this command:

xcompmgr

My exact setup:

Fedora 22
Kernel 4.0.4
Gnome shell 3.16.2
Awesome WM 3.5.6

What is the simplest, up-to-date way of running a command or script on start up on my setup?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Juicy
  • 3,875
  • If you want to do it on user log on: https://unix.stackexchange.com/questions/122424/execute-a-command-on-user-logon – Nobody Sep 16 '16 at 15:23

2 Answers2

5

I had the same problem. It seems that the key to really enable it is Version=1.0 that I can bet you missed. You can also disable autostart item or delay it's start by adding:

X-GNOME-Autostart-enabled=false
X-GNOME-Autostart-Delay=2

You can also use great example with:

ln -s /usr/share/applications/pidgin.desktop ~/.config/autostart/pidgin.desktop

Full example, that should work:

[Desktop Entry]
Version=1.0
Name=xcompmgr
GenericName=xcompmgr
Comment=xcompmgr
Exec=/path/to/xcompmgr
Terminal=true
Type=Application
X-Desktop-File-Install-Version=0.22
0

This works for me on Fedora 22 (GNOME Shell 3.16.2 / Kernel 4.0.4-303.fc22.x86_64): ~/.config/autostart/conky.desktop

[Desktop Entry]
Version=1.0
Name=conky
GenericName=Conky
GenericName[hu]=Conky
Comment=Rendszeradatok
Comment[hu]=Rendszeradatok
Exec=/usr/bin/conky
Terminal=false
Type=Application
bela
  • 1