6

I searched and found out that I can make an application start while the system boots by using Startup Applications from the dash. But if I want to write a .desktop file, in which directory should I save the file and also what should be the contents of the .desktop file?

I found this code snippet from here

[Desktop Entry]
Type=Application
Name=<Name of application as displayed>
Exec=<command to execute>
Icon=<full path to icon>
Comment=<optinal comments>
X-GNOME-Autostart-enabled=true

If this is valid and works then what should I write in the Exec? The name of my application is Albert, which does the searching in the file system like you can search in dash. So writing Albert in the Exec is valid?

sphoenix
  • 961
  • You'll have to write the full path to your programme, Exec=~/Desktop/path/to/Albert won't work, you'll have to write Exec=/home/USER_NAME/Desktop/path/to/Albert and so. – pomsky Oct 10 '17 at 16:11
  • albert is in usr/bin/albert. So according to you, Exec=/home/username/usr/bin/albert I should write this? And also rest of the codes I've posted are ok? – sphoenix Oct 10 '17 at 16:16
  • Exec=/usr/bin/albert is what you need. – ravery Oct 10 '17 at 16:19
  • And is there any specific directory where should I save the .desktop file? – sphoenix Oct 10 '17 at 16:20

2 Answers2

9

What I did is, I created a file named albert.desktop in the /home/<user_name>/.config/autostartthen I used the code snippet from below:

[Desktop Entry]
Type=Application
Name=Albert
Exec=/usr/bin/albert
Icon=/home/<user_name>/Pictures/albert
Comment=Albert is an application that searches the file system like dash on ubuntu
X-GNOME-Autostart-enabled=true

And everything worked just fine!

sphoenix
  • 961
0

the following code works fine for me, startup the terminator terminal as soon as I logged in

[Desktop Entry]
Type=Application
Name=Terminator startup
Exec=/usr/bin/terminator
Icon=terminator
#X-GNOME-Autostart-enabled=true #this can be commented and even works