How-To: Create an Open as Root Service Menu in Dolphin and Konqueror (KDE4)

Posted by Chris7mas on Mar 31, 2009 9:16 PM EDT
Tux Arena; By Craciun Dan
Mail this story
Print this story

Not so long ago I put up a tutorial which included three useful tips for Konqueror 3.5.9 (KDE3), and one of them was how to create an Open as Root service menu for directories. In this how-to I will show how to accomplish the same thing in KDE4 this time, for both Dolphin and Konqueror.

Not so long ago I put up a tutorial which included three useful tips for Konqueror 3.5.9 (KDE3), and one of them was how to create an Open as Root service menu for directories. In this how-to I will show how to accomplish the same thing in KDE4 this time, for both Dolphin and Konqueror.

One of the things which changed is the location where the .desktop file will be located, in the case of KDE4 this should be placed in the ~/.kde/share/kde4/services/ServiceMenus directory. In order to find out what are the directories where the service menus can be put you can run this command:

kde4-config --path services

Which, on my Kubuntu 9.04 system outputs:

embryo@kubu:~$ kde4-config --path services
/home/embryo/.kde/share/kde4/services/:/usr/share/kde4/services/

Also, the syntax of the desktop file changed a little. Here is a basic example of the .desktop file:

[Desktop Entry]
Type=Service
Icon=dolphin
Actions=OpenAsRoot
ServiceTypes=KonqPopupMenu/Plugin,inode/directory,inode/directory-locked

[Desktop Action OpenAsRoot]
Exec=kdesu dolphin %U
Icon=dolphin
Name=Open as Root

Save the file under a name like action_root.desktop inside ~/.kde/share/kde4/services/ServiceMenus and then right-click any directory inside Dolphin or Konqueror, go to Actions -> Open as Root and enter your user password (in Ubuntu) or root password in order to open that directory as root. I had to reload the tabs in Dolphin for the service menu to appear.

Here's how it looks like:

In Dolphin and KDE 4.2.1

In Konqueror and KDE 4.2.1

Additional resources
You may find these two tutorials very useful if you plan to create various service menus in KDE4: this tutorial from KDE TechBase and this forum discussion from KubuntuForums.org.

You can also download and explore a complete script hosted on http://www.kde-apps.org, called Root Actions Servicemenu.

Full Story

  Nav
» Read more about: Groups: KDE, Ubuntu; Story Type: News Story

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.