Wednesday, April 24, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 4444  / 2 Years ago, tue, february 8, 2022, 6:18:47

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.


More From » 13.10

 Answers
5

.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.




  1. Check which ".desktop" files are used in your desktop :



    ls ~/Desktop


  2. Identify the ".desktop" you want to remove.


  3. 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.




  1. Get the list of launcher items:



    gsettings get com.canonical.Unity.Launcher favorites


  2. This will return something like ['nautilus-home.desktop', 'gnome-terminal.desktop', 'gedit.desktop'] which you can manipulate to remove unwanted shortcuts.


  3. 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 !


[#27655] Tuesday, February 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tisglitter

Total Points: 307
Total Questions: 103
Total Answers: 119

Location: Bosnia and Herzegovina
Member since Thu, Jun 24, 2021
3 Years ago
tisglitter questions
Sun, Jan 9, 22, 16:18, 2 Years ago
Wed, Jun 1, 22, 18:03, 2 Years ago
Fri, Dec 10, 21, 14:31, 2 Years ago
;