Open MS .URL shortcuts on Ubuntu


1 min read

We need to create a wrapper script and associate the file type with it.

$ sudo vi /usr/bin/open-url.sh

#!/bin/sh
# opens Windows .URL files in your default browser
# requires: xdg-open sed grep xargs
sed 's/^BASEURL=/URL=/' "$1" | grep -m 1 '^URL=' | sed 's/^URL=//' | sed 's/\r//' | xargs xdg-open
$ sudo chmod +x /usr/bin/open-url.sh

Now we can associate .URL files with the script. This might be the hard
part.

$ cp /usr/share/applications/chromium-browser.desktop ~/.local/share/applications/open-url.desktop

Change first Exec command to point to our script

Exec=/usr/bin/open-url.sh %U

Associate mime-type:

Find name of mime-type by quering a example .url file

$ xdg-mime query filetype ~/Desktop/p/PHP-\ uniqid\ -\ Manual.url application/x-mswinurl
$ xdg-mime default open-url.desktop application/x-mswinurl

Related Articles

GitHub MFA on Ubuntu CLI
1 min read

Using cadaver to download files from webDAV

My Ubuntu installation refuses to mount a particular webdave share. Using a share and GUI browser is for Windows users

1 min read

Ubuntu YouTube Player

Was looking for a tool to backup some movies from YouTube to local disk. Found Minitube, it appears to be

1 min read

Install Silverlight on Ubuntu 14.04

Ok, sometimes you can't go around a Microsoft product because a crappy site is written in Silverlight and you can't

1 min read

Install Flash player inside Chromium on Ubuntu 14.04

Chromium on Ubuntu 14.04 doesn't use Netscape plugin API anymore, it simply not there. The Chrome browser has support

1 min read

GO TOP