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

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












4















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




























    4















    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


























      4












      4








      4


      1






      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

























      asked Sep 26 '13 at 14:49







      user32012



























          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

            – user32012
            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

























          • (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
            Jan 21 at 2:30











          • Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

            – n00b
            Jan 21 at 3:54











          • nano is already in the system gedit is not you would need to install it.

            – n00b
            Jan 21 at 3:57






          • 1





            @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

            – user32012
            Jan 21 at 5:59











          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

            – user32012
            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

            – user32012
            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







          user32012



















          • @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

            – user32012
            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

            – user32012
            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

          – user32012
          Mar 24 '15 at 10:07





          @costales - do not know, sorry

          – user32012
          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

























          • (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
            Jan 21 at 2:30











          • Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

            – n00b
            Jan 21 at 3:54











          • nano is already in the system gedit is not you would need to install it.

            – n00b
            Jan 21 at 3:57






          • 1





            @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

            – user32012
            Jan 21 at 5:59
















          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

























          • (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
            Jan 21 at 2:30











          • Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

            – n00b
            Jan 21 at 3:54











          • nano is already in the system gedit is not you would need to install it.

            – n00b
            Jan 21 at 3:57






          • 1





            @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

            – user32012
            Jan 21 at 5:59














          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















          [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














          share|improve this answer



          share|improve this answer








          edited Jan 21 at 2:30









          G-Man

          13.1k93465




          13.1k93465










          answered Jan 21 at 2:10









          n00bn00b

          12




          12












          • (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
            Jan 21 at 2:30











          • Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

            – n00b
            Jan 21 at 3:54











          • nano is already in the system gedit is not you would need to install it.

            – n00b
            Jan 21 at 3:57






          • 1





            @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

            – user32012
            Jan 21 at 5:59


















          • (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
            Jan 21 at 2:30











          • Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

            – n00b
            Jan 21 at 3:54











          • nano is already in the system gedit is not you would need to install it.

            – n00b
            Jan 21 at 3:57






          • 1





            @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

            – user32012
            Jan 21 at 5:59

















          (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
          Jan 21 at 2:30





          (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
          Jan 21 at 2:30













          Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

          – n00b
          Jan 21 at 3:54





          Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version.

          – n00b
          Jan 21 at 3:54













          nano is already in the system gedit is not you would need to install it.

          – n00b
          Jan 21 at 3:57





          nano is already in the system gedit is not you would need to install it.

          – n00b
          Jan 21 at 3:57




          1




          1





          @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

          – user32012
          Jan 21 at 5:59






          @G-Man - not using elementary now but I welcome this answer, as that line seems better. (Maybe a comment would have been preferable, but this is ok for a new user). I would even integrate that to my answer. I prefer gedit on all gtk desktops though, I simply never use nano.

          – user32012
          Jan 21 at 5:59


















          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

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay