run as root/administrator in right click menu

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
Johannes33
Level 1
Level 1
Posts: 9
Joined: Wed Sep 19, 2018 6:37 am

run as root/administrator in right click menu

Post by Johannes33 » Sat Oct 20, 2018 7:09 pm

Hi,
I have a couple of applications that I would like to run as root.
Most important are emacs and nemo.
I have launchers at the desktop but can not find a convenient way to run them as root other than using the command line.
Thinking about windows where you can right click and run as administrator there must be an equivalent to that on Linux mint cinnamon.
When I google I only find people talking about caja for MATE.
Suggestions?

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: run as root/administrator in right click menu

Post by all41 » Sat Oct 20, 2018 7:15 pm

caja has many other advatages as well
Proud to be a supporter and monthly contributor to Mint.

User avatar
smurphos
Level 8
Level 8
Posts: 2253
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: run as root/administrator in right click menu

Post by smurphos » Sat Oct 20, 2018 7:22 pm

In Nemo right click in any pane to select open as admin.You may need to expand the context menu if you never have before. Small plus sign on the top entry of the context menu.

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: run as root/administrator in right click menu

Post by all41 » Sat Oct 20, 2018 9:17 pm

Right click context --- Advantage--caja
context2.jpg
MATE can handle this easily--and so much more
or you can just settle for this if you use nemo:
context cinnamon.jpg
context cinnamon.jpg (25.82 KiB) Viewed 696 times
Proud to be a supporter and monthly contributor to Mint.

User avatar
smurphos
Level 8
Level 8
Posts: 2253
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: run as root/administrator in right click menu

Post by smurphos » Sat Oct 20, 2018 11:17 pm

It this a competition now? Why? They are both good.

Anyway

Move to in nemo
Image
Scripts in nemo
Image
An example custom action in nemo
Image
Another custom action in nemo
Image
Custom actions on the desktop
Image

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: run as root/administrator in right click menu

Post by all41 » Sat Oct 20, 2018 11:53 pm

Hey smurphos--you know what the deal is.
'Customize' to fit your needs.
Cinnamon has come a long way, and I am especialy impressed with the Tara release.
But for aforementioned reasons I still use MATE as my daily driver.
My wish is that you enjoy your Mint whichever desktop you choose.
God bless,
Proud to be a supporter and monthly contributor to Mint.

User avatar
smurphos
Level 8
Level 8
Posts: 2253
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: run as root/administrator in right click menu

Post by smurphos » Sat Oct 20, 2018 11:59 pm

all41 wrote:
Sat Oct 20, 2018 11:53 pm
Hey smurphos--you know what the deal is.
'Customize' to fit your needs.
Cinnamon has come a long way, and I am especialy impressed with the Tara release.
But for aforementioned reasons I still use MATE as my daily driver.
My wish is that you enjoy your Mint whichever desktop you choose.
God bless,
No worries...to each their own. I like Mate a lot for general use, but can't get on with it's panel management hence it's not my choice of daily driver. But I think the file managers are pretty much at feature parity.

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: run as root/administrator in right click menu

Post by all41 » Sun Oct 21, 2018 12:16 am

smurphos wrote:
Sat Oct 20, 2018 11:59 pm
all41 wrote:
Sat Oct 20, 2018 11:53 pm
Hey smurphos--you know what the deal is.
'Customize' to fit your needs.
Cinnamon has come a long way, and I am especialy impressed with the Tara release.
But for aforementioned reasons I still use MATE as my daily driver.
My wish is that you enjoy your Mint whichever desktop you choose.
God bless,
No worries...to each their own. I like Mate a lot for general use, but can't get on with it's panel management hence it's not my choice of daily driver. But I think the file managers are pretty much at feature parity.
I agree, and as far as
this a competition now? Why? They are both good.
I have previously stated there are desirable features in nemo which I wish caja could handle.
Would it not be great to pick and choose?
but can't get on with it's panel management
Interesting, because I have the same reservations with Cinnamon, where I find panel management difficult
Proud to be a supporter and monthly contributor to Mint.

User avatar
smurphos
Level 8
Level 8
Posts: 2253
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: run as root/administrator in right click menu

Post by smurphos » Sun Oct 21, 2018 12:20 am

all41 wrote:
Sun Oct 21, 2018 12:16 am
Interesting, because I have the same reservations with Cinnamon, where I find panel management difficult
I thinks it's a case of once you know your way around a DE and learn to make it your own it becomes hard to love an alternative.

User avatar
all41
Level 13
Level 13
Posts: 4998
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: run as root/administrator in right click menu

Post by all41 » Sun Oct 21, 2018 12:31 am

I thinks it's a case of once you know your way around a DE and learn to make it your own it becomes hard to love an alternative.
YES,
and I use every Mint DE as well as others, but as you suggest, there is a comfort zone when using your favourite.
Cheers om
Proud to be a supporter and monthly contributor to Mint.

Johannes33
Level 1
Level 1
Posts: 9
Joined: Wed Sep 19, 2018 6:37 am

Re: run as root/administrator in right click menu

Post by Johannes33 » Sun Oct 21, 2018 3:46 pm

Thanks for all the input!

It was interesting to see all the examples.

Now I did see a lot of examples from you smurphos that does not exist in my DE.
Do you have a link to a tutorial or other information on how to get the extra menu items?
e.g. switching workspaces, bulk rename, Media properties, scripts.

Does anyone have a suggestion on how to get run as root with the right click menu. I.e to directly run emacs as root with right clicking the launcher. I know you can first open desktop as root then double click the launcher in the rooted window but I think perhaps there is a more direct way?

Also does anyone know how to make so great screen shots? When I open a menu with a right click my shortcuts for screen shots (printScn, shift-printScn) does not work.

User avatar
smurphos
Level 8
Level 8
Posts: 2253
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: run as root/administrator in right click menu

Post by smurphos » Sun Oct 21, 2018 11:06 pm

For screenshots with visible menus you can use your screenshot GUI utility to take a screenshot with a short delay so you can activate it and then 'set up' your screenshot. You can find the screenshot GUI in the menu under screenshot.

I use this third party Cinnamon panel applet to achieve the same thing - https://github.com/rjanja/desktop-capture

Emacs as Admin - presumably you want the GUI version and not the Terminal version? pkexec emacs25 %F only seems to opens it in a terminal so that's no good.

Easiest way is to navigate to the folder you want in Nemo, right click in empty space in the pane, click open as root. This will open an admin instance of Nemo. From there pick your file and right click to open with Emacs25 (or any other relevant app).

if you want a menu shortcut for Nemo as root you can create a custom launcher in your menu. Right click on your menu applet, choose configure, navigate to menu and then click menu-editor. Navigate to the accessories category. Pick Files and select copy - navigate to the Administration section - select paste. Now select the new Files entry and click Properties. Edit the name to something like Files (Admin) and the command to pkexec nemo %U. Click OK and close down the menu-editor. Your new menu item should launch Nemo as root directly. Hopefully I don't have to say take care with what you do with Nemo as root... :wink: ...it's easy to break things.

To add scripts to Nemo you just drop the executable script file, or a symlink to a script elsewhere into ~/.local/config/nemo/scripts
To add a Nemo custom action you need to add a .nemo_action file to ~/.local/config/nemo/actions

It's worth navigating to both those folders in Nemo and accessing the 'More Info' link in the infobar. - yes I have changed my theme since the last screenshots... :)

Image

Here is the contents of some of my actions.

Next_Workspace.nemo_action - requires xdotool to be installed - apt install xdotool

Code: Select all

[Nemo Action]
Name=Next Workspace
Comment=Change to next workspace
Exec=xdotool key ctrl+alt+Right
Selection=None
Extensions=any;
Icon-Name=go-next-symbolic
Dependencies=xdotool;
Conditions=desktop;dbus org.Cinnamon;
Previous_Workspace.nemo_action - requires xdotool to be installed - apt install xdotool

Code: Select all

[Nemo Action]
Name=Previous Workspace
Comment=Change to previous workspace
Exec=xdotool key ctrl+alt+Left
Selection=None
Extensions=any;
Icon-Name=go-previous-symbolic
Dependencies=xdotool;
Conditions=desktop;dbus org.Cinnamon;
Bulk Rename - requires gprename to be installed - apt install gprename

Code: Select all

[Nemo Action]
Name=Bulk Rename
Comment=Multiple Rename with GPRename.  The action gets executed for the marked or the higher level directory.
Exec=gprename %F
Selection=m
Extensions=any;
EscapeSpaces=true
Dependencies=gprename;
Media Info - requires mediainfo-gui to be installed apt install mediainfo-gui

Code: Select all

[Nemo Action]
Name=Media properties
Comment=Media properties
Exec=mediainfo-gui %F
Icon-Name=mediainfo
Selection=S
Extensions=mp4;mkv;avi;flv;wmv;mp3;oga;jpg;jpeg;gif;
EscapeSpaces=true
Dependencies=mediainfo-gui;

Post Reply

Return to “Cinnamon”