
Root Actions Servicemenu
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
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.
2.9.1 Translation and bugfix release 3 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)
2.9.1 Translation and bugfix release 3 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)
snowhog
12 years ago
Adept Manager shows as installed:
kdesudo 2.5.1-0ubuntu3
kdesudo-kde4 3.0-0ubuntu1
From a console, the command results in a prompt (GUI) for my user password. After typing that in, the console returns:
sh: kate: not found
All other Root Actions function (just tested them).
My %PATH shows:
/usr/lib/kde4/bin:/usr/lib/kde4/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
sudo find / -mount -name kate results in:
/root/.kde4/share/apps/kate
/usr/lib/kde4/bin/kate
/usr/lib/kde4/share/doc/kde4/HTML/en/kate
/usr/lib/kde4/share/kde4/apps/kate
Report
snowhog
12 years ago
"My $PATH shows:"
Report
kubicle
12 years ago
In the mean time, as a workaround, try running with the absolute path to kate:
"rootactions-servicemenu.pl open_with /usr/lib/kde4/bin/kate /boot/grub/menu.lst"...and if that works you can change the command accordingly in the 11-rootactionsfiles.desktop file as well.
Also, this issue is probably specific to hardy (with it's dual KDE installations), so if you're planning on upgrading to intrepid that will fix it.
Report
snowhog
12 years ago
Untitled - /USR/LIB/KDE4/BIN/KATE OPENED AS ROOT
Console output shows:
[email protected]:~$ rootactions-servicemenu.pl open_with /usr/lib/kde4/bin/kate /boot/grub/menu.lst
kate(9605): createDoc
kate(9605) KateSessionManager::KateSessionManager: LOCAL SESSION DIR: "/root/.kde4/share/apps/kate/sessions"
kate(9605) KateApp::initKate: Setting KATE_PID: ' 9605 '
kate(9605) KateViewDocumentProxyModel::updateBackgrounds: false
kate(9605) KateMainWindow::KateMainWindow: **************************************************************************** 0x8280bf0
kate(9605) KateViewDocumentProxyModel::updateBackgrounds: false
kate(9605) KateViewDocumentProxyModel::updateBackgrounds: false
kate(9605) KateDocManager::slotDocumentNameChanged: docname changed: "Untitled" -----> "Untitled"
kate(9605) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
kate(9605) KateDocManager::slotDocumentNameChanged: docname changed: "Untitled" -----> "menu.lst"
kate(9605) KateViewDocumentProxyModel::updateBackgrounds: false
kate(9605) KateApp::startupKate: KateApplication::init finished successful
QDBusConnection received a message of type 3 that it shouldn't have
error: "org.freedesktop.DBus.Error.ServiceUnknown" "The name org.kde.kded was not provided by any .service files"
kate(9605) KToolInvocation::klauncher: klauncher not running... launching kdeinit
kdeinit4: preparing to launch /usr/lib/kde4/lib/kde4/libexec/klauncher
kdeinit4: Launched KLauncher, pid = 9614 result = 0
kdeinit4: opened connection to :0.0
kdeinit4: preparing to launch /usr/lib/kde4/bin/kded4
kdeinit4: Launched KDED, pid = 9616 result = 0
kdeinit4: Got EXT_EXEC '/usr/lib/kde4/bin/kbuildsycoca4' from launcher.
kdeinit4: preparing to launch /usr/lib/kde4/bin/kbuildsycoca4
kbuildsycoca4 running...
kbuildsycoca4(9620) kdemain: Reusing existing ksycoca
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> field in "/usr/share/mime/application/x-vmware-team.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> field in "/usr/share/mime/application/x-vmware-vmdisk.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/application/x-mswinurl.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/application/x-vmware-vm.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/application/x-vmware-snapshot.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/application/x-vmware-vmfoundry.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/application/x-dbm.xml"
kbuildsycoca4(9620) KBuildMimeTypeFactory::createEntry: Missing <comment> fieldin "/usr/share/mime/text/x-ksysv-log.xml"
kbuildsycoca4(9620) KConfigGroup::readXdgListEntry: List entry Categories in "/usr/share/applications/kde/kontactdcop.desktop" is not compliant with XDG standard (missing trailing semicolon).
kdeinit4: PID 9620 terminated.
kdeinit4: Got EXEC_NEW 'kconf_update' from launcher.
kdeinit4: preparing to launch /usr/lib/kde4/lib/kde4/libexec/kconf_update
kdeinit4: PID 9623 terminated.
kdeinit4: PID 9616 terminated.
kdeinit4: Got EXEC_NEW 'kconf_update' from launcher.
kdeinit4: preparing to launch /usr/lib/kde4/lib/kde4/libexec/kconf_update
kdeinit4: PID 9624 terminated.
Ctrl+C terminates the process and the Kate window closes.
Report
kubicle
12 years ago
Report
ricnar456
12 years ago
how solve this i use dolphin in kde4.1?
ricnar
Report
kubicle
12 years ago
You can check your $PATH directories with the command:
echo $PATH
Report
ricnar456
12 years ago
ricnar
Report
xiongchiamiov
12 years ago
First, I used to use the right-click open space -> open root terminal here all the time, but I don't have any options unless I'm right-clicking on a file.
Second, there's one root actions menu for "open as text", and one for the rest.
Third, both of those are submenus under actions.
I'm not sure if this is just the way you coded the dolphin version, or if it's a bug, but I wish I had all the nifty options I had in konqueror from this.
Report
kubicle
12 years ago
Unfortunately these issues seem to be with upstream dolphin.
1. The empty space seems 'dead' when it comes to service menus, the menus only show if clicked on file or folder, there's not much I can do about that.
2. Dolphin doesn't merge menus with the same name (like konqueror does), so it shows two menus instead of one (which two depends on whether you clicked a file or folder).
(This can probably be worked around by creating only two .desktop files, one for files and one for folders...and adding the menu items that are common to both types in each .desktop file...I'll look into it in the next release)
Report
xiongchiamiov
12 years ago
Report
mapi
13 years ago
http://mandriva.99k.org/
Report
jihemd
13 years ago
I can complete the french translation if needed (where can I send the translated files?)
1° In mandriva 2008 pwp, KDEHOME does'nt exist, the kdeglobals can be found at :
/var/lib/mandriva/kde-profiles/common/share/config/kdeglobals
2°Unfortunately the french language var in this file is :
Language=fr_FR.UTF-8:fr
so get_kde_language return a wrong value
I have inserted a strait nasty workaround (I am not a Perl programmer but a Pascal one)
$LANG = "fr";
return 0
Report
kubicle
13 years ago
Thanks for the bug report, I'll look into the language detection routine to make it more robust.
Could you post (or email) what the console command:
'kreadconfig --group Locale --key Language'
returns in your Mandriva?
Report
jihemd
13 years ago
fr_FR.UTF-8:fr
in my french version of Mandriva 2008 pwp
but :
egrep '^Language=' /var/lib/mandriva/kde-profiles/common/share/config/kdeglobals | cut -d ':' -f 1
returns :
Language=fr_FR.UTF-8
it should be : 'fr' ?!
as with :
`egrep '^Language=' /var/lib/mandriva/kde-profiles/common/share/config/kdeglobals | cut -d ':' -f 2`
Report
kubicle
13 years ago
Should be fixed in 2.1.2, which I'll be uploading shortly.
Report
jihemd
13 years ago
in mandriva 2008 fr version all seems to work nicely
Report
5x5
13 years ago
Report
felmur
13 years ago
I've add this to my personal package builder:
sed -i "s/open_with konqueror %U/open_with konqueror %U --caption \"ROOT FILEMANAGER\"/" Root_Actions_2.0.1/10-rootactionsfolders.desktop
sed -i "s/open_with kate %U/open_with kate %U --caption \"EDITING AS ROOT\"/" Root_Actions_2.0.1/11-rootactionsfiles.desktop
These changes remember me that I've opened an application as root.
Report
kubicle
13 years ago
Personally I use a different color scheme for 'root' apps as a reminder, but I realize that not everyone does, so I'll look into adding a 'root reminder' into the next non-translation release.
I'll probably implement it in the perl-script for the strings to be translatable and effecting all apps started with the menu (not just konqueror and kate)
Something like "Kate in Root Mode", "Konqueror as Root" or "KWrite Opened as Root", I'll give it some thought.
Report
Jabadabadoo
13 years ago
Report
LocoMojo
13 years ago
Is it possible to add a "Move to trash/Delete" function?
Of course, one could open Dolphin as root then delete files to one's heart's content, but that would be rather dangerous. Would be cool to open Dolphin as a regular user then if need be, delete files owned by root via Root Actions.
LocoMojo
Report
LocoMojo
13 years ago
It doesn't work as well in Dolphin as it does in Konqueror. Only "open as text" works in Dolphin.
Sorry about that.
LocoMojo
Report
kubicle
13 years ago
1. ServiceTypes=all/all doesn't seem to work at all on dolphin, changing it to ServiceTypes=all/allfiles,inode/directory in rootactionsall.desktop should bring back the majority of the actions.
2. Dolphin doesn't support _SEPARATOR_s, removing them makes it a bit cleaner.
3. Dolphin doesn't merge the menus, showing two menus instead...the only solution I can think of for this is to merge the menus in a single .desktop file
So it isn't impossible to get it to work with dolphin, but it needs a bit of work...Maybe I should make dolphin version into the package as well.
Report
darky0505
13 years ago
Report