Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-09-17 17:16:23

deleted3
Member
Registered: 2015-03-28
Posts: 40

Custom application menus and keyboard shortcuts

Xfce + Debian Testing ... I have several custom Application Menus and only the first one can be open via a keyboard shortcut. How can I designate a keyboard shortcut for the other custom menus?


wy03b27smzlx.png

Offline

#2 2016-09-17 17:56:39

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Custom application menus and keyboard shortcuts

Here is one option that might work for with using the applications menu. What this does, is set the custom-menu-file name via xfconf-query then pops-up the applications-menu using that custom-menu file, and then resets the menu to the default menu. What you see is the custom menu popping up that you can interact with, and if you click the menu button instead, the default menu will show up.

#!/bin/bash

### Set these values to suit
PLUGIN_NUM=1
DEFAULT_MENU=xfce-applications.menu

### Do not change anything below
# make sure custom menus are enabled
xfconf-query -c xfce4-panel -p /plugins/plugin-$PLUGIN_NUM/custom-menu -s true

# change to the correct custom menu
xfconf-query -c xfce4-panel -p /plugins/plugin-$PLUGIN_NUM/custom-menu-file -s ~/.config/menus/$1
# pause for the change to happen
sleep .5s
# popup the menu
xfce4-popup-applicationsmenu

# reset to the default
xfconf-query -c xfce4-panel -p /plugins/plugin-$PLUGIN_NUM/custom-menu-file -s ~/.config/menus/$DEFAULT_MENU

Make sure you set the value of PLUGIN_NUM (the number of the applicationsmenu plugin - "xfconf-query -c xfce4-panel -lv" will help to identify it) and the name of the default menu that you want to use (DEFAULT_MENU).

Create keyboard shortcuts to this shell script passing as a parameter the name of the custom menu that you want to use. For example:
Super+1 = /path/to/script work.menu
Super+2 = /path/to/script play.menu
...etc


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB