Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I followed the instructions here to modify my quicklists of Unity. For examples in order to add an "Root Terminal" item I modified my gnome-terminal.desktop as follows:

[Desktop Entry]
Name=Terminal
Comment=Use the command line
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=utilities-terminal
Type=Application
X-GNOME-DocPath=gnome-terminal/index.html
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-terminal
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=2.32.1
Categories=GNOME;GTK;Utility;TerminalEmulator;
StartupNotify=true
OnlyShowIn=GNOME;Unity;
X-Ubuntu-Gettext-Domain=gnome-terminal

X-Ayatana-Desktop-Shortcuts=Root;
[Root Shortcut Group]
Name=Root Terminal
Exec=gksudo gnome-terminal
TargetEnvironment=Unity

And then I dragged it to the launcher. It worked fine before rebooting. But after the system is restarted, the Terminal button launcher is reverted (No Root Terminal after right click), despite of the desktop file has been modified.

So what steps do I miss? Thanks for those who gives hints.

share|improve this question
1  
Did you copy the .desktop file over to ~/.local/share/applications before editing? Is it still there after the reboot? Did you check ~./.xsession-errors for errors related to this? –  Rinzwind Aug 28 '11 at 14:43
    
Oh, I edited the file in place (/usr/share/applications). It seems I have some misunderstanding about the mechanism. –  ziyuang Aug 28 '11 at 15:24
    
ah time for an answer >:) –  Rinzwind Aug 28 '11 at 15:25
add comment

1 Answer

up vote 2 down vote accepted

First step is to copy the .desktop file over to ~/.local/share/applications and to edit that version. ~/.local/share/applications overrules the .desktop from /usr/share/applications.

The ones in /usr/share/applications get recreated probably to prevent malformed desktop files to crash Unity: in case of a crash it can fallback to the unchanged version.

share|improve this answer
    
Thank you @Rinzwind, it works great but I have another question. If I copy the file to ~/.local/share/applications, a new item will be created on the launcher. However when I open something and select "Keep in Launcher", the .desktop file does not appear in the folder. So where this information is stored? –  ziyuang Aug 28 '11 at 21:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.