Ubuntu – Shortcut to hide the desktop icons in GNOME 3

desktop-iconsgnome-shelliconsshortcut-keys

I can hide/show the desktop icons using gnome-tweaks (see the picture, "Afficher les icĂ´nes" means "Display Icons").

Gnome-Tweak

I would like to know how to set up a shortcut doing that ? I use GNOME in Ubuntu 18.04.

There is a shortcut to hide all windows (Windows-key + D), so why not one for hiding/showing the desktop icons.

Best Answer

I wrote a small script, which changes this option:

#!/bin/sh
if $(gsettings get org.gnome.desktop.background show-desktop-icons);
then new="false";
else new="true";
fi
gsettings set org.gnome.desktop.background show-desktop-icons $new

You can save the script /somewhere/as/somewaht.sh (with permission to execute) and then add in your keyboardsettings an entry: Keyboardsettings