[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-debian
Subject:    Re: ioslaves with *any* linux apps -> it works :-))
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2004-01-09 18:49:34
Message-ID: 200401091949.34747.neundorf () kde ! org
[Download RAW message or body]

On Thursday 08 January 2004 23:30, Alexander Neundorf wrote:
> On Thursday 08 January 2004 23:19, Kurt Pfeifle wrote:
...
> > > http://www.neundorf.net/pics/swriter_with_fuse-kio-gateway.png
> >
> > Awesome!
> >
> > (May I ask for a "blue" KDE Corp. Ident. background-shot which is
> > fit for public cosumption and makes it more recognizeable as a
> > KDE stuff thingie?   ;-)

Is this KDEish enough ?

http://www.neundorf.net/pics/swriter_gimp_fuse-kio-gateway.png

(it's 700 kb big, maybe somebody could mirror it somewhere).

What you see in the picture:

konqy showing fish://alex@marathon/home/htdocs/

via "Open with" and the attached desktop file I opened olaf190.jpg with gimp 
and main.html using OOo swriter :-))

This can be verified by the output of ps -ax|grep gateway in the konsole on 
the upper right corner. You see the fuse_kio gateway process, and the gimp 
and swriter processes accessing files located under the mountpoint given to 
fuse_kio :-)

In the lower right corner you can see the debug output of the running 
fuse_kio.

How to do it ?

Install the attached desktop files. They feature a modified Exec entry

Exec=ioslave_helper gimp ]placeholder ]url %u

The ioslave_helper script checks if there is an url given after "]url". If 
yes, it modifies the url so that it points to a local file accessible via 
fuse_kio. If it is already a local path it doesn't change it. It then puts 
the modified url at the position "]placeholder" and then starts the app 
(first parameter).

ioslave_helper is a ruby script. Maybe somebody wants to translate it to perl 
or shell ?

It relies on the fact, that the environment variable 
FUSE_KIO_GATEWAY_MOUNTPOINT is set correctly. Set it e.g. in startkde or 
before you start kde, and then start fuse_kio once kde is running:

export FUSE_KIO_GATEWAY_MOUNTPOINT=/your/mountpoint
...
startkde
...
fuse_kio --gateway $FUSE_KIO_GATEWAY_MOUNTPOINT

And then open your favorite remote files from konqy with "Gimp fuse" and "OOo 
writer fuse" :-)

The script is also in kdenonbeta/fuse_kio/ioslave_helper

Bye
Alex
-- 
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org                - http://www.kde.org
      alex@neundorf.net               - http://www.neundorf.net

["gimpx.desktop" (application/x-desktop)]
["writerx.desktop" (application/x-desktop)]
["ioslave_helper" (text/plain)]

#!/usr/bin/ruby

#use this script as a wrapper for starting non KDE-apps
# e.g. ioslave_helper fish://you@somehost/home/htdocs/pic.png gimp §u
# this script will change the url so that it results in a correct local
# file path for usage with the fuse - ioslave gateway
# the §u will be replaced with the resulting url
# you should "mount" the fuse ioslave gateway when starting kde, e.g. via Autostart
# set the environment variable FUSE_KIO_GATEWAY_MOUNTPOINT
# to the path where the gateway is mounted
# mounting works like this: fuse_kio --gateway $FUSE_KIO_GATEWAY_MOUNTPOINT

app=ARGV[0]

placeHolderPos=-1
urlPos=-1

count=0
for nextParam in ARGV
   if nextParam=="]placeholder"
      placeHolderPos=count
   elsif nextParam=="]url"
      urlPos=count+1
   end
   count+=1
end

url=""
if urlPos!=-1        #we have a url
   if ARGV.size == urlPos+1
      url=ARGV[urlPos]
      if url=~ /(^[^\/]+)(:\/\/)(.*)/        #remote ?
         prefix=ENV["FUSE_KIO_GATEWAY_MOUNTPOINT"]
         if ! prefix.empty?
            url=prefix+"/"+$1+":__"+$3
         end
      end
   end
end

count=0
for nextParam in ARGV
   if nextParam=="]placeholder"
      if !url.empty?
         app=app+" \""+url+"\""
      end
   elsif count>0
      if urlPos==-1 || count<urlPos-1
         app=app+" \""+nextParam+"\""
      end
   end
   count+=1
end


printf("command: -%s-\n",app)
system(app)


_______________________________________________
kde-debian mailing list
kde-debian@kde.org
https://mail.kde.org/mailman/listinfo/kde-debian


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic