M HYPE SPLASH
// general

Assigning keyboard shortcuts to KDE Dolphin service menus

By John Peck

Is there any way I can assign a keyboard shortcut to a custom service menu I've added to Dolphin? The options menu for keyboard assignments does not seem to show any service menu actions, nor have I managed to find a a .desktop entry key that would allow me to set a hotkey.

I know that GNOME's Nautilus uses a hidden accels file to allow users to set up custom key bindings. Does a similar option exist for Dolphin, perhaps?

1

2 Answers

By my knowledge

It is not possible to start a KDE Service Menu (context menu) with a keyboard shortcut. This is based on:

The Dolphin is using KDE Framework 5 KIO FileItemActions: :

Detailed Description

This class creates and handles the actions for a url (or urls) in a popupmenu.

This includes:

  • "open with " actions, but also
  • builtin services like mount/unmount for old-style device desktop files
  • user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
  • servicemenus actions, defined in .desktop files and selected based on the mimetype of the url

Dolphin source files:

  • dolphincontextmenu.cpp ->
  • dolphincontextmenu.h ->

Quote:

/** * @brief Represents the context menu which appears when doing a right * click on an item or the viewport of the file manager. *

Sort of workaround with the Dolphin button shortcuts

The KDE Forums has a topic 'Play All Media Button for Dolphin': . It shows how to patch the Dolphin sources to add extra buttons to the Dolphin toolbar. The Dolphin buttons can have the keyboard shortcut.

Wishes/patches

You could file a wish at the .

Patches and the review requests can be added to the KDE's instance of Phabricator: .

2

I don't know what distro you use, but this is for Kubuntu (and works for other distros of course):

You can simulate right click with xdotool and map it to your custom shortcut (for me Shift-F10).

Here is how. First, install xdotool utility:

sudo apt install xdotool

Then add a new shortcut in Custom Shortcuts. Set trigger to whatever (shortcut) you like (for ex. Shift-F10). Set action to:

xdotool key 135

(135 is keycode of "Menu-key")

Works for Dolphin 17.12.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy