Show / Hide Desktop Shortcuts in Ubuntu via Context Menu

August 27, 2014 — 1 Comment

hide or show desktop shortcuts in Ubuntu

Want an option in your desktop’s context menu (right-click menu) that hides or un-hides all your desktop shortcuts in Ubuntu Unity or Gnome?

Ramvignesh, the guy sent me two simple scripts with this great idea. If you are interested, below will show you how to do it step by step.

1. How to Create Desktop Shortcuts in Ubuntu 14.04

Due to bug, you can’t drag and drop an application shortcut icon from Unity Dash result to desktop in Ubuntu 14.04 LTS.

But it’s still easy to create a desktop shortcut, all you need to do is:

  1. Open your file browser, navigate to Computer (from left sidebar)-> user -> share -> applications.
  2. Right click on a shortcut icon and select ‘Copy’
  3. Right-click on blank area of your desktop and select ‘Paste’

Create Desktop Shortcuts Ubuntu

Finally you’re able to click the desktop shortcut to launch the application without worrying about user permission issue.

2. Create the scripts to show/hide desktop shortcuts

Thanks to Ramvignesh for the simple scripts.

  • Create a new folder called bin in user’s Home folder.
  • Go into bin folder and create 2 empty documents: show-desktop-shortcuts, hide-desktop-shortcuts
  • Edit 2 documents one by one and paste below contents into them. IMPORTANT: Replace handbook in red with your user name.
    • for show-desktop-shortcuts file:
      cd /home/handbook/Desktop
      for f in .* ; do 
      new=`echo "$f" | cut -c 2-`
      mv "$f" "$new"
    • for hide-desktop-shortcuts file:
      cd /home/handbook/Desktop
      for f in * ; do
      mv "$f" ".${f#.}"
  • show-hide-desktop-shortcuts2

    Finally make the 2 scripts executable by going to their context menu (right-click menu) -> Properties -> Permissions tab -> check the box where it says 'Allow executing file as program'.


    3. Add The 2 Scripts As Options Into Desktop's Context Menu

    Click the button below to bring up Ubuntu Software Center and install nautilus-actions, a graphical tool for configuring Nautilus' context menu.

    Click install nautilus-actions

    Now open nautilus-actions from Launcher and do:

    1. Create 2 new actions in Items list, name them to Show Desktop Shortcuts & Hide Desktop Shortcuts
    2. Under Action tab of both items, check the box says "Display item in location context menu"
    3. Type a name in Context label


    4. Under Command tab of both items, type in (browser) path to the two scripts in Path box.
    5. (Optional) Go the menu Edit -> Preferences, in first tab un-check the two boxes under Nautilus menu layout.

    Finally, your desktop's context menu will look like below after reboot.



    I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to

    One response to Show / Hide Desktop Shortcuts in Ubuntu via Context Menu

    1. I’ve gone back over everything twice. It isn’t working for me. I’m in Ubuntu 16.04.

    Leave a Reply


    Text formatting is available via select HTML.

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>