Re: panes.switch and working dir


Instead of file-roller, I wrote a simple script to unpack an archive and
open emelfm2 on it. When closed, I delete the unpacked files...

#!/bin/sh

tmpdir=/tmp/opener$$
curdir=`pwd`
file=$1

#echo "Opening $file for review"
mkdir -p $tmpdir

cd $tmpdir
case $file in
 /* ) ;;
 *)   file="$curdir/$file"
esac

case $file in

 *.tar.Z )   gtar Zxf $file ;;
 *.tar.gz )  gtar zxf $file ;;
 *.tgz    )  gtar zxf $file ;;
 *.tar.zip ) unzip -p $file | gtar xf - ;;
 *.tar )     gtar xf  $file ;;
 *.zip )     unzip -d $tmpdir $file  ;;
 *.tar.bz2 )   bzip2 -d -c %f | tar xf - ;;

esac

emelfm2 -1 . -2 $curdir

cd $curdir
rm -rf $tmpdir

Of course, you have to maintain it and update it as need be...



tpgww@xxxxxxxxxxx wrote:
On Wed, 28 Jan 2009 01:50:28 +0100
Giancarlo Bianchi <giancarlo.b@xxxxxxxxx> wrote:

However, file-roller -e %D %f does seem to work.
It works, and I use it, but what I want is an option to create a
directory in the other pane with the archive name, and extract it there.
"ark --guess-name --extract-to %D %f" will do it, but I would prefer not
to start all the KDE stuff, as I stated in my previous mail. Reasonable
alternative is to live without an option I sometime use...

Something like:
panes.switch;mkdir %F;cd %F;panes.switch;file-roller -e %D %f
will not work, as the cd will be asyncronous so the archive will not be 
unpacked into the created subdir.

Probably the nearest you can get is:
panes.switch;mkdir %F;panes.switch;file-roller -e %D/%f %f
i.e. no automatic cd in the inactive pane. Or I suppose you could append 
another:
panes.switch;cd %F;panes.switch

Perhaps we should do something about a synchronous cd, but that's not so simple.

Regards
Tom



--
   Soli Deo Gloria
   Adam Krolnik
   Director of Design Verification
   VeriSilicon Inc.
   Plano TX. 75074
   Co-author "Assertion-Based Design", "Creating Assertion-Based IP"

Other related posts: