Skip to content

Instantly share code, notes, and snippets.

@Jonty
Created November 19, 2010 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jonty/706835 to your computer and use it in GitHub Desktop.
Save Jonty/706835 to your computer and use it in GitHub Desktop.
An xkcd://318 URL handler (For Linux)
#!/bin/sh
# An xkcd://318 URL handler, for linux types.
echo -n "#!/bin/sh\nexec xdg-open \`echo \"\$@\" | sed -e 's/xkcd:\//http:\/\/xkcd.com/'\`" > $HOME/.xkcdhandler
chmod +x $HOME/.xkcdhandler
gconftool-2 -t string -s /desktop/gnome/url-handlers/xkcd/command "$HOME/.xkcdhandler %s"
gconftool-2 -t bool -s /desktop/gnome/url-handlers/xkcd/needs_terminal false
gconftool-2 -t bool -s /desktop/gnome/url-handlers/xkcd/enabled true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment