How to add 'open folder as root' in Elementary OS file manager context menu?












3















Here it is the solution in order to add the 'open terminal here' into the context menu of Elementary OS' file manager (generically called 'Files' - the executable is pantheon-files).



For that specific demand, the idea is to create the file /usr/share/contractor/terminal.contract and add something like



[Contractor Entry]
Name=Open Terminal here
Icon=terminal
Description=Open Terminal here
MimeType=inode;application/x-sh;application/x-executable;
Exec=pantheon-terminal -d %U
Gettext-Domain=pantheon-terminal


But how to adapt that and have a model to add other commands, namely - following my order of priorities - 'open folder as root'?










share|improve this question





























    3















    Here it is the solution in order to add the 'open terminal here' into the context menu of Elementary OS' file manager (generically called 'Files' - the executable is pantheon-files).



    For that specific demand, the idea is to create the file /usr/share/contractor/terminal.contract and add something like



    [Contractor Entry]
    Name=Open Terminal here
    Icon=terminal
    Description=Open Terminal here
    MimeType=inode;application/x-sh;application/x-executable;
    Exec=pantheon-terminal -d %U
    Gettext-Domain=pantheon-terminal


    But how to adapt that and have a model to add other commands, namely - following my order of priorities - 'open folder as root'?










    share|improve this question



























      3












      3








      3


      2






      Here it is the solution in order to add the 'open terminal here' into the context menu of Elementary OS' file manager (generically called 'Files' - the executable is pantheon-files).



      For that specific demand, the idea is to create the file /usr/share/contractor/terminal.contract and add something like



      [Contractor Entry]
      Name=Open Terminal here
      Icon=terminal
      Description=Open Terminal here
      MimeType=inode;application/x-sh;application/x-executable;
      Exec=pantheon-terminal -d %U
      Gettext-Domain=pantheon-terminal


      But how to adapt that and have a model to add other commands, namely - following my order of priorities - 'open folder as root'?










      share|improve this question
















      Here it is the solution in order to add the 'open terminal here' into the context menu of Elementary OS' file manager (generically called 'Files' - the executable is pantheon-files).



      For that specific demand, the idea is to create the file /usr/share/contractor/terminal.contract and add something like



      [Contractor Entry]
      Name=Open Terminal here
      Icon=terminal
      Description=Open Terminal here
      MimeType=inode;application/x-sh;application/x-executable;
      Exec=pantheon-terminal -d %U
      Gettext-Domain=pantheon-terminal


      But how to adapt that and have a model to add other commands, namely - following my order of priorities - 'open folder as root'?







      files file-manager menu elementary-os






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 29 '13 at 9:17







      cipricus

















      asked Sep 26 '13 at 14:49









      cipricuscipricus

      2,9201253138




      2,9201253138






















          2 Answers
          2






          active

          oldest

          votes


















          10














          In order to create 'Open folder as root' context menu command - and in order to create any new such command - a new *.contract file has to be created in /usr/share/contractor.



          To create the file in gedit:



          sudo gedit /usr/share/contractor/Open_as_admin.contract



          For 'Open folder as root' - that file would have to contain something like



          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=gksudo pantheon-files -d %U
          Gettext-Domain=pantheon-files


          (but no icon appears in te context menu anyway)



          enter image description here






          share|improve this answer


























          • @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

            – costales
            Jan 18 '15 at 16:14






          • 1





            @costales - do not know, sorry

            – cipricus
            Mar 24 '15 at 10:07






          • 3





            If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

            – kagronick
            Jul 19 '15 at 4:43



















          0














          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=/usr/bin/io.elementary.files-pkexec
          Gettext-Domain=pantheon-files


          This worked for me in Elementary OS 5 Juno 01/20/2019.
          Also, use nano instead of gedit.






          share|improve this answer










          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

            – G-Man
            7 mins ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f92494%2fhow-to-add-open-folder-as-root-in-elementary-os-file-manager-context-menu%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          10














          In order to create 'Open folder as root' context menu command - and in order to create any new such command - a new *.contract file has to be created in /usr/share/contractor.



          To create the file in gedit:



          sudo gedit /usr/share/contractor/Open_as_admin.contract



          For 'Open folder as root' - that file would have to contain something like



          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=gksudo pantheon-files -d %U
          Gettext-Domain=pantheon-files


          (but no icon appears in te context menu anyway)



          enter image description here






          share|improve this answer


























          • @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

            – costales
            Jan 18 '15 at 16:14






          • 1





            @costales - do not know, sorry

            – cipricus
            Mar 24 '15 at 10:07






          • 3





            If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

            – kagronick
            Jul 19 '15 at 4:43
















          10














          In order to create 'Open folder as root' context menu command - and in order to create any new such command - a new *.contract file has to be created in /usr/share/contractor.



          To create the file in gedit:



          sudo gedit /usr/share/contractor/Open_as_admin.contract



          For 'Open folder as root' - that file would have to contain something like



          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=gksudo pantheon-files -d %U
          Gettext-Domain=pantheon-files


          (but no icon appears in te context menu anyway)



          enter image description here






          share|improve this answer


























          • @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

            – costales
            Jan 18 '15 at 16:14






          • 1





            @costales - do not know, sorry

            – cipricus
            Mar 24 '15 at 10:07






          • 3





            If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

            – kagronick
            Jul 19 '15 at 4:43














          10












          10








          10







          In order to create 'Open folder as root' context menu command - and in order to create any new such command - a new *.contract file has to be created in /usr/share/contractor.



          To create the file in gedit:



          sudo gedit /usr/share/contractor/Open_as_admin.contract



          For 'Open folder as root' - that file would have to contain something like



          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=gksudo pantheon-files -d %U
          Gettext-Domain=pantheon-files


          (but no icon appears in te context menu anyway)



          enter image description here






          share|improve this answer















          In order to create 'Open folder as root' context menu command - and in order to create any new such command - a new *.contract file has to be created in /usr/share/contractor.



          To create the file in gedit:



          sudo gedit /usr/share/contractor/Open_as_admin.contract



          For 'Open folder as root' - that file would have to contain something like



          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=gksudo pantheon-files -d %U
          Gettext-Domain=pantheon-files


          (but no icon appears in te context menu anyway)



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 25 '15 at 8:56

























          answered Sep 26 '13 at 16:12









          cipricuscipricus

          2,9201253138




          2,9201253138













          • @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

            – costales
            Jan 18 '15 at 16:14






          • 1





            @costales - do not know, sorry

            – cipricus
            Mar 24 '15 at 10:07






          • 3





            If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

            – kagronick
            Jul 19 '15 at 4:43



















          • @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

            – costales
            Jan 18 '15 at 16:14






          • 1





            @costales - do not know, sorry

            – cipricus
            Mar 24 '15 at 10:07






          • 3





            If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

            – kagronick
            Jul 19 '15 at 4:43

















          @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

          – costales
          Jan 18 '15 at 16:14





          @ciprius Great explanation! Do you know if is possible a submenu? Thanks in advance!

          – costales
          Jan 18 '15 at 16:14




          1




          1





          @costales - do not know, sorry

          – cipricus
          Mar 24 '15 at 10:07





          @costales - do not know, sorry

          – cipricus
          Mar 24 '15 at 10:07




          3




          3





          If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

          – kagronick
          Jul 19 '15 at 4:43





          If its not showing up for you make sure you have gksudo installed. I didn't and I had to remove parts of the config file until I realized what was stopping it from showing up.

          – kagronick
          Jul 19 '15 at 4:43













          0














          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=/usr/bin/io.elementary.files-pkexec
          Gettext-Domain=pantheon-files


          This worked for me in Elementary OS 5 Juno 01/20/2019.
          Also, use nano instead of gedit.






          share|improve this answer










          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

            – G-Man
            7 mins ago
















          0














          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=/usr/bin/io.elementary.files-pkexec
          Gettext-Domain=pantheon-files


          This worked for me in Elementary OS 5 Juno 01/20/2019.
          Also, use nano instead of gedit.






          share|improve this answer










          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

            – G-Man
            7 mins ago














          0












          0








          0







          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=/usr/bin/io.elementary.files-pkexec
          Gettext-Domain=pantheon-files


          This worked for me in Elementary OS 5 Juno 01/20/2019.
          Also, use nano instead of gedit.






          share|improve this answer










          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          [Contractor Entry]
          Name=Open folder as root
          Icon=gksu-root-terminal
          Description=Open folder as root
          MimeType=inode;application/x-sh;application/x-executable;
          Exec=/usr/bin/io.elementary.files-pkexec
          Gettext-Domain=pantheon-files


          This worked for me in Elementary OS 5 Juno 01/20/2019.
          Also, use nano instead of gedit.







          share|improve this answer










          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited 7 mins ago









          G-Man

          13k93365




          13k93365






          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 27 mins ago









          n00bn00b

          11




          11




          New contributor




          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          n00b is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.













          • (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

            – G-Man
            7 mins ago



















          • (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

            – G-Man
            7 mins ago

















          (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

          – G-Man
          7 mins ago





          (1) This is the same as the accepted answer except for one line. What is the significance of that line? Is your answer better than the other one? (2) What’s wrong with gedit?

          – G-Man
          7 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f92494%2fhow-to-add-open-folder-as-root-in-elementary-os-file-manager-context-menu%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

          Loup dans la culture

          How to solve the problem of ntp “Unable to contact time server” from KDE?

          ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux