Re: opening external URL's in new tabs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!
___________________________________________________
.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux