I was reading a post on Lifehacker about hiding/showing your Desktop icons in Mac OSX using a script and though: "hey, I bet this can be done easier in Linux". And so it is: EnLi has created a very small script that does just that: it can toggle your desktop icons on/off using a click for a distraction-free desktop.
You can either use it as a Nautilus script or assign it a keyboard shortcut.
a) To use it as a Nautilus script, copy/paste the following commands in a terminal window:
cd ~/.gnome2/nautilus-scripts
wget http://enli.co.cc/files/Scripts/Toggle-Desktop.sh
chmod +x Toggle-Desktop.sh
Then simply right click in Nautilus and select Scripts > Toggle-Desktop. Please note that when you turn off the icons on the desktop, you can't right click the desktop so you'll have to open a Nautilus window to be able to run the script.
b) To assign a keyboard shortcut to the script:
Download the script and place it anywhere you want, then make it executable:
chmod +x /path/to/Toggle-Desktop.sh
Then assing a keyboard shortcut: under System > Preferences > Keyboard Shortcuts, click "Add", enter a name for your custom keyboard shortcut and under "Command", enter the full path to where you've saved the script. And finally, assign a new keyboard shortcut for the newly created action.
Credits for the script: EnLi`s Blog