Root Actions Servicemenu

Dolphin Service Menus

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

51
8.6
Description:

Version: 2.9.1
***KNOWN ISSUES***
KDE Applications 17.04 release has disabled running kate (and dolphin) as root.

I'm looking into using sudoedit in the menu, but unfortunately it's a bit trickier than I would have thought mainly because it's not trivial to use a graphical password dialog with sudoedit within the menu script (without external helpers).

Hopefully I'll come up with a workable solution, but cannot give a definite time line.

And there's nothing I can do about dolphin (there's currently no work arounds for it like there is for kate).

***IMPORTANT***
- You need to have "ruby" installed for Automatic installation to work
- Make sure you get the latest version, the automatic download from dolphin seems to download a really old version (2.7.3) for some mysterious reason. Manual download from kde-apps/kde-look will guarantee you'll get the latest version.
****

***NOTES***
- From version 2.8 onwards, Root Actions only supports KDE4 or later...Files from version 2.7.3 are included in the package for KDE3 users.
- My mail address can be found in the README file in the package if you wish to contact me for translations or feedback (You can of course also post a comment here)
- I can't test the menu on KDE3 anymore, so I can't guarantee the menu works 100% on KDE3
- Full Kf5 support is work in progress, but the menu should work on kf5 as is.

*************

Root Actions servicemenu provides a convenient way to perform several actions 'as root', from the right-click context menu in KDE filemanagers.

It aims to be distribution agnostic, if you experience issues in your distribution, drop me an email describing the issue.

The menu needs a properly configured kdesu/kdesudo to work (kdesudo is preferred, for some added functionality, like remembering password for a period of time...timeout is configurable by sudo settings)

Any comments, criticism and improvement suggestions welcomed :)

Included in the download are .desktop file versions for KDE3 konqueror, KDE3 dolphin, KDE4 and KF5 (both konqueror and dolphin) and an importable user action xml file for krusader KDE4...see installation for details.

README:

I've dropped version 1.x from the package since 2.x is stable and can do a lot more than 1.x. If you're still interested in the 1.x version, drop me a mail and I'll send it to you.

Thanks to:
Stefan Majewsky - German translation (1.1.x and 2.x)
Pierre Buard - French translation (1.1.x)
Guillaume Millet &
Jean-Marc Detourmignies - French translation (2.x)
Alessio - Italian translation (1.1.x)
Massimo Pissarello - Italian translation (2.x)
João Pedro Gomes - Portuguese translation (2.x)
Viruscg - Brazilian Portuguese translation (1.1.x amd 2.x partial)
Eduardo Grau - Spanish translation (1.1.x and 2.x)
Kenny Verstraete - Dutch translation (1.1.x and 2.x)
Paul Körössy - Hungarian translation (2.x)
nikt_taki - Polish translation (2.x)
Andreas Nordal - Norwegian translation (2.x)
Jakub Matas - Czech translation (2.x)
Donatas Glodenis - Lithuanian translation (2.x)
Mladen Pejaković - Serbian translation (2.x)
Netrebin Alexey - Russian translation (2.x)
Cihat Imamoglu - Turkish translation (2.x)
Manuel Tortosa Moreno - Catalan translation (2.x)
Neo Tet - Greek translation (2.x)
Adrián Chaves Fernández - Galician translation (2.x)
Mihael Simonič - Slovene translation (2.x)
Niklas Åkerström - Swedish translation (2.x)
Maz_1 - Simplified Chinese (2.x)

----Requirements:-----------------------------------------------------
Essential: (these should already be installed on a standard KDE installation)
perl -the script is written in perl
kdesu | kdesudo -to gain administrative privileges
kdialog -to show dialogs
kreadconfig -to read kde configuration
dolphin | konqueror -filemanager
kwrite | kate -editor
ark -handles compression

Optional:
krename -for multiple file (batch) renaming
krusader -to use the included krusader actions
xdg-utils -for default application support (2.5.x-)

----Installation:-----------------------------------------------------

Some distributions have packages available in either their main repos or community repos. For easy installation and possible distro specific patches you can use them if available. Manual installation instructions below:

Version 2.3 ->
1. Uncompress the rootactions-servicemenu.pl script in Root_Actions_2.x to a directory in your $PATH. /usr/local/bin or /usr/bin are two valid options. Make the script executable (if it's not).

2a. (Konqueror for KDE3) Uncompress the three .desktop files in /konqueror-KDE3 to ~/.kde/share/apps/konqueror/servicemenus (This will enable the menu for individual users, if you wish to enable the menu for all users, copy the files to /usr/share/apps/konqueror/servicemenus instead).

2b. (Dolphin for KDE3) Uncompress the two .desktop files in /dolphin-KDE3 to ~/.kde/share/apps/d3lphin/servicemenus (This will enable the menu for individual users, if you wish to enable the menu for all users, copy the files to /usr/share/apps/d3lphin/servicemenus instead).

2c. (Dolphin and Konqueror for KDE4) Uncompress the two .desktop files in /dolphin-KDE4 to your kde4 servicemenu folder (possibly ~/.kde/share/kde4/services/ServiceMenus...although $KDEHOME [".kde"] can be something else in your distribution). If you wish to use konqueror instead of dolphin as your filemanager, edit 10-rootactionsfolders.desktop by changing 'dolphin' to 'konqueror'.

2d. (Dolphin and Konqueror for Kf5) Copy the two .desktop files in /dolphin-KDE4 to your kf5 servicemenu folder (likely ~/.local/share/kservices5/ServiceMenus). If you wish to use konqueror instead of dolphin as your filemanager, edit 10-rootactionsfolders.desktop by changing 'dolphin' to 'konqueror'.

2e. (Krusader for KDE4) Import krusader_rootactions.xml file in /krusader-KDE4 with krusader's action manager.

----Available Actions----------------------------------------------------------------

Version 2.x
- Open Terminal Here (folders) - open a root terminal session in chosen folder
- Open in File Manager (folders) - open chosen folder(s) in file manager
- Open as Text (files) - open chosen folder(s) in text editor
- Open With ... (both) - open chosen items in a program of your choice

- Copy (both) - copy a single file or folder (ADDED in 2.1)
- Move/Rename (both) - if multiple items selected and a batch renamer installed (default is krename) start renamer, otherwise use a simple move/rename dialog
- Compress (both) - Compress selected files/folders (ADDED in 2.7)
- Delete (both) - Completely removes chosen items (as this is potentially hazardous, there is an extra confirmation dialog), handy for removing back-up files etc.

- Ownership to Root (both) - change ownership of chosen items to root:root
- Ownership to Active User (both) - change ownership of chosen items to current user
- Ownership to ... (both) - change ownership of chosen items to UID:GID of your choice

- Change Permissions (both) - change permissions of chosen items
If only a single folder is selected, permissions/ownership can be set recursively. If changing permissions recursively, files are only set executable if they already are executable (Otherwise all files in a directory would be set executable if the parent folder is set executable, which is necessary for the folder to be accessible)


----Translating and customizing:-----------------------------------------------------

Read the README file in the package for instructions on translating and customizing the menu


----Disclaimer-------------------------------------------------------

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
Last changelog:

2.9.1 Translation and bugfix release 4 years ago

- Rename install script to avoid confusion (remove "KDE4" part)
- Bugfix for Chinese localization support (thanks to maz_1)
- Added simplified chinese translation (thanks to maz_1)

(Full changelog available within the package)

olegue

9 years ago

The fix of the line 843 doesn't make things better . I receive still the same massage : Cannot execute command ' 'rm -f -r' /home/mine/Desktop/probe.tar.gz'.

OpenSuSE 11.4 x64 KDE4.6 .

Report

C

kubicle

9 years ago

Thanks for the report.

Are you sure you're getting the error from the rootactions menu?

The script does not run "rm -r -f" at any point.

When you delete an item with the menu, it should run (if using kdesu):
kdesu -d -c "'rootactions-servicemenu.pl' do_delete '/path/to/target'", and the actual removal is done with:
rm -r --preserve-root '/path/to/target'

I'll look into it, but would gladly accept any additional details on the issue (if you have them).


Report

C

kubicle

9 years ago

Correction: "rm -f -r"

Report

olegue

9 years ago

I downloaded Root Actions Servicemenu
2.7 yesterday and installed it, checked for the permitions of the installed files.
The command "root menu" appeared in contex menu as it expected. On execution it askes me for the root password and then I receive that message.
I tried also installing it in my home folder. After installation I tried it again and again I receive that message.

I tried with executing the command rm -r --preserve-root '/path/to/target' from a console and it worked fine without asking me for the password.The file was deleted.

Then I tried kdesu -d -c "'rootactions-servicemenu.pl' do_delete '/path/to/target'" - it asked me for the password, I entered the pass and it accepted it , there were no message , but the file was not deleted.

Report

C

kubicle

9 years ago

Thanks for the additional info, I'll look into it. I'll be going away for the weekend, so I can't get to this until next week, but if you could answer a few more questions I'd have a bit more to chew on once I get back:

1. Do you get an error for all actions (or just delete)?

2. What is the output if you run 'whereis rootactions-servicemenu.pl' in a terminal?

3. Can you post the output if you run 'rootactions-servicemenu.pl root_delete /path/to/the/file_you_wish_to_delete' in a terminal (to see if the menu reports any errors in the terminal)

Report

olegue

9 years ago

1. Do you get an error for all actions (or just
delete)?

YES

2. What is the output if you run 'whereis
rootactions-servicemenu.pl' in a terminal?


[email protected]:~> whereis rootactions-servicemenu.pl
rootactions-servicemenu: /usr/bin/rootactions-servicemenu.pl /usr/bin/X11/rootactions-servicemenu.pl
[email protected]:~>

3. Can you post the output if you run
'rootactions-servicemenu.pl root_delete
/path/to/the/file_you_wish_to_delete' in a
terminal (to see if the menu reports any errors in
the terminal)

[email protected]:~> rootactions-servicemenu.pl root_delete /home/two/Desktop/123.txt
which: no kdesudo in (/usr/lib64/mpi/gcc/openmpi/bin:/home/two/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin)
[email protected]:~>

Report

C

kubicle

9 years ago

I finally managed to find the time to check out opensuse 11.4, and I noticed similar errors with the menu...so I think that confirms the issue.

This is not the same "bug" as the one fixed with the "-c" option, though, and so far seems to be present in opensuse only (the few other distros I've tried it with work as expected with either kdesu or kdesudo...with KDE 4.6.2).

I'm not that familiar with the internals of opensuse, so it may take me a while to get this one fixed. But I'll keep it open and try to dig in a bit more.

Report

C

kubicle

9 years ago

And I'm back, thanks for responding...again :)

Nothing immediately apparent there so I might need to grab a copy of OpenSuse to see what's going on...I'll report any progress here.

I assume /usr/bin/X11 is a symlink to /usr/bin...so you don't actually have to versions of the script installed?

Report

olegue

9 years ago

I get error for all the actions.

Report

9

snowhog

9 years ago

I've been using your utility since I was made aware of it - several years ago - and it is one of the first things that gets installed after the installation of a new version of Kubuntu.

Thank you in spades. This is one of the most beneficial utilities I've seen. It should be included 'by default' in the *buntu distributions.

Report

9

bugmenot1234

9 years ago

This has nothing to do with your great app. I'm taking this to krusader as it originates with them.

Sorry and thanks.

Report

C

kubicle

9 years ago

Looks like krusader was hit by the same bug/change in kdesu that affected this service menu.

As you figured out, the issue lies with krusader.

Report

9

bugmenot1234

9 years ago

First, I love this app. I've been using it for years now...ever since OpenSuse 10.1 and it works great.

I've been having a little problem with it lately though. Everything seems to work except "Start Krusader in root mode". Yeah, I forgot to mention I use Krusader exclusively.

Anyway, when I press this button it asks for the root password and when I provide it I get an error that says.

Cannot execute command ' '/usr/bin/krusader --left=file:///home/blah/blah/blah --right=file:///''.

I'm using OpenSuse 11.4 with KDE 4.6.00.

I know birdflesh described this and noted a change to a line of the script. I already checked the line and it fine.

$SUCOMMAND = "$KDEBINPATH"."kdesu -d -c"}

I believe the problem lies in the quotation marks here:

exec "$SUCOMMAND \"\'$EXECNAME\' do_root_konsole \'$APPNAME\' \'$WORKDIR\'\"";

Can anybody help with this?

Thanks.

Report

9

srog

9 years ago

Kubuntu 10.10, KDE 4.5.1

The desktop files are installed to the ~/.kde/share/kde4/services/ServiceMenus/. The perl script is not installed.

The first kdialog is not shown. From the commandline (servicemenuinstallation /home/rog131/.kde/share/apps/servicemenu-download/48411-rootactions_servicemenu_2.6.94.tar.gz) The error message:
"kdialog: Unknown option 'yes-label'."


Kubuntu 11.04 (alpha), KDE 4.6.0

The ruby script can't find the installKDE4.sh -> an KDE error notification. Ubuntu bug 667704.

Report

C

kubicle

9 years ago

1. Looks like changing button labels in kdialog is for kde sc 4.6> only...I'll work around that in the next version.

2. Hmm...works ok here on 4.6 Natty (with ruby installed). I'll try to investigate

Report

9

srog

9 years ago

"2. Hmm...works ok here on 4.6 Natty (with ruby installed). I'll try to investigate"

The workaround (at here) to get the "Dolphin Download New Services" to work is so strange that i could have a borked installation.

I wouldn't use much time to investigate it.

It is possible that the workaround is working with the dropbox servicemenu but wouldn't work with the rootactions..

Report

birdflesh

10 years ago

No rootactions option works for me since I upgraded to kde 4.6. After I enter my password I always get a Cannot execute command ' ''\''/usr/bin/rootactions-servicemenu.pl'\'.... This was probably caused by changes in kde's kdesu. kdesudo is not easily available in my distribution (arch linux), so I was hoping if you could take a look at this. Thanks!

Report

C

kubicle

9 years ago

Issue confirmed...didn't have much time to dig into it, but seems like an issue with nesting double/single quotes.

Example (with kdesu)
if I run
kdesu "'kate' 'foo'"
the resulting command shown in the kdesu dialog is:
-in kde sc 4.5.5: 'kate' 'foo'
-in kde sc 4.6.0: ''\"kate'\" '\".bashrc'\"'
(So we basically have escaped double quotes after each single quote, and then the whole thing wrapped inside single quotes...say what now?)

Theoretically, I might be able work around this within the script. But because it would require quite a bit of rewriting and testing, and (more importantly) because it would more than likely cause different breakage/problems somewhere else, I'd gladly wait a bit until either the issue gets fixed in kde/kdesu or I understand why 4.6 kdesu behaves as it does (if the change was intentional).

In the meantime, you could try using kdesudo (I seem to recall kdesudo is available in the AUR repositories for Arch), as it still works as expected (more accurately, as *I* expect)...although there was a similar issue with kdesudo quite some time ago (which was eventually fixed).

Report

birdflesh

9 years ago

Actually I have an one(!) character fix for this. In rootactions-servicemenu.pl line 843, if you change "kdesu -d --" to "kdesu -d -c" everything works again. I believe that this commit http://websvn.kde.org/?view=revision&revision=1196645 is the one changing kdesu's previous behavior. I hope that it still works with previous kde versions (can't test it myself right now). Anyway thanks for taking your time on this and for all your fine work!

Report

C

kubicle

9 years ago

Version 2.6.92 uploaded with the bytesize change.

Thanks again for the report and the detective work.

Report

C

kubicle

9 years ago

Excellent.

I'll upload the fix for testing ASAP (it shouldn't break anything).

Report

C

kubicle

10 years ago

I'll add that to my list of things to do.

Thanks for reporting.

Report

9

srog

10 years ago

The Dolphin is offering an option to download/install: Dophin > Configure Dolphin > Services > Download New Services.

Those users who are using the "Dolphin Download New Services" action are wondering why it is not working.
(https://lists.ubuntu.com/archives/kubuntu-devel/2011-January/004961.html)

The Rootactions has good installation instructions but they are not showing when you are using "Dolphin Download New Services", :(

The installer is using a (ruby) script /usr/bin/servicemenuinstallation. And the installation script is looking:

# try: install-it.sh
# try: install-it
# try: installKDE4.sh
# try: installKDE4
# try: install.sh
# try: install


Take care
Rog131

Report

C

kubicle

10 years ago

Thanks for the suggestion Rog.

I'll look into it, but something tells me that the need to copy the perl script into a root owned directory (/usr/bin) might provide a few obstacles for the install script (and I'm not confortable with installing the script under $HOME security-wise).

I'll see if I can make an install script that can handle it nicely.

All suggestions welcomed :)

Report

9

srog

9 years ago

The Dropbox ServiceMenu (http://kde-apps.org/content/show.php?content=124416) 3rd page. "KHNS by TheUserK on: Jun 8 2010".

Has info of the service-menu-installation via the Dolphin/Konqueror. It has nice install/deinstall example scripts but they are for the non-root.

The "Dolphin Download New Services" is not working at here. (KDE 4.4 - 4.6). The servicemenuinstallation is dying with the "service menu installation failed" error.

A bug report for the Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dolphin/+bug/667704.

Report

2.9.1 Translation and bugfix release 4 years ago

- Rename install script to avoid confusion (remove "KDE4" part)
- Bugfix for Chinese localization support (thanks to maz_1)
- Added simplified chinese translation (thanks to maz_1)

(Full changelog available within the package)

12345678910
11492
product-maker rasool-deldar Aug 30 2020 10 the best
10 the best
product-maker BJIacTeJIuH Jul 21 2020 7 good
"KDE Applications 17.04 release has disabled running kate (and dolphin) as root." Well, Yes, it is disabled, but nothing prevents you from downloading the old versions of the Dolphin 16, kwrite 16.12 Rate 16.x packages separately from the archive where all the functions work. Thank you for working with your menu to work in Russian Fedora Remix 31 has become easier and more comfortable !! PS I Apologize for my terrible and crooked English through Yandex translator.
product-maker Nano-Ocelot Jul 23 2019 10 the best
10 the best
product-maker alex1701c Apr 13 2019 9 excellent
+
product-maker m0ji Feb 02 2019 9 excellent
+
product-maker alekksander Dec 28 2018 9 excellent
thanks!
product-maker emplate430 May 19 2018 9 excellent
TY!
product-maker zav444 Nov 02 2017 9 excellent
product-maker floorek Aug 06 2017 9 excellent
product-maker ubo Jun 20 2017 9 excellent
product-maker mockroot Apr 25 2017 9 excellent
product-maker alex-l Mar 17 2017 3 bad
product-maker mirkogennari Jan 25 2017 9 excellent
product-maker Henri Oct 17 2015 9 excellent
product-maker paulus3005 Sep 21 2015 9 excellent
product-maker tomXx Aug 20 2015 9 excellent
product-maker fadnix Aug 19 2015 9 excellent
product-maker gericom Feb 27 2015 9 excellent
product-maker Ironclad Feb 25 2015 9 excellent
product-maker Landis Feb 11 2015 9 excellent
product-maker tanzer Dec 29 2014 9 excellent
product-maker eliaskousk Dec 10 2014 9 excellent
product-maker n-k Aug 25 2014 9 excellent
product-maker roentgen May 18 2014 9 excellent
product-maker evgom May 15 2014 9 excellent
product-maker Meteorrock Apr 29 2014 9 excellent
product-maker Pafrape Apr 07 2014 9 excellent
product-maker bibins Jan 06 2014 9 excellent
product-maker alpvonkri Mar 10 2013 9 excellent
product-maker vatsok Dec 30 2012 9 excellent
product-maker Sweyn78 Sep 10 2012 9 excellent
product-maker RAIDENSUB Aug 15 2012 9 excellent
product-maker lionhater May 18 2012 9 excellent
product-maker JustFoxy May 07 2012 9 excellent
product-maker MountainX Mar 11 2012 9 excellent
product-maker roctheme Jan 27 2012 9 excellent
product-maker aspotashev Nov 19 2011 9 excellent
product-maker glewik Nov 18 2011 9 excellent
product-maker gjk Oct 07 2011 9 excellent
product-maker karton Jul 21 2011 9 excellent
product-maker v01t May 29 2011 9 excellent
product-maker mywereld May 03 2011 9 excellent
product-maker Brutus180 Apr 28 2011 9 excellent
product-maker momonster Apr 12 2011 9 excellent
product-maker rangerGR Mar 26 2011 9 excellent
product-maker steveke Feb 10 2011 9 excellent
product-maker jorssoftware Feb 09 2011 9 excellent
product-maker srog Jan 29 2011 9 excellent
product-maker ubuntuku Jan 04 2011 9 excellent
product-maker cjann Dec 29 2010 9 excellent
product-maker bugmenot1234 Dec 02 2010 9 excellent
product-maker snowhog Oct 31 2010 9 excellent
product-maker dequire Sep 23 2010 9 excellent
Be the first to comment
bialyikar
Oct 24 2020
rasool-deldar
Aug 30 2020
alex1701c
Apr 13 2019
m0ji
Feb 02 2019
Nano-Ocelot
Sep 07 2018
GiuseppeBenigno
Apr 25 2018
SapperStew
Feb 09 2018
jasonwert
Feb 03 2016
fadnix
Aug 11 2015
mopened
Jun 07 2015
gericom
Feb 27 2015
HATRED
Feb 27 2015
Landis
Feb 11 2015
n-k
Aug 25 2014
ksolsim
Aug 22 2014
roentgen
May 18 2014
Meteorrock
Apr 29 2014
janet
Feb 09 2014
Chuck56
Feb 05 2014
alpvonkri
Mar 10 2013
sunbergzach
Jan 05 2013
atenrok
Dec 05 2012
krzywda
Apr 05 2012
MountainX
Mar 11 2012
evgom
Feb 19 2012
aspotashev
Nov 19 2011
devport
Oct 27 2011
diamonds-notebook
May 16 2011
obelix
Mar 26 2011
ubuntuku
Jan 04 2011
cjann
Dec 29 2010
hantsy
Nov 24 2010
AngelBlue01
Sep 14 2010
tetris4
Apr 22 2010
pvt14
Mar 24 2010
mxttie
Jan 12 2010
Flavianoep
Jan 09 2010
floorek
Jan 06 2010
mgranet
Jan 01 2010
michalm
Dec 28 2009
lestek
Nov 04 2009
Yggdrasill
Nov 01 2009
oshunluvr
Oct 19 2009
jihemd
Jul 13 2009
Murz
Jul 07 2009
markwege
May 28 2009
Montblanc
Apr 07 2009
JMB
Apr 01 2009
hurikhan77
Mar 11 2009
snowhog
Feb 07 2009
SeaJey
Jan 04 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
2.9.1
updated Aug 06 2017
added Nov 08 2006
downloads 24h
33
mediaviews 24h 0
pageviews 24h 35
System Tags addon