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.

As a part of the system init script, I want to delete default launchers after blank ubuntu desktop installation using bash script. If I delete launchers from the /usr/share/applications it works, but then it deletes them for all users, while I want to delete them only for the active user. After blank install ~/.local/share/applications don't exist.

share|improve this question
3  
"but then it deletes them for all users" why does this matter? –  Rinzwind Jan 6 '13 at 18:09
    
Well, it doesn't but, it just didn't feel right. There are bunch of launchers defined there, perhaps I might need some of those in the future, including those I want to remove now, like firefox. Also, I want to use such script in corporate environments. –  majkinetor Jan 6 '13 at 19:03
add comment

1 Answer

up vote 2 down vote accepted

You shouldn't delete the desktop files in /usr/share/applications because then you also can't start them using the dash. Instead unlock them all from the launcher.

First do a backup by

gsettings get com.canonical.Unity.Launcher favorites > ~/.default_locked_launchers

Then remove them by

gsettings set com.canonical.Unity.Launcher favorites '[]'

This should unpin all applications for the current user. If you want to restore the original applications do

gsettings set com.canonical.Unity.Launcher favorites "$(cat ~/.default_locked_launchers)"

EDIT: you can do this for all users following the steps in this post.

share|improve this answer
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.