Skip to content

Instantly share code, notes, and snippets.

@blooalien
Created September 7, 2012 18:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blooalien/3668395 to your computer and use it in GitHub Desktop.
Save blooalien/3668395 to your computer and use it in GitHub Desktop.
Use 'kde-open' to load those pesky Windows .url files in your default web browser.

urlopen.py

A simple python script for KDE users which will use 'kde-open' to open those pesky Windows .url files in your default web browser.

License

Public Domain - This script is entirely too simple for me to care how it's used. Just enjoy it...

Reason

While Wine's rundll32 appears to do pretty much the same thing, it takes an unreasonably long time to launch on my system for some odd reason.

Installation

Place this script somewhere on your system path, mark it as executable, and set it as the default app to launch .url files.

#!/usr/bin/env python
'''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use 'kde-open' to load those pesky Windows .url files in your default web browser.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author: Bavarin Fleetfoot
License: Public Domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
if __name__ == '__main__':
import sys
import ConfigParser
from subprocess import call
urlfile = sys.argv[1]
parser = ConfigParser.SafeConfigParser()
parser.read(urlfile)
sys.exit(call(['kde-open', parser.get('InternetShortcut', 'URL')]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment