opening external URL's in new tabs?

manouchk manouchk at gmail.com
Wed Apr 19 14:23:20 BST 2006


to avoid using temporary file, I modified the script to use pipe it's a 
cleaner code and also a shorter one!

[code=python]
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os,sys,pylab

f=os.popen("dcop")
windows=[]
for l in f:
	if l.count("konqueror-"):windows.append(l.split()[0])
f.close()
good_konqueror=""
for k in windows:
	f=os.popen("dcop %s konqueror-mainwindow\#1 caption\(\)"%k)
	for l in f:
		if l.split()[-1].count("bureau2"):
			good_konqueror=k
	f.close()
if sys.argv[1].count("http://"):
	url=sys.argv[1]
else:url="http://"+sys.argv[1]
if good_konqueror:os.system("dcop %s konqueror-mainwindow\#1 newTab 
%s"%(good_konqueror,sys.argv[1]))
else:
	os.system("konqueror --profile webbrowsing --caption konqueror-bureau2 
%s&"%url)
[/code]

hope it would help somebody out there, searching on the web answer to that 
problem, I've seen may peoples willing to do this kind of stuff with 
konqueror, never encountered any answer!
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list