Nightly icon cache update for Gnome

Sometimes it happened on my Ubuntu system, that a newly added application didn't had its icon.
This can happen due to an not updated icon cache of GTK.
This can be fixed with the command
gtk-update-icon-cache
, which rebuilds the GTK+ icon cache.

So why don't do this automatically in the background on a daily basis (during the night)?

Install instructions

Just execute the following commands, which will put a script into /etc/cron.daily so that the cache is fixed and the missing icon appears overnight.
sudo -i
echo '#!/bin/sh
#
# 

for theme in $(find /usr/share/icons -mindepth 1 -maxdepth 1 -type d)
do 
    if [ -f "$theme/index.theme" ]
    then gtk-update-icon-cache -f -q "$theme"
    fi
done

exit 0' > /etc/cron.daily/update-icon-cache
chmod a+x /etc/cron.daily/update-icon-cache

Open URL in Firefox with middle mouse button

Often I copy an URL somewhere and want to open it in a new tab in Firefox.
Normal steps:
  • Open a new tab with Ctrl-T
  • Click into the URL address bar
  • Paste the URI and press Enter
Wouldn't it be nice to make all these steps in one, f.ex. by clicking with the middle mouse button on the current tab.

Firefox has this possibility, but you can't enable it from the normal preference dialog.
Instead you have to alter the configuration parameters directly.

Install instructions

  • Navigate to about:config
  • Put middlemouse.contentLoadURL in the filter bar
  • Press the right mouse button over the option and select toggle, so it's value is true.
Now lets test it:
  • select and copy this text: www.ubuntu.com 
  • press the middle mouse button in the window where you're reading this post
  • A new browser tab should appear with the Ubuntu site.