How do I remove desktop icons from the terminal?
It may seem easier to do it with the mouse but it is not practical for my needs, so I'm looking for a way to do it via the terminal.
How do I remove desktop icons from the terminal?
It may seem easier to do it with the mouse but it is not practical for my needs, so I'm looking for a way to do it via the terminal.
.desktop files : a shortcut.desktop file is a text-file placed in the Desktop directory (~/Desktop) that is used to provide clickable shortcuts on the Desktop.
Check which ".desktop" files are used in your desktop :
ls ~/Desktop
Identify the ".desktop" you want to remove.
Remove the ".desktop" file you want to remove (replace nameofthefile by the name of the file, ending with .desktop):
rm ~/Desktop/nameofthefile.desktop
D-conf keys : it's a key stored in d-conf that is used to provide clickable shortcuts on the Unity Launcher bar.
Get the list of launcher items:
gsettings get com.canonical.Unity.Launcher favorites
This will return something like ['nautilus-home.desktop', 'gnome-terminal.desktop', 'gedit.desktop']
which you can manipulate to remove unwanted shortcuts.
Set the launcher item list with only the launcher you want, example:
gsettings set com.canonical.Unity.Launcher favorites "['nautilus-home.desktop']"
Don't forget the quotes !
The easiest was would be to use the dconf-editor
and remove the unwanted apps from the desktop->unity->launcher->favorites section.