Announcement

Collapse
No announcement yet.

location of settings for context menu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    location of settings for context menu

    Howdy,

    new to Kubuntu and the forum. Please feel free to move to a better sub-forum if applicable.

    Just got my friend a new PC and decided to give Kubuntu a try, so I just installed 21.10 for her (previously Manjaro, before that Win7).

    She is very much used to working with IrfanView on Windoze so I install Wine and IrfanView for her. The installation did not automatically add options for opening ("Open with") IrfanView from the context menu in Dolphin (I seem to remember that on Manjaro this did fall into place automagically?) but that is not the point. I manually added that by opening the context menu "Open with" and henceforth browsing through the applications to IrfanView and selecting it as "always use" and later switching that back to Gwenview, which left me with an entry for IrfanView in the "Open with" context menu now.

    Problem is that using this option in the context menu does not pass on the selected file correctly to IrfanView if there is a space in the path to the file, so the entry that starts this service will prolly need some ' ' around the path/filename or some such. Paths/filenames without spaces or other obtrusive characters seem to work as intended. [Edit: The spaces are not the problem, see further below.]

    To get to this I tried to find some .desktop file or other that might contain the line calling IrfanView from dolphin, but could not locate it.

    Looked in these directories to no avail:

    ~/.local/share/kservices5/ServiceMenus/
    ~/.kde/share/kde4/services/ServiceMenus/
    ~/.local/share/dolphin

    /usr/share/kservices5/ServiceMenus/
    /usr/share/kde4/services/ServiceMenus/

    any pointers?

    TIA!
    Leendert

    P.S. Found an entry in ~/.wine/user.reg that points to:
    > "DesktopFile"="/home/username/.local/share/applications/wine-extension-tif.desktop"

    And hence the desktop file it refers to, with this line in it:
    > Exec=env WINEPREFIX="/home/username/.wine" wine-stable start /ProgIDOpen IrfanView.tif %f

    Changed the %f to "%f", closed and restarted dolphin but that didn't fix it ....

    P.P.S.
    Found this related bug (for office .docx):
    (h t t p s : / / bugs . winehq . org /) show_bug.cgi?id=19385
    That one is listed as "fixed/closed" however ... will try to read up more on that.

    Meantime any quick pointers are appreciated ...
    Last edited by Leendert; Jan 28, 2022, 10:32 AM.

    #2
    Normally, one would open System Settings > Applications > File Associations, then find the file type in the "known types" list, then select it, click on the application in "Application Order" and select "Edit", then finally in the window that opens, click on the "Application" tab where you will see the line "Command" which has what you're looking for. However, I don't know if you'll get the results you want, but it's worth a try. Try single quotes too.

    FYI, the codes for files names and such you'll see there:
    Code:
    %f - a single file name
    %F - a list of files; use for applications that can open several local files at once
    %u - a single URL
    %U - a list of URLs
    %d - the folder of the file to open
    %D - a list of folders
    %i - the icon
    %m - the mini-icon
    %c - the caption
    I have some comments though:
    Firstly, welcome the Kubuntu and this forum! From the detailed nature of your post I assume you have a reasonable amount of computer experience if not Linux experience. We look forward to your contributions here.
    Secondly, I applaud your efforts to get your friend out of the Windows environment and into the world of free operating systems. I hope she becomes a Linux fan like we all are and has a successful Linux experience.

    You asked for "pointers" so here's mine: Don't encourage your friend to use Windows programs when there's a suitable Linux option. This will actually help your friend embrace the new environment quicker. Especially when you have to go through Wine to run it. You basically are making it three fold more complicated to do something as basic as viewing and editing photos. Besides, you never know which parts of a Windows program will work or not. For example, setting the desktop wallpaper from Ifranview will likely not work. WINE is not a perfect solution. Gwenview is quite capable and a good program so maybe your friend will learn to like it.

    Most of us find, over time, that it's not difficult to adjust to using Linux programs. Especially when there are usually many options to choose from and they are all free.

    Please Read Me

    Comment


      #3
      Another 'option' would be to install the Snap package of IrfanView. Go to the SNAP store (IrfanView is preselected in this link) and click the one-button install.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        This is getting weirder by the minute ...

        A) After installing IrfanView I opened a JPG file through the context menu of dolphin located on a NTSF-partition indicated by dolphin as /mnt/SchijfD, that worked fine.

        B) Next I try opening an PNG file located on an Ext4 partition indicated by Dolphin as "1,7 TiB intern apparaat (sda1)" (without the quotes). Now IrfanView started up okay, but with no file loaded
        Ba) I _assumed_ this would be due to the fancy naming of the volume with spaces and all, but it isn't (it is mounted as /media/username/eb55d812-faea-4e59-893a-3857ce584ca7 )

        To avoid problems resulting from mounted drives with aliases or what have you, I copied some (offending) files to ~/Pictures (/home is on the same volume as /, didn't redirect that to a different drive yet))

        Here is the weird stuff:

        1) First thing I noticed is that Irfan would still not open the PNG file copied to the ~/Pictures directory, whereas it opened the JPG fine.

        2) I used a file (photo of some flowers) named "1-12-2007 036.jpg" (note the space in the name!) and copied that to a file named "flowers.jpg" (all without the quotes)
        2a) Guess what: IrfanView opens the original filename (with a space in it) just fine, but comes up empty on the flowers.jpg

        3) just to make sure, I opened the "1-12-2007 036.jpg" in IrfanView and saved it back to "flower2.jpg" (as opposed to copy with dolphin), ending up with a smaller file size due to different JPEG compression, so clearly not a "copy" of the file anymore. Now, going from the context menu in dolphin, the original file is opened correctly, but both the files flowers.jpg (copy of original) and flower2.jpg (saved version) come up empty. As well as the PNG file I had copied there.
        3a) Once IrfanView is started, I can open all the files from within IrfanView just fine(!)

        4) Because the .desktop I found in the post above seems to be for TIFF files really (I realized later), also used IrfanView to save the original flowers photo as flowers.tif This file is opened fine from the context menu.

        5) The PNG file I used (not opening correctly) is a file from the IrfanView program (IrfanView.png). So I created some more PNG files for testing by loading and saving the flowers photo to "1-12-2007 036.png" (original filename but .png, no quotes of course) and flowers.png as well as flower2.png.
        5a) Now "1-12-2007 036.png" opens just fine from the context menu, but flowers.png and flower2.png do not (same as the .jpg by the same names)

        6) Realizing that the original filename does not contain any alpha characters, I tried saving it as 12345.jpg. That doesn't open either.
        6a) Changing that name (through dolphin) to "12345 67.jpg" (note the space) does enable opening it through the context menu.
        6c) To test for length (shortness) of name to be the issue, I tested 1234567890.jpg (no go) and "123456 7890.jpg" (go)

        7) I've been testing this from dolphin, but calling IrfanView through the context menu in Gwenview seems to have the exact same issues.

        Must still be something in the handling of the filenames being passed through kde context menus and/or wine to IrfanView, but _not_ related to spaces, or not in the way I originally assumed at least.

        Really baffled by this ...

        Understanding the process or steps involved in handing such a call from a context menu might help in locating the culprit, but I'm not savvy enough on all the possible configuration options involved and where to find these on Kubuntu.

        Also, I have no idea if I should address this as a KDE, Wine or even IrfanView bug ?

        Any help much appreciated!
        Last edited by Leendert; Jan 28, 2022, 10:38 AM.

        Comment


          #5
          Some answers crossed mine - I will look at these in detail and get back! Thanks!

          Comment


            #6
            Thanks oshunluvr for the proper way to find this stuff through the GUI. Very helpful, also for other issues/programs - happy to have that on the radar. More on that further below.

            As for using native Linux programs - I hear you loud and clear - but there are some considerations:
            1) The girly is 78 years old and very much likes what she already knows.
            2) I started her on IrfanView in Win7 days, because it is lightning fast starting up and can do all sorts of things rarely found in other viewers (changing colours, adding lines/text etc) that is usually reserved for much heavier programs such as Photoshop or The GIMP, but those start much slower and are much more complicated to operate/understand.
            3) Since I started her on Linux her workflow is now to open her daily batch of (hundreds of) photos in Gwenview (because it is better for browsing and comparing different shots side by side etc) but then when she selects a photo to use (best in a series) she right clicks it in Gwenview to "edit" it in IrfanView. It took her a while to "learn" IrfanView and she's not very keen on ditching that.
            4) Also, I honestly don't know a good alternative on Linux that has equal speed, versatility and simplicity of use and find myself falling back on IrfanView under Wine quite often too.

            If running Irfan under Wine keeps her happy with the transition to Linux, I'm not one to put much effort into fighting that

            On topic:
            Snowhog : Thanks for the pointer to the SNAP-thingy. Hadn't looked into that much previously. Gave it a quick shot by just installing it without first removing the already installed IrfanView and even as such it worked as a charm.

            I now have two options in the context menu for "Open with": The previous one that didn't work well (named "IrfanView 64 4.59") and a second one named simply "IrfanView", installed by the SNAP thingy that _does_ seem to solve the problem

            This also gives me an option to look at both and see the differences, but obviously both work through completely different mechanisms and the exact steps are not all accessible through the GUI as suggested by oshunluvr. Just a quick comparison:

            "Command" for the non-SNAP installation (.EXE setup files through Wine):
            Code:
            env WINEPREFIX="/home/username/.wine" wine-stable C:\\windows\\command\\start.exe /Unix /home/username/.wine/dosdevices/c:/users/username/Start\ Menu/Programs/IrfanView/IrfanView\ 64\ 4.59.lnk
            "Command" for the SNAP installation:
            Code:
            env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/irfanview_irfanview.desktop /snap/bin/irfanview %F
            Note that the non-SNAP one doesn't even have a %f or %F in it, so it must have that in some of the config/script files scattered elsewhere in the system.

            I'm still dismayed at the weird stuff going on with the different filenames, some functioning _with_ a space in it, and not without. That kind off saws at the legs of all I thought to know or understand about general problems with string handling, so I will prolly try to reproduce that on a different system and see what gives for a proper bug report, but happy to roll with the SNAP install of IrfanView for practical purposes on my girly's PC for now.

            Thanks folks!
            Cheers, Leendert
            Last edited by Leendert; Jan 28, 2022, 10:27 AM.

            Comment


              #7
              As oshunluvr already stated, Welcome to KFN! And, welcome to Kubuntu Linux. It is our hope that you will find it a refreshing alternative to Windows.
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                To your friend's work flow: is she editing the photos in major ways? Gwenview has a few very basic tools: rotate, mirror, and flip, resize, crop and redeye removal. They're easily accessible - in the lower left corner of the view window, there's a small box with a right arrow in it. Click that, then a menu opens, then click the pencil icon, and you'll see "Image Operations" in the left menu.

                But as you pointed out - I can see why at her age one might not want to learn a whole new tool. Hopefully, the snap version will do the trick.

                As far as space handling in file names - that's actually a problem caused by Windows - they allowed it on purpose and also ignore case. It makes their file storage incompatible (by design IMO) outside MS. Frankly, it's bad practice to use spaces in filenames. There aren't any Linux file systems I know of that support it directly. A space is a delimiter. You can ignore it with a backslash like this:

                file\ name\ with\ spaces.jpg

                but it's annoying and most programs won't like it. There's a blog somewhere I read that began with "Spaces in filenames: You'll regret it."

                I totally agree that most image editors are too feature-rich (pronounced "complicated") for basic photo work, except maybe Pinta or Fotoxx.
                Last edited by oshunluvr; Jan 28, 2022, 02:18 PM.

                Please Read Me

                Comment


                  #9
                  Snowhog : She's been happy with Manjaro Linux for about a year and a half now, with minor "swearing" at things working differently or crashing, but the latter was due to her mainboard slowly giving up, as it would seem now. Nevertheless, she's had some issues with Manjaro not rebooting to the GUI after updates (about three times - due to issues with nvidia drivers), so while setting up a new PC I decided to give Kubuntu a spin for her. I'm confident that should work fine for her too.

                  Linux distros all had their problems with stability in the past, so I'm used to giving up on one and trying another. I remember hating other file managers on SuSe/Gnome but dolphin having problems configuring network drives (due to Gnome/KDE) and not properly releasing memory, crashing and messing up after longer usage and this not being fixed or re-occurring after various major updates. Package managers of various distros constantly being swapped around for new stuff that had new issues etc etc. Tinkering and finding solutions, or more likely "work arounds" has never been a big issue for me, but I would never have suggested using Linux to the likes of my GF some 5 years ago or so. Speaking for myself, I've grown really weary of the time of life consumed by stupid program bugs and things just not working "as advertised". Have had my share of that, having worked with computers since the early 80's and pretty much sick and tired of it by now.

                  But, Linux in general sure has come a long way since and nowadays I'm often very impressed by how well everything works "out of the box". Some of it, I'm sure, partly also due to the browsers taking over many things 'natively' that would have required plugins or settings in the past (handling of (DRM-)media, PDFs etc.).

                  Surprised by how well the Snap you suggested worked. I'll need to read up on implications for memory usage etc., resulting from everything being contained in it (no dependencies), but ease of use goes a long way too(!)

                  oshunluvr : Thanks for your thoughts. She's not doing much very fancy stuff and we are aware of the basic editing functions built into Gwenview. In the past I myself have also used kipi-plugins in Gwenview for stitching and stacking, but that was rather unstable (at the time, 5-10 years ago?).

                  The most important thing she's missing is colour management (gamma, contrast, colour fine tuning etc) and simple filters like sharpen or fine rotation etc. All these 'basics' are available in Irfan and maybe more importantly _fast_ to access and use once you've memorized the hot keys for each. Simply cropping an image for example just requires pulling a box over the area you want and pressing Ctrl-y. Not a single menu, dialogue box or change of view involved. Things like that. Plus the fact that she's used to this workflow ...

                  Same goes for me, I'm afraid to admit. I do use The Gimp quite a bit but I sometimes even find myself exporting a layer, doing stuff to it in IrfanView and importing it back into The Gimp, mostly just because I can't be bothered to spend half a day finding out how to do it properly in The Gimp and know I get it done in IrfanView in seconds. Call me lazy ... or efficient ...

                  But thanks for the pointers to Pinta and Fotoxx, I'll be sure to give these a spin to check them out more extensively for her. Never got around to properly trying Darkroom either - always considered it too "big"/slow for the low end PC I'm usually running, but her new PC might pull it off.

                  P.S. On the file names: Yup - always big problems/frustrations copying between FAT/NTFS and Linux file systems. The weird thing here however is that (on ext4/Linux) some file names _with_ spaces seem to be passed on properly, whereas the same _without_ a space in it doesn't.
                  Never ever seen that happen before

                  Thanks again to both for all the help and other thoughts!!

                  Cheers, Leendert
                  Last edited by Leendert; Jan 29, 2022, 07:17 AM.

                  Comment


                    #10
                    The spaces are handled in a mostly consistent way when using the console, however any decent programmer can write code to handle filenames with spaces. That's probably what you're seeing - some programs work with spaces, some don't.

                    A frustrating example: "ls" lists filenames with spaces correctly, but if you try and create or edit a file with a space in the name you have to use quotes. This can make bash scripting frustrating.

                    The delimiters are set by the $IFS (Internal Field Separator) variable which you can change within a script.


                    Please Read Me

                    Comment


                      #11
                      I'll be looking into the filename dependent calling via the context menu weirdness listed above in more detail later and give some feedback here.

                      Meantime. that Fotoxx looks like it may well be worth spending some serious learning time on - I'll work with it for a while and see if I can 'approve' it for the girly in terms of simplicity and speed - looks promising!

                      Thanks for that tip

                      Comment

                      Working...
                      X