Show/Hide Desktop Icon On Ubuntu
I like things on my laptop to be simple and easily accessible. From time to time, I download stuffs. Some tutorial files, new products to test, deb updates, and several other random stuffs. Most of the time, I just throws this trashes to my desktop to make me easily remember that I have this particular stuff to work with. The other stuffs I throw to my desktop is, ebooks. Most of it is references and cheat-sheet.
As time goes by, my desktop look messed up with several files there grouped together in some corner, directories in another corner, and some other random stuffs in another corner. It came to a point where I need this Hide Desktop Icon’s that Microsoft Windows has. It’s weird that gnome doesn’t have it built in. Several blog mentioned how to hide desktop using gconf-editor. Good, there’s a key in gnome’s registry to show/hide desktop icon. But, I don’t want to do it this way. It’s just too troublesome to walk through the path in order to change the key’s value.
I need another solution. Because I can’t find that particular solution that I needed, that means either I have to stop looking and use this tedious solution or write my own solution. And this is the fun part! Living in the free world IS fun and having total freedom to your desktop is FUN too. So, without further ado, here’s the solution I made.
- open up your favorite text editor
- Enter this snippet:
#!/bin/bash current_status=`gconftool-2 --get /apps/nautilus/preferences/show_desktop` echo "Current Status: " $current_status; if $current_status; then echo "Disabling desktop icon..."; gconftool-2 --type boolean --set /apps/nautilus/preferences/show_desktop false; else echo "Activating desktop icon..."; gconftool-2 --type boolean --set /apps/nautilus/preferences/show_desktop true; fi;
- Save it to your
/home/{your_user_name}/bin/switch_desktop_icon - Load up your terminal and type:
chmod 700 /home/{your_user_name}/bin/switch_desktop_iconto make this script as executable
- Right click on your panel (the one where Applications || Places || System menu resides) and click on Add to Panel…
- In Add to Panel…’s window, select Custom Application Launcher and click Add
- In Create Launcher window enter the Name with Show/Hide Desktop Icon(s). The Command with /home/{your_user_name}/bin/switch_desktop_icon. Choose the icon you like, then click on OK
- That’s it. Now, we have an easy to access show/hide desktop icon’s command.





