PCManFM not recognizing multiple MIME types












0















I need to set up a script to run when various types of files are run in PCManFM. I right clicked on a file and used "Open With" to enter the name of the script. After that, I could see the new entry in the context menu when I right clicked, but only on files of the same MIME type as the one I originally created the entry for. So I went into the userapp-...desktop file and edited the MIMEType entry in various ways - first I tried completely deleting it, as I want all files to have this option. Then I tried adding additional MIME types separated by semi-colons. Nothing worked. I tried both running lxpanelctl restart as well as logging out and logging back in after each change. In addition, I tried killall pcmanfm && pcmanfm --desktop --profile lubuntu &.



I also tried selecting multiple files of different types, right clicking, "open with", "Custom Command Line" and then entering the command to execute and an application name. However, when I do this, the command is not run, nothing is added to the context menu nor is anything created in ~/.local/share/applications.



What am I doing wrong?



Update: I tried rebooting the machine and I can now see the entry I created when I right click for all the MIME types I manually added in the .desktop file in `~/.local/share/applications". But having to reboot my machine after any change isn't acceptable and I'm pretty sure there should be a command to refresh PCManFM. Also, I'm still not able to get anything to happen when I try to create a new userapp via "Open With" when multiple different files/types are selected.



Update 2: I have found that the following command almost works:



update-desktop-database ~/.local/share/applications


I have set several MIME types to be recognized (5 video formats and 4 image formats) but after running the above commands (and even going as far as rebooting, which has no additional effect), only 1 image format and all 5 video formats have the new right click content menu item show up, even though I see the correct entries for all image types in ~/.local/share/applications/mimeinfo.cache.



Update 3: It appears that the reason the image formats weren't working is that they were referenced by multiple userapp custom actions. Why can't I have multiple custom actions for a single MIME type? I see it in the system actions and it works fine!



Update 4: I have been playing around with this for a while now, and at some point about half of my MIME types started showing both custom actions, while the rest did not. But I just discovered that all the custom actions are showing up under the "Open With" sub-menu, whereas in the ones that show up directly in the right-click menu, "Open With" is not a sub-menu. How do I get a consistent behavior across all types to avoid the sub-menu???










share|improve this question





























    0















    I need to set up a script to run when various types of files are run in PCManFM. I right clicked on a file and used "Open With" to enter the name of the script. After that, I could see the new entry in the context menu when I right clicked, but only on files of the same MIME type as the one I originally created the entry for. So I went into the userapp-...desktop file and edited the MIMEType entry in various ways - first I tried completely deleting it, as I want all files to have this option. Then I tried adding additional MIME types separated by semi-colons. Nothing worked. I tried both running lxpanelctl restart as well as logging out and logging back in after each change. In addition, I tried killall pcmanfm && pcmanfm --desktop --profile lubuntu &.



    I also tried selecting multiple files of different types, right clicking, "open with", "Custom Command Line" and then entering the command to execute and an application name. However, when I do this, the command is not run, nothing is added to the context menu nor is anything created in ~/.local/share/applications.



    What am I doing wrong?



    Update: I tried rebooting the machine and I can now see the entry I created when I right click for all the MIME types I manually added in the .desktop file in `~/.local/share/applications". But having to reboot my machine after any change isn't acceptable and I'm pretty sure there should be a command to refresh PCManFM. Also, I'm still not able to get anything to happen when I try to create a new userapp via "Open With" when multiple different files/types are selected.



    Update 2: I have found that the following command almost works:



    update-desktop-database ~/.local/share/applications


    I have set several MIME types to be recognized (5 video formats and 4 image formats) but after running the above commands (and even going as far as rebooting, which has no additional effect), only 1 image format and all 5 video formats have the new right click content menu item show up, even though I see the correct entries for all image types in ~/.local/share/applications/mimeinfo.cache.



    Update 3: It appears that the reason the image formats weren't working is that they were referenced by multiple userapp custom actions. Why can't I have multiple custom actions for a single MIME type? I see it in the system actions and it works fine!



    Update 4: I have been playing around with this for a while now, and at some point about half of my MIME types started showing both custom actions, while the rest did not. But I just discovered that all the custom actions are showing up under the "Open With" sub-menu, whereas in the ones that show up directly in the right-click menu, "Open With" is not a sub-menu. How do I get a consistent behavior across all types to avoid the sub-menu???










    share|improve this question



























      0












      0








      0


      0






      I need to set up a script to run when various types of files are run in PCManFM. I right clicked on a file and used "Open With" to enter the name of the script. After that, I could see the new entry in the context menu when I right clicked, but only on files of the same MIME type as the one I originally created the entry for. So I went into the userapp-...desktop file and edited the MIMEType entry in various ways - first I tried completely deleting it, as I want all files to have this option. Then I tried adding additional MIME types separated by semi-colons. Nothing worked. I tried both running lxpanelctl restart as well as logging out and logging back in after each change. In addition, I tried killall pcmanfm && pcmanfm --desktop --profile lubuntu &.



      I also tried selecting multiple files of different types, right clicking, "open with", "Custom Command Line" and then entering the command to execute and an application name. However, when I do this, the command is not run, nothing is added to the context menu nor is anything created in ~/.local/share/applications.



      What am I doing wrong?



      Update: I tried rebooting the machine and I can now see the entry I created when I right click for all the MIME types I manually added in the .desktop file in `~/.local/share/applications". But having to reboot my machine after any change isn't acceptable and I'm pretty sure there should be a command to refresh PCManFM. Also, I'm still not able to get anything to happen when I try to create a new userapp via "Open With" when multiple different files/types are selected.



      Update 2: I have found that the following command almost works:



      update-desktop-database ~/.local/share/applications


      I have set several MIME types to be recognized (5 video formats and 4 image formats) but after running the above commands (and even going as far as rebooting, which has no additional effect), only 1 image format and all 5 video formats have the new right click content menu item show up, even though I see the correct entries for all image types in ~/.local/share/applications/mimeinfo.cache.



      Update 3: It appears that the reason the image formats weren't working is that they were referenced by multiple userapp custom actions. Why can't I have multiple custom actions for a single MIME type? I see it in the system actions and it works fine!



      Update 4: I have been playing around with this for a while now, and at some point about half of my MIME types started showing both custom actions, while the rest did not. But I just discovered that all the custom actions are showing up under the "Open With" sub-menu, whereas in the ones that show up directly in the right-click menu, "Open With" is not a sub-menu. How do I get a consistent behavior across all types to avoid the sub-menu???










      share|improve this question
















      I need to set up a script to run when various types of files are run in PCManFM. I right clicked on a file and used "Open With" to enter the name of the script. After that, I could see the new entry in the context menu when I right clicked, but only on files of the same MIME type as the one I originally created the entry for. So I went into the userapp-...desktop file and edited the MIMEType entry in various ways - first I tried completely deleting it, as I want all files to have this option. Then I tried adding additional MIME types separated by semi-colons. Nothing worked. I tried both running lxpanelctl restart as well as logging out and logging back in after each change. In addition, I tried killall pcmanfm && pcmanfm --desktop --profile lubuntu &.



      I also tried selecting multiple files of different types, right clicking, "open with", "Custom Command Line" and then entering the command to execute and an application name. However, when I do this, the command is not run, nothing is added to the context menu nor is anything created in ~/.local/share/applications.



      What am I doing wrong?



      Update: I tried rebooting the machine and I can now see the entry I created when I right click for all the MIME types I manually added in the .desktop file in `~/.local/share/applications". But having to reboot my machine after any change isn't acceptable and I'm pretty sure there should be a command to refresh PCManFM. Also, I'm still not able to get anything to happen when I try to create a new userapp via "Open With" when multiple different files/types are selected.



      Update 2: I have found that the following command almost works:



      update-desktop-database ~/.local/share/applications


      I have set several MIME types to be recognized (5 video formats and 4 image formats) but after running the above commands (and even going as far as rebooting, which has no additional effect), only 1 image format and all 5 video formats have the new right click content menu item show up, even though I see the correct entries for all image types in ~/.local/share/applications/mimeinfo.cache.



      Update 3: It appears that the reason the image formats weren't working is that they were referenced by multiple userapp custom actions. Why can't I have multiple custom actions for a single MIME type? I see it in the system actions and it works fine!



      Update 4: I have been playing around with this for a while now, and at some point about half of my MIME types started showing both custom actions, while the rest did not. But I just discovered that all the custom actions are showing up under the "Open With" sub-menu, whereas in the ones that show up directly in the right-click menu, "Open With" is not a sub-menu. How do I get a consistent behavior across all types to avoid the sub-menu???







      lubuntu pcmanfm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 15 '18 at 16:34







      Michael

















      asked Dec 15 '18 at 5:00









      MichaelMichael

      2611312




      2611312






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1101009%2fpcmanfm-not-recognizing-multiple-mime-types%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1101009%2fpcmanfm-not-recognizing-multiple-mime-types%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?