Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have the Windows program Irfanview installed in Wine. I want to click on a an image file and have it automatically open the image. The closest I've come is getting Irfanview to open but then I have to manually select the image to open.
In KDE, go to the KMenu, System Settings, click on Default Applications, and select File Associations on the left. Expand "images", and select the format you want. On the right, go to the General tab, under Application Preference Order click Add, then select the menu item for Irfanview if you've created one, else type the command in. You'll have to do that for each format, as far as I know (unless you want to awk the config files or something). You can also get to the App Pref Order by right clicking on an image of that type and going to Properties.
Thanks but as I said that only causes Irfanview to open. If you will read the original thread you will see that was suggested but didn't work. It took a script to get it to work and I just don't know how to implement the script.
From the original post:
I forgot you were talking about wine yesterday, obviously IrfanView expects a path in windows form.
I assume you are launching this from konqueror or any other kpart. Kde uses an odd naming for parameters.
I think it uses %u for files and %s for urls, or something like that.
So, if you associate a given program to a file type you will need to specify the parameter as well (otherwise it will just open the viewer, as it's doing for you right now).
For example, to open jpeg files with feh, you would specify "feh %u", and not just "feh".
If you need to open a wrapper, like in your example, remember that you are passing arguments to it. If you pass the file name in kde using %u, and it's the only argument, then you will be able to access it as $1 in a shell script. So, you'd do:
wine inrfanview "$1"
To pass the first positional parameter that konqueror sent to the script to irfanview.
i92guboj I appreciate the answer but it brings me back to the problem I had with the original post. It tells me what to do but not how to do it.
Open konqueror, open it's configuration dialog, go to wherever the file associations are set. Select the file extension that you want to change the viewer for. Now set as viewer something like "/path/to/your/script.sh %u", and make sure that it's the first one in the list if you have any others.
[Sorry for not being more concrete, but I only have konqueror 4 and I don't have 3.x right now to take a closer look. However it should be easy enough to figure those steps.]
Now, edit /path/to/your/script.sh and put inside this:
Probably wait till my day off. I've learned the hard way, you come in from work at 11 pm, set down to do a bit of work on the computer and the next time you look at the clock it's past 3 in the morning. I'll let you know though.
Just a quick note that i92guboj. instructions worked for me with minor alterations. I made the file association changes in the KDE control center not konqueror. For reasons I'm not sure of I couldn't make the ".sh" file executable from command line so just did it from GUI.