Τρίτη 20 Δεκεμβρίου 2011

Lubuntu Custom Application Launcher

Taken from http://linux.koolsolutions.com/2009/09/11/howto-place-programs-on-lxde-desktop/


Step 1: Create a text file
# nano README.TXT
Contents:
Hello, How are you today?
Save and exit.
Step 2: Create a corresponding .desktop file
Now we will create a corresponding .desktop file for the text file that we created in Step 1. Note that all the .desktop file will reside in the /usr/share/applications folder.
# cd /usr/share/applications/
# nano README.desktop
and type the following contents:
[Desktop Entry]
Encoding=UTF-8
Name= README
Comment= My README file
Exec=lxterminal --command "less /root/README.TXT"
Icon=/usr/share/pixmaps/readme.xpm
MimeType=text/plain
Terminal=false
Type=Application
MimeType=text/plain
Categories=Utility
Save and exit.
Let’s take a moment and understand what is going on in the above file:
Name - Give any name you want 
Comment – Your own comment
Exec – Basically we are telling which program to use to open our text file. In this case we are opening the text file with “less” command in the lxterminal window. You could have also given the following:
Exec=leafpad /root/README.TXT
Icon – I copied my own icon, readme.xpm, in the “/usr/share/pixmaps” directory. You can do the same or just use the default icons that are available in that directory.
Rest all the fields should generally remain the same.
Step 3: Create a “Desktop” directory
Now we will create a directory called “Desktop” in the user’s home directory. So for example, if the user is “root”, then we will create the directory as follow:
# cd;
# mkdir Desktop
If your user is at “/home/kushalk”, then you would create the directory as follow:
# mkdir /home/kushalk/Desktop
Step 4: Link the .desktop file with Desktop folder
This is the last piece of puzzle which will bring everything together. Now all we need to do is to link the “.desktop” file created in Step 2 inside the “Desktop” directory created in Step 3.
# cd;
# cd Desktop
# ln -s /usr/share/applications/README.desktop .
That’s it. As soon as you give the above coomand, an icon should appear on your Desktop. In case if the icon still does not appear, simply logout from LXDE and log back in.
Happy LXDE’ing!

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου