opening external URL's in new tabs?

kitts kitts at hotpop.com
Sat Jul 8 08:32:16 BST 2006


Hi,

How do i use this script?

What i am looking for it that when i open a link externally depending on 
which profile it belongs to, a new tab or a new window is opened. ie. all 
weblinks shall be opened in one window and all file browsing tabs in 
another window.

Thanks.

On Wednesday 19 April 2006 23:52 IST, manouchk wrote:
> I modified a little bit the script in order to be better, i.e. work when
> konqueror instance is hidden :
>
> #!/usr/bin/env python
>
> import os,sys,pylab
>
> caption="konqueror-bureau2"
> #get all konqueror instances in windows list
> f=os.popen("dcop|grep konqueror")
> windows=[]
> for l in f:
>         windows.append(l.split()[0])
> f.close()
> #get the right konqueror instance in good_konqueror variable
> good_konqueror=""
> for k in windows:
>         f=os.popen("dcop %s konqueror-mainwindow\#1 caption\(\)"%k)
>         if f.readline().count(caption):good_konqueror=k
>         f.close()
> #adjust url if missing http://
> if sys.argv[1].count("http://") or sys.argv[1].count("ftp://") or
> sys.argv[1].count("https://") :
>         url=sys.argv[1]
> else:url="http://"+sys.argv[1]
> #if the right konqueror exist :
> #        -check that it is not hidden if it is restore it
> #        -open url in a tab
> #if not open a new instance of konqueror
> if good_konqueror:
>         f=os.popen("dcop %s konqueror-mainwindow\#1
> hidden\(\)"%good_konqueror) if f.readline().split()[0].count('true'):
>                 os.system("dcop %s konqueror-mainwindow\#1
> restore\(\)"%good_konqueror) os.system("dcop %s konqueror-mainwindow\#1
> newTab
> %s"%(good_konqueror,sys.argv[1]))
> else:
>         os.system("konqueror --profile webbrowsing --caption %s
> %s&"%(caption,url))
>
> hope someone test it, just to see if it works not only here!

-- 
Cheers!
kitts

___________________________________________________
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