Shell Starter

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Flashbaer
Posts: 1
Joined: Wed Nov 04, 2009 10:22 am

Shell Starter

Post by Flashbaer »

Hi there,

I just installed XnView MP and just enjoyed running it on Ubuntu 9.04 :-)

I have a small suggestion about the starter-skript xnview.sh: to let it start from every folder I want to, I changed the skript to this:

Code: Select all

#!/bin/sh

XNVIEW_FOLDER=$(echo $0 | sed -e 's/\/[^\/]*$//');

LD_LIBRARY_PATH=$XNVIEW_FOLDER/
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=$XNVIEW_FOLDER/
export QT_PLUGIN_PATH
$XNVIEW_FOLDER/xnview
Best Regards
Flashbaer
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Shell Starter

Post by oops66 »

Flashbaer wrote:Hi there,
I just installed XnView MP and just enjoyed running it on Ubuntu 9.04 :-)
I have a small suggestion about the starter-skript xnview.sh: to let it start from every folder I want to, I changed the skript to this:

Code: Select all

#!/bin/sh
XNVIEW_FOLDER=$(echo $0 | sed -e 's/\/[^\/]*$//');
LD_LIBRARY_PATH=$XNVIEW_FOLDER/
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=$XNVIEW_FOLDER/
export QT_PLUGIN_PATH
$XNVIEW_FOLDER/xnview
Best Regards
Flashbaer
Hello
Thank you for the script, for information you can use this one too:
http://newsgroup.xnview.com/viewtopic.p ... 915#p77915

Code: Select all

#!/bin/sh
dirname=`dirname $0`
LD_LIBRARY_PATH=$dirname
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=$dirname
export QT_PLUGIN_PATH
$dirname/xnview "$@"
But I agree +1, it will be better to have this kind of xnview.sh by default instead the actual one here:

Code: Select all

#!/bin/sh
LD_LIBRARY_PATH=./
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=./
export QT_PLUGIN_PATH
./xnview
Last edited by oops66 on Wed Dec 09, 2009 3:55 pm, edited 1 time in total.
XnViewMP Linux X64 - Debian - X64
User avatar
xnview
Author of XnView
Posts: 37769
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Shell Starter

Post by xnview »

Flashbaer wrote:I have a small suggestion about the starter-skript xnview.sh: to let it start from every folder I want to, I changed the skript to this:
Why is it better than the current one?
But I agree +1, it will be better to have this kind of xnview.sh by default instead the actual one here:
Why?
Pierre.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Shell Starter

Post by oops66 »

xnview wrote:...
But I agree +1, it will be better to have this kind of xnview.sh by default instead the actual one here:
Why?
Because in this case, it is possible to start from any folder, and it is also possible to use under nautilus explorer ( for example) the contextual menu "Open With" ... image_file.jpg for example to open this image with XnViewMP (do not forgot the quotes in this case here: "$@" instead $@).
... But it is also possible to have 2 or more xnview.sh files samples in your .tgz package ( xnview01.sh, xnview02.sh, and so....) for specifics use.

The suggested new kind of xnview.sh:

Code: Select all

#!/bin/sh
dirname=`dirname $0`
LD_LIBRARY_PATH=$dirname
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=$dirname
export QT_PLUGIN_PATH
$dirname/xnview "$@"
the actual xnview.sh by default:

Code: Select all

#!/bin/sh
LD_LIBRARY_PATH=./
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=./
export QT_PLUGIN_PATH
./xnview
XnViewMP Linux X64 - Debian - X64
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Shell Starter

Post by oops66 »

Done into the Linux MP 0.25 version - Thank you Pierre for this improvement.

But this solution is probably much better (in case of symbolic link) ???, see here:
http://newsgroup.xnview.com/viewtopic.p ... 580#p82580
change:
dirname=`dirname $0`

to

pathname=`readlink -f $0`
dirname=`dirname $pathname`
XnViewMP Linux X64 - Debian - X64