XdgMenu

From ArchWiki

Jump to: navigation, search


Contents

XDG menu

xdg-menu - generates menus for

  • twm
  • ion3
  • WindowMaker
  • fvwm2
  • icewm
  • blackbox
  • fluxbox
  • openbox

from XDG stuff. KDE, Gnome, Xfce, Enlightenment are already XDG compatible. For further information see:

Usage

xdg_menu

xdg_menu [--format <format>] [--desktop <desktop>] 
         [--charset <charset>] [--language <language>]  
	 [--root-menu <root-menu>] [--die-on-error]
	 [--fullmenu] [--help]
		 
	format - output format
	         possible formats: twm, WindowMaker, fvwm2, icewm, ion3
	                           blackbox, fluxbox, openbox, 
				   xfce4, openbox3, openbox3-pipe,
				   readable
		 default: WindowMaker
		
 	fullmenu  - output a full menu and not only a submenu

	desktop - desktop name for NotShowIn and OnlyShowIn
		 default: the same as format
			 
	charset - output charset
		 default: <locale>
			 
	language - output language
		 default: <locale>
			 
	root-menu - location of root menu file
		 default: /opt/gnome/etc/xdg/menus/applications.menu
			 
	die-on-error - abort execution on any error, 
		 default: try to continue

	verbose - print debugging information
		 
	help - print this text

update-menus

update-menus updates WMs menus from XDG stuff and can do it automaticaly using config.

You need to install package: archlinux-xdg-menu

/etc/update-menus.conf contains list of window managers which menu should be generated. Comments with # are allowed.

All generated menus placed in /var/cache/xdg-menu/. See wm-specific Examples section of this page to get more information.

Examples

IceWM

With xdg_menu

$ xdg_menu --format icewm --fullmenu --root-menu /etc/xdg/menus/arch-applications.menu >>~/.icewm/programs

With update-menus

  • Uncomment icewm in /etc/update-menus.conf
  • run update-menus as root
  • make symlink to /var/cache/xdg-menu/icewm/programs in ~/.icewm/programs

Ion3

With xdg_menu

$ xdg_menu --format ion3  --root-menu /etc/xdg/menus/arch-applications.menu >~/.ion3/default-session--0/_xdg-menu.lua

After that, change your cfg_menus.lua to include _xdg-menu.lua file and add menu into mainmenu. For example:

...

dopath("_xdg-menu")

-- Main menu
defmenu("mainmenu", {
    submenu("XDG Menu",         "<NAME-OF-FIRST-MENU-IN-_xdg-menu.lua-FILE>"),
    submenu("Programs",         "appmenu"),
    menuentry("Lock screen",    "ioncore.exec_on(_, 'xlock')"),
    menuentry("Help",           "mod_query.query_man(_)"),
    menuentry("About Ion",      "mod_query.show_about_ion(_)"),
    submenu("Styles",           "stylemenu"),
    submenu("Session",          "sessionmenu"),
})

...

With update-menus

  • Uncomment ion3 in /etc/update-menus.conf
  • run update-menus as root
  • change your cfg_menus.lua to include xdg-menu.lua file and add menu into mainmenu.

For example:

...

dopath("/var/cache/xdg-menu/ion3/xdg-menu.lua")

-- Main menu
defmenu("mainmenu", {
    submenu("XDG Menu",         "<NAME-OF-FIRST-MENU-IN-xdg-menu.lua-FILE>"),
    submenu("Programs",         "appmenu"),
    menuentry("Lock screen",    "ioncore.exec_on(_, 'xlock')"),
    menuentry("Help",           "mod_query.query_man(_)"),
    menuentry("About Ion",      "mod_query.show_about_ion(_)"),
    submenu("Styles",           "stylemenu"),
    submenu("Session",          "sessionmenu"),
})

...

FluxBox

With xdg_menu

$ xdg_menu --format fluxbox  --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/my-menu

Change your menu file to include generated menu.

For example add line:

      [include] (my-menu)

With update-menus

  • Uncomment fluxbox in /etc/update-menus.conf
  • run update-menus as root
  • change your menu file to include generated menu.

For example add line:

      [include] (/var/cache/xdg-menu/fluxbox/boxrc)

OpenBox

With xdg_menu

Generate menu with

$ xdg_menu --format openbox3 --root-menu /etc/xdg/menus/arch-applications.menu >xdg-menu.xml

and manualy add it into your menu.xml. For example, put xdg-menu.xml into menu.xml and add:

<menu id="Applications" />

into root-menu.

With update-menus

  • Uncomment openbox in /etc/update-menus.conf
  • run update-menus as root
  • change your menu.xml file to include generated menu.

For example, add following to root-menu:

<menu id="xdg-menu" label="XDG Menu" execute="cat /var/cache/xdg-menu/openbox/menu.xml"/>

Twm

With xdg_menu

Use

$ xdg_menu --format twm --root-menu /etc/xdg/menus/arch-applications.menu >my-twm-menu

and add it into twmrc manualy.

(I don't know how to include files into twmrc sergej 10:50, 11 April 2007 (EDT))

With update-menus

  • Uncomment twm in /etc/update-menus.conf
  • Add into /etc/X11/twm/system.twmrc file applications menu (add following line:
 "apps"          f.menu "Applications"

into defops menu)

  • run update-menus as root
  • run twm -f /var/cache/xdg-menu/twm/twmrc

WindowMaker

With xdg_menu

Use

$ xdg_menu --format WindowMaker --root-menu /etc/xdg/menus/arch-applications.menu >my-wm-menu

and add

#include "my-wm-menu"

into your WindowMaker menu file.

With update-menus

  • Uncomment WindowMaker in /etc/update-menus.conf
  • run update-menus as root
  • add
#include "/var/cache/xdg-menu/WindowMaker/wmrc"

into your menu file.

Fvwm2

With xdg_menu

Generate menu

$ xdg_menu --format fvwm2 --root-menu /etc/xdg/menus/arch-applications.menu >fvwm2-menu

and add menu into root menu

read fvwm2-menu

AddToMenu MenuFvwmRoot  "Root Menu"             Title
+                       "&0. XDG Menu"          Popup xdg_menu

With update-menus

  • Uncomment fvwm2 in /etc/update-menus.conf
  • run update-menus as root
  • change your .fvwm2rc file to include generated menu. For example:
AddToMenu MenuFvwmRoot  "Root Menu"             Title
+                       "&0. XDG Menu"          Popup xdg_menu
read /var/cache/xdg-menu/fvwm2/fvwm2rc

BlackBox

With xdg_menu

$ xdg_menu --format blackbox  --root-menu /etc/xdg/menus/arch-applications.menu >my-menu

Change your menu file to include generated menu.

For example add line:

[include] (my-menu)

With update-menus

  • Uncomment blackbox in /etc/update-menus.conf
  • run update-menus as root
  • change your menu file to include generated menu.

For example add line:

[include] (/var/cache/xdg-menu/blackbox/boxrc)

See also

Personal tools