Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Problem with File Associations

  1. #1

    Default Problem with File Associations

    I am running Leap 42.2 and Plasma 5.

    I have three different file types that I want to open from Dolphin with three different scripts. I went to Configure Desktop/System Settings > Applications > File Associations, and added Group "text", Type name "RDP" (one of the three). Then, I edited text/RDP, and added a Filename Pattern (*.rdp). This much works - Dolphin now shows my .rdp files as type "text/RDP". However, when I right-click on one of my files, "Open With" is blank. If I choose "Open With", I get the Choose Application dialog, where I can choose my script, and select Remember application association... - it will open my file with my script, but it does not remember this setting. The next time I try, same thing - empty "Open With" list.

    I also tried editing text/RDP in System Settings > File Associations > Application Preference Order (which is empty) > Add > pick my script > OK - but nothing shows up in Application Preference Order.

    How do I fix this?

  2. #2
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,450

    Default Re: Problem with File Associations

    My understanding is that Open with refers to a built-in catalogue of programs. So, if the program that opens the files is not in the catalogue, Open with cannot find it.

  3. #3

    Default Re: Problem with File Associations

    I don't have any trouble opening the files with the script - it just won't remember my settings.

    (This all worked great in openSuse 13.1!)

  4. #4
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,450

    Default Re: Problem with File Associations

    You would have no problem with the script because it will be blindly followed. You asked about Open with. There is an OpenDesktop standard for displaying applications which uses a directory of applications and has the facility to read another directory of extra applications; if KDE uses this, I suspect that the way you can add applications to this directory may have changed.

  5. #5

    Default Re: Problem with File Associations

    I'm not sure that there is any way of curing this particular problem. I noticed it not long after starting to use Linux, kde but suspect that all desktops are the same.

    I had to use ms windows at work and it always had a facility to add scripts / applications to right clicks. It might still have on 10. The reason that they include it is for situations they haven't accounted for. For instance more for fun than anything else I used the facility to edit a source file, assemble it and then link, all with right clicks. It turned out to be a decent way of working. Quicker than the keyboard or using a console via abbreviations.

    Of late KDE has become more complex in this area - they have added ask. Click on a file and if it can execute it will ask to open it or run it. I wanted to always have a couple of applications available via right clicks and couldn't find any way to do it. A sort of *.* can be added which defeats the ask but getting apps to always appear in right clicks seems to be impossible.

    One thing that may be able to do it is dolphin plugin if you can write one and it can use them. I've picked up some where that konq can but I don't like using apps that can also access the web for this sort of thing. I suspect even ms dropped that.

    John
    -
    Leap 42.2 KDE 5.26
    3.6gig Xeon, 64bit SATA Raid home - Linux Raid 1
    All software on a flash drive, SATA swap & Temp files,

  6. #6

    Default Re: Problem with File Associations

    A 2nd thought as your problem isn't the same as the one I wanted to solve. However you may have already tried this.

    Have you tried adding you script as an application to the start button menu? I suspect that unless you do that kde will assume that it doesn't exist so will ask you to select something else probably having to navigate to it.

    John
    -
    Leap 42.2 KDE 5.26
    3.6gig Xeon, 64bit SATA Raid home - Linux Raid 1
    All software on a flash drive, SATA swap & Temp files,

  7. #7

    Default Re: Problem with File Associations

    I tried to edit that post. If you find that adding the script this way doesn't help you may need to create a desktop file for it and place it in /usr/share/applications or the one off local.

    I'd hope this isn't needed but the menu's are now loaded with applications from there via desktop files. They do seem to have left scope for legacy menu items so editing the start button menu and adding it should still be ok,

    John
    -
    Leap 42.2 KDE 5.26
    3.6gig Xeon, 64bit SATA Raid home - Linux Raid 1
    All software on a flash drive, SATA swap & Temp files,

  8. #8
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: Problem with File Associations

    if I understood you right you want a text file with a particular extension to be opened with a bash script
    a question where is this script?
    #1 I think you have 2 choices put the script somewhere in your path and kde should remember it
    ~/bin (or $HOME/bin) is part of the user's path
    #2 do as ajohnw suggested make a desktop file but don't put it in /usr/share but in
    ~/.local/share/applications
    see these links for a simple/sample desktop file
    https://linuxcritic.wordpress.com/20...-desktop-file/
    https://wiki.archlinux.org/index.php/desktop_entries
    https://specifications.freedesktop.o...ec-latest.html
    just edit the exec line to point to your script and edit the MimeType line to text/RDP
    and give this desktop file a unique name so it shows in the menu bar (replace RDP Reader/Editor with your script's name)
    Code:
    Name=RDP Reader/Editor
    MimeType=text/RDP;
    Exec=/home/<you>/path/to/script/script.sh %F
    now even doble clicking on an rdp file in dolphin will open it with your script

  9. #9

    Default Re: Problem with File Associations

    I feel like screaming. Before kDE4 started I had looked at opendesktop etc and noticed that users should be able to extend menu's. A dev, a senior one told me "no, not doing that". I've just accepted that as fact.

    Looking at the site John H mentioned came up with this tutorial

    https://techbase.kde.org/Development..._Service_Menus

    Then a look around my machine came up with this directory

    /usr/share/kservices5/ServiceMenus/

    It looks like the facility shown in the tutorial may still be available so right click options can be extended - for Konq anyway. Other posts on the web suggest that this works with dolphin as well but kde needs restarting in order to detect the change. Or it seems kbuildsycoca5 can be run instead. Similar changes to plasma need a restart as well.

    The user's applications menu seems to extend as A_I suggests, A big mistake in my view when there are different users and or desktop types on a single machine. It would be simpler to handle this if it over rides xgd default settings but those could be changed according to who logs in or it could be that a user menu directory does over ride. Best shut up and post a bit more on isolating desktops when I have tried it. Things in this area are easier if one of them over rides system wide settings,

    John
    -
    Leap 42.2 KDE 5.26
    3.6gig Xeon, 64bit SATA Raid home - Linux Raid 1
    All software on a flash drive, SATA swap & Temp files,

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: Problem with File Associations

    Quote Originally Posted by I_A View Post
    #1 I think you have 2 choices put the script somewhere in your path and kde should remember it
    I do not think KDE wil "remember" it. It could be that KDE uses the PATH variable like the shell does, but that is not for sure to me.

    In any case,using an absolute path (without any typical shell constructs like ~/) is the most likely to work. Like from a crontab and like for every usage that may not use a a login shell to interpret it.
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •