How to set image open-with via terminal?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I am running openbox and so do not have access to standard Ubuntu control panel, but must set everything from the terminal. When I download an image in chrome and click open, it launches xdg-open which then launches an arbitrary program (it resorts to Internet Explorer on wine if I uninstall those programs).



How do I control which program is loaded for an image of type .jpg (and others)?







share|improve this question
























    up vote
    1
    down vote

    favorite












    I am running openbox and so do not have access to standard Ubuntu control panel, but must set everything from the terminal. When I download an image in chrome and click open, it launches xdg-open which then launches an arbitrary program (it resorts to Internet Explorer on wine if I uninstall those programs).



    How do I control which program is loaded for an image of type .jpg (and others)?







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am running openbox and so do not have access to standard Ubuntu control panel, but must set everything from the terminal. When I download an image in chrome and click open, it launches xdg-open which then launches an arbitrary program (it resorts to Internet Explorer on wine if I uninstall those programs).



      How do I control which program is loaded for an image of type .jpg (and others)?







      share|improve this question












      I am running openbox and so do not have access to standard Ubuntu control panel, but must set everything from the terminal. When I download an image in chrome and click open, it launches xdg-open which then launches an arbitrary program (it resorts to Internet Explorer on wine if I uninstall those programs).



      How do I control which program is loaded for an image of type .jpg (and others)?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 11 '13 at 18:47









      user1122069

      528




      528




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          1. Run the command nano ~/.local/share/applications/mimeapps.list (to set for your user only) or sudo nano /usr/share/applications/mimeapps.list (to set for all users).

          2. Find the mime type of the file you want to change (.jpg is image/jpeg). You can find the mime type with the command file --mime-type -b filename

          3. Replace (or add) the line so it reads image/jpeg=eog.desktop (replacing image/jpeg with the type and eog.desktop with the .desktop which you want to use to launch the program.

          Note:

          If you are using /usr/share/applications/mimeapps.list, you may need to create it see here: Default Applications - ArchWiki






          share|improve this answer






















            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            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%2f306965%2fhow-to-set-image-open-with-via-terminal%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            1. Run the command nano ~/.local/share/applications/mimeapps.list (to set for your user only) or sudo nano /usr/share/applications/mimeapps.list (to set for all users).

            2. Find the mime type of the file you want to change (.jpg is image/jpeg). You can find the mime type with the command file --mime-type -b filename

            3. Replace (or add) the line so it reads image/jpeg=eog.desktop (replacing image/jpeg with the type and eog.desktop with the .desktop which you want to use to launch the program.

            Note:

            If you are using /usr/share/applications/mimeapps.list, you may need to create it see here: Default Applications - ArchWiki






            share|improve this answer


























              up vote
              1
              down vote













              1. Run the command nano ~/.local/share/applications/mimeapps.list (to set for your user only) or sudo nano /usr/share/applications/mimeapps.list (to set for all users).

              2. Find the mime type of the file you want to change (.jpg is image/jpeg). You can find the mime type with the command file --mime-type -b filename

              3. Replace (or add) the line so it reads image/jpeg=eog.desktop (replacing image/jpeg with the type and eog.desktop with the .desktop which you want to use to launch the program.

              Note:

              If you are using /usr/share/applications/mimeapps.list, you may need to create it see here: Default Applications - ArchWiki






              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                1. Run the command nano ~/.local/share/applications/mimeapps.list (to set for your user only) or sudo nano /usr/share/applications/mimeapps.list (to set for all users).

                2. Find the mime type of the file you want to change (.jpg is image/jpeg). You can find the mime type with the command file --mime-type -b filename

                3. Replace (or add) the line so it reads image/jpeg=eog.desktop (replacing image/jpeg with the type and eog.desktop with the .desktop which you want to use to launch the program.

                Note:

                If you are using /usr/share/applications/mimeapps.list, you may need to create it see here: Default Applications - ArchWiki






                share|improve this answer














                1. Run the command nano ~/.local/share/applications/mimeapps.list (to set for your user only) or sudo nano /usr/share/applications/mimeapps.list (to set for all users).

                2. Find the mime type of the file you want to change (.jpg is image/jpeg). You can find the mime type with the command file --mime-type -b filename

                3. Replace (or add) the line so it reads image/jpeg=eog.desktop (replacing image/jpeg with the type and eog.desktop with the .desktop which you want to use to launch the program.

                Note:

                If you are using /usr/share/applications/mimeapps.list, you may need to create it see here: Default Applications - ArchWiki







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 30 '13 at 21:30

























                answered Aug 30 '13 at 21:25









                kiri

                18k125799




                18k125799






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f306965%2fhow-to-set-image-open-with-via-terminal%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Which professions warranted travel in Medieval times?

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error