PDA

View Full Version : [gnome] Files responsible for holding desktop shortcuts



nkarkare
June 28th, 2010, 11:16 AM
Hi
I use Ubuntu Netbook Remix (10.04) for my school labs (approx 200 clients), and wanted to remotely add or delete shortcuts on the desktop of a user. How do I do that? I found that .gtk-bookmarks has file related shortcuts, but what about the rest? As a last resort, I will have to use lsof and figure it out :-(
Thanks in advance,
Nikhil.

nothingspecial
June 28th, 2010, 02:23 PM
They are in the ~/Desktop directory in the form of a script. They are called application.desktop and take this form


#!/usr/bin/env xdg-open

[Desktop Entry]
Name=Audacity
Name[de]=Audacity
Name[ru]=Audacity
GenericName=Sound Editor
GenericName[de]=Audio-Editor
GenericName[ru]=Редактор звуковых файлов
Comment=Record and edit audio files
Comment[de]=Audio-Dateien aufnehmen und bearbeiten
Comment[ru]=Запись и редактирование звуковых файлов

Icon=audacity

Type=Application
Categories=AudioVideo;Audio;AudioVideoEditing;

Exec=audacity
StartupNotify=false
Terminal=false
MimeType=application/ogg;audio/basic;audio/mpeg;audio/x-aiff;audio/x-mp3;audio/x-wav;application/x-audacity-project;

nkarkare
July 5th, 2010, 09:43 AM
Figured it out. Just had to RTFM.
Here are the files needed to add shortcuts to desktops - in the Netbook Remix edition:
1. ~/.local/share/applications/ needs to have the .desktop files (I created mine with /usr/bin/alacarte so I had file names like alacarte-made-2.desktop)
2. ~/.config/menus/applications.menu is the file which has a reference to the desktop file.
Here is what mine looks like:


<!DOCTYPE Menu
PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
<Menu>
<Name>Applications</Name>
<MergeFile type="parent">/etc/xdg/xdg-une/menus/applications.menu</MergeFile>
<Menu>
<Name>Education</Name>
<Include>
<Filename>alacarte-made-2.desktop</Filename>
</Include>
</Menu>
</Menu>

Now, I can add whatever I want in this menu file and it will appear in that particular menu on the desktop.