"Open with" function corrected

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Post Reply
napfkuchen
Posts: 4
Joined: Thu Aug 22, 2013 1:44 pm

"Open with" function corrected

Post by napfkuchen »

I'm using XnViewMP Version 0.61 on Lubuntu 12.04 and Lubuntu 13.04.

The filemanager is PCManFm. This one offers a feature called "Open with" to open a selected file with an other program. If I try to open a jpg or a png file that way with XnViewMP, XnViewMP tells it couldn't find the file.

XnViewMP start with the script "/usr/sbin/xnview". So I opened the script with root privileges and add a view thing things, so that will work for me. This is stored in "xnview.sh.gz"

Hint:
Goto in "/usr/sbin". Rename the original script (mv xnview xnview.old). Unpack my script and put it in "/usr/sbin", then make a softlink "xnview" to my script (ln -s xnview.sh xnview) . After all give my script the same owner und rights als file "xnview.old".
Attachments
xnview.sh.gz
corrected starter script of XnViewMP
(349 Bytes) Downloaded 211 times
Last edited by napfkuchen on Wed Jul 08, 2015 10:15 am, edited 1 time in total.
Skulptron
Posts: 2
Joined: Thu Dec 19, 2013 10:23 am

Re: "Open with" function corrected

Post by Skulptron »

Script works good on Lubuntu 13.10
XnViewMP Version 0.61 (Jul 17 2013)

thanx napfkuchen :D
napfkuchen
Posts: 4
Joined: Thu Aug 22, 2013 1:44 pm

Re: "Open with" function corrected

Post by napfkuchen »

I revised my script. Now it also works with a list of files that have been selected in a fille manager, and opens them all in XnViewMP. In contrast to the original startup script (/usr/bin/xnview) my revised script also supports the PCManFM file manager.

I tested my revised script on: PCManFM, Nautilus, Nemo
under: Debian "Jessie", Lubuntu 15.04, Fedora 22

Procedure: To use my revised script download the file "install_xnview-fm.gz" and run in a console with the following command:

Code: Select all

zcat install_xnview-fm.gz |sudo bash
The install script saves the original startup script of XnViewMP.
Attachments
install_xnview-fm.gz
xnview-fm installer
(1.73 KiB) Downloaded 83 times
LordHelmchen
Posts: 1
Joined: Fri Jul 17, 2015 12:07 pm

Re: "Open with" function corrected

Post by LordHelmchen »

Hi napfkuchen,

many thanks for your useful script. It worked immediately.
I especially like the hidden feature

Code: Select all

VDIR=on
in your script. It's a very nice idea.
Pequi
Posts: 2
Joined: Wed Jul 22, 2015 2:25 am

Re: "Open with" function corrected

Post by Pequi »

Running Debian 7 with LXDE here. Script worked perfectly. Should be included with
the instalation package, IMHO, saves noobs like me a lot of time. TY.
:D
Pequi
Posts: 2
Joined: Wed Jul 22, 2015 2:25 am

Re: "Open with" function corrected

Post by Pequi »

I just updated XnView XP to 0.75, using Debian,and associations stopped working again. Running your script just said that it had already been applied.
So ... I removed the part that checks it it has been applied, and all is well again. The script ran and the chronic failure of XnView to associate with image files was once again fixed.
I just wish the author would address the problem. Not opening the program, or opening a hex editor/music player when you double click an image is just plain silly and not user-friendly. It's been that way since version 0.5something. An image viewer should VIEW images when they are double clicked.
napfkuchen
Posts: 4
Joined: Thu Aug 22, 2013 1:44 pm

Re: "Open with" function corrected

Post by napfkuchen »

Reinstalling my script is not necessary. Just run the following command in a terminal:

Code: Select all

sudo bash -c 'mv "$0" "$0-org"; ln -sr "$0-fm" "$0"' "`which xnview`"
The installation of a new version of XnViewMP rewrites its startup. The code saves this and creates a symlink that points to my installed script. This protects changes that someone undertook at my script.
Post Reply