I fixed this using this Python code :
Code: Select all
#!/usr/bin/env python
import sys
import os
import commands
search_txt = ""
#make search text with all arguments passed
for i in range(1,len(sys.argv)):
search_txt += sys.argv[i]
if(i!=len(sys.argv)-1):
search_txt += "_" #this is for merging words with a "_", you can change this depending on query string (Google would have "+" for example)
releaseID = commands.getoutput("cat /etc/linuxmint/version/mintinstall/release.id")
if os.path.exists("/usr/bin/gconftool-2"):
browser = commands.getoutput("gconftool-2 --get /desktop/gnome/url-handlers/http/command")
else:
browser = "firefox %s"
link = "http://www.linuxmint.com/software/?sec=search&search=" + search_txt + "&release=" + str.strip(releaseID)
browser = browser.replace("\"%s\"", link)
browser = browser.replace("%s", link)
os.system("/usr/lib/linuxmint/mintInstall/launch_browser.sh \"" + browser + "\" &")