From kde-debian Fri Jan 09 18:49:34 2004 From: Alexander Neundorf Date: Fri, 09 Jan 2004 18:49:34 +0000 To: kde-debian Subject: Re: ioslaves with *any* linux apps -> it works :-)) Message-Id: <200401091949.34747.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kde-debian&m=107367418409420 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_+ev//J5gAaEYQzw" --Boundary-00=_+ev//J5gAaEYQzw Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --Boundary-00=_+ev//J5gAaEYQzw Content-Type: application/x-desktop; name="gimpx.desktop" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gimpx.desktop" [Desktop Entry] Encoding=UTF-8 Name=Gimp fuse Exec=ioslave_helper gimp ]placeholder ]url %u Icon=gimp Type=Application GenericName=Image Manipulation Program MimeType=image/gif;image/jpeg;image/bmp;image/x-xpm;image/tiff;image/png;image/x-xcf;image/fax-g3 X-KDE-StartupNotify=false X-StandardInstall=true --Boundary-00=_+ev//J5gAaEYQzw Content-Type: application/x-desktop; name="writerx.desktop" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="writerx.desktop" [Desktop Entry] Version=0.92 Encoding=UTF-8 MultipleArgs=false Terminal=0 Icon=ooo_writer.xpm Exec=ioslave_helper /opt/OpenOffice.org1.1.0/program/swriter ]placeholder ]url %u Type=Application MimeType=application/vnd.sun.xml.writer;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;text/rtf Name=OpenOffice.org 1.1.0 Writer fuse Comment=OpenOffice.org 1.1.0 Text Document --Boundary-00=_+ev//J5gAaEYQzw Content-Type: text/plain; charset="iso-8859-1"; name="ioslave_helper" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="ioslave_helper" #!/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