JGMENU(1)
β¨ NAME β¨
jgmenu β A simple X11 menu π
Bestie, this is the whole vibe: a lil graphical menu for Linux/BSD that reads your menu data as CSV and pops it onto an X11 window. That's it. That's the girl. π
πΈ SYNOPSIS πΈ
jgmenu [--no-spawn] [--checkout=<tag>] [--config-file=<file>]
[--icon-size=<size>] [--at-pointer] [--hide-on-startup]
[--simple] [--vsimple] [--csv-file=<file>]
[--csv-cmd=<command>] [--die-when-loaded]
[--center] [--persistent]
okay so here's the starter pack, the "just tell me what to type" moment π«Ά
jgmenu_runβ Launch menujgmenu_run initβ Create config file~/.config/jgmenu/jgmenurcjgmenu_run init -iβ Interactive setupman jgmenututorialβ Step-by-step tutorial
π¦ DESCRIPTION π¦
jgmenu is a simple menu for Linux/BSD. It reads CSV menu data from a file and generates a graphical menu on an X11 window. No cap, that's literally the entire personality.
π« Fields π«
Each line of CSV menu data is parsed into the following fields using comma as a field separator:
- description
- command
- icon
- working directory
- metadata
For example:
printf "Terminal,xterm\\nWeb Browser,firefox" | jgmenu --vsimple
π Special Characters at beginning of line π
#β Ignore line.β A line beginning with a dot followed by a space, will source the file specified by the string following the dot@β Treat as widget
π Special Characters in fields π
,β As commas are used as field separators, individual fields can only contain commas if they are triple quoted. For example:
foo,βββ^pipe(find . -printf `%f,display %p,%p\n')βββ
< > &β The description field is parsed as pango markup, so<,>, and&need to be escaped as<,>, and&respectively."β Unlike most CSV implementations, a single instance of a double quote (") is not considered a special character. The reason for this is to let users write commands with double quotes without having to escape them."""β Use three quotes"""to begin and to end a fully quoted value. The primary use case for this is when a comma is needed within a value.
π§ Markup π§
The syntax ^foo(bar) is used to carry out action foo with argument bar. We refer to bar as the inner value.
The following markup is supported in the description field
sep()β Define a separator. If an inner value is provided, the separator will appear as a title. If no inner value is provided, the separator will simply be a horizontal line
The following markup is supported in the command field
^tag()β Define the beginning of a new menu structure node.
The lines following ^tag(whatever) will not show in the top level menu, but can be opened by using ^checkout() or ^root().
item0.0
item0.1
submenu1,^checkout(1)
submenu2,^root(2)
^tag(1)
item1.0
item1.1
^tag(2)
item2.0
item2.1
^checkout()β Open the tag specified by the inner value as a submenu in a new window^root()β Open the tag specified by the inner value in the root window, replacing the current menu^sub()β Draw a submenu arrow. This can be useful for creating submenus withstay_alive=0. For example:
item0.0
item0.1
submenu1,^sub(echo "item1.0" | jgmenu --simple)
^back()β Check-out parent menu^term()β Run program in terminal^pipe()β Execute sub-process and checkout a menu based on its stdout.^filter()β Invoke search^quit()β Quit
π Icons π
Icons will be displayed if the third field is populated, for example:
Terminal,xterm,utilities-terminal
Firefox,firefox,firefox
π OPTIONS π
--no-spawnβ Redirect command to stdout rather than execute it.--checkout=<tag>β Checkout submenu on startup.--config-file=<file>β Read config file.--icon-size=<size>β Specify icon size (22by default). If set to0, icons will not be loaded.--at-pointerβ Launch menu at mouse pointer.--hide-on-startupβ Start menu is hidden state.--simpleβ Ignore tint2 settings; Run in short-lived mode (i.e. exit after mouse click or enter/escape); read menu items from stdin.--vsimpleβ Same as--simple, but also disables icons and ignoresjgmenurc.--csv-file=<file>β Specify menu file (in jgmenu flavoured CSV format). If file cannot be opened, input is reverted to stdin.--csv-cmd=<command>β Specify command to produce menu data, for examplejgmenu_run pmenu--die-when-loadedβ Open menu and thenexit(0). Useful for debugging and testing.--centerβ Center align menu horizontally and vertically.--persistentβ Same as thepersistentconfig option. See config option section below for details.
π USER INTERFACE π
- Up, Down β Select previous/next item
- Left. Right β Move to parent/sub menu
- PgUp, PgDn β Scroll up/down
- Home, End β Select first/last item
- Enter β Select an item or open a submenu
- F5 β Restart
- F8 β Print node tree to stderr
- F9 β
exit(1) - F10 β
exit(0) - Backspace β Return to parent menu
Type any string to invoke a search. Words separated by space will be searched for using OR logic (i.e. the match of either word is sufficient to display an item). πβ¨
β WIDGETS β
Lines beginning with @ in jgmenu flavoured CSV files are parsed in accordance with the following syntax:
@type,action,x,y,w,h,r,halign,valign,fgcol,bgcol,content
typeβ The widget type, which can be one of the following:rectβ Rectangle with a1pxthick border drawn usingfgcolsearchβ Search box showing the current filter (what the user has typed) or the specified text if no filter has been invoked.iconβ Icon
actionβ The action to take when selected. This can either be a shell command or a menu action such^root().x,yβ Horizontal and vertical margin of widgetw,hβ Width and height of widgetrβ Corner radiusfgcol,bgcolβ Foreground and background colours using syntaxrrggbb #aafgcolacceptsautoto use thejgmenurcβscolor_norm_fgcontentβicon_pathfor icon widgets text for all other widget typeshalign,valignβ Horizontal and vertical alignment of widget. This has not yet been implemented, but defaults to top and left
π«Ά CONFIGURATION FILE π«Ά
If no file is specified using the βconfig-file= option, the XDG Base Directory Specification is adhered to. I.e:
- Global config in
${XDG_CONFIG_DIRS:-/etc/xdg} - User config override in
${XDG_CONFIG_HOME:-$HOME/.config}
For most users ~/.config/jgmenu/jgmenurc is appropriate.
Global config variables are set in the following order (i.e. bottom of list has higher precedence):
- built-in defaults (
config.c) tint2rcconfig file (can be specified byTINT2_CONFIGenvironment variable)jgmenurcconfig file (can be specified byβconfig-file=)- command line arguments
π¦ Syntax π¦
Lines beginning with # are ignored.
All other lines are recognised as setting variables in the format
key = value
White spaces are mostly ignored.
πΈ Values πΈ
Unless otherwise specified, values as treated as simple strings.
Here follow some specific types:
booleanβ When a variable takes a boolean value, only0and1are accepted.0means false;1means true.integerβ When a variable takes an integer value, only numerical values are accepted. The only valid characters are digits (0-9) and minus-sign. All integer variables relating to geometry and position are interpreted as pixel values unless otherwise specified.colorβ When a variable takes a color value, only the syntax#rrggbb aaais recognised, whererr,ggandbbrepresent hexadecimal values (00-ff) for the colours red, green and blue respectively; andaaastands for the alpha channel value expressed as a percentage (0-100) (i.e.100means no transparency and0means fully transparent.) For example#ff0000 100represents red with no transparency, whereas#000088 50means dark blue with 50% transparency.pathnameβ When a variable takes a pathname value, it is evaluated as a string. If the first character is tilde (~), it will be replaced by the the environment variable$HOMEjust as a shell would expand it.
π Variables π
verbosity = integer (default 0)β General verbosity: (0) warnings only; (1) basic info; (2) more info; (3) max info
Additional specific topics: (4) IPC
Note: Some IPC messages need environment variable JGMENU_VERBOSITY=4 too
stay_alive = boolean (default 1)β If set to1, the menu will βhideβ rather than βexitβ when the following events occur: clicking on menu item; clicking outside the menu; pressing escape. When in the hidden mode, aUSR1signal will βun-hideβ the menu.persistent = boolean (default 0)β If set to1, the menu will not exit nor hide when the following events occur: clicking on menu item; clicking outside the menu; pressing escape. Use in conjunction with the^quit()markup.hide_on_startup = boolean (default 0)β If set to1, jgmenu start in βhiddenβ mode. This is useful for starting jgmenu during the boot process and then sending akillall -SIGUSR1 jgmenuto show the menu.csv_cmd = string (default apps)β Defines the command to produce the jgmenu flavoured CSV for jgmenu. Accpetable keyword includeapps,pmenu,lx, andob. If a value is given other than these keywords, it will be executed in a shell (so be careful!). If left blank, jgmenu will read from stdin. Examples:
csv_cmd = lx
csv_cmd = jgmenu_run lx --no-dirs
csv_cmd = cat ~/mymenu.csv
tint2_look = boolean (default 0)β Readtint2rcand parse config options for colours, dimensions and alignment.position_mode = (fixed | ipc | pointer | center) (default fixed)β Define menu positioning mode.fixedβ Align tomargin_{x,y}and respect_NET_WORKAREA.ipcβ Use IPC to read environment variables set by panel. See Inter-Process Communication for further info.
pointerβ launch at the pointer, whilst respecting both_NET_WORKAREAandedge_snap_x. Bestie behaviour, honestly π«Άcenterβ launch at the center of the screen and straight-up ignore_NET_WORKAREA. This one takes precedence overmenu_{v,h}align. Periodt. π
edge_snap_x= integer (default30) β how close (in pixels) you can get to the left hand edge before the menu just snaps to it. Heads up though: this only applies inat_pointermode. πterminal_exec= string (defaultx-terminal-emulator) β the terminal to use for commands with^term()markup.terminal_args= string (default-e) β okay so these two variables team up to build the string that launches programs needing a terminal. With the default values, that string becomes:
x-terminal-emulator -e 'some_command with arguments'
And terminal_args must finish with -e or an equivalent, where -e refers to the meaning of -e in xterm -e. No cap. π₯
monitor= integer (default0) β pick a particular monitor as an index starting from1. If it's0, the menu launches on whichever monitor the mouse is on. Main character mouse energy πhover_delay= integer (default100) β the time (in milliseconds) from hovering over an item until a submenu opens. Impatient? Lower it. πhide_back_items= boolean (default1) β if enabled, all^back()items get suppressed. As a general rule: set it to1for a multi-window menu, and0when you're in single-window mode.columns= integer (default1) β number of columns in which to show menu items.tabs= integer (default120) β the position, in pixels, of the first tab.menu_margin_x= integer (default0) β distance between the menu (that's the X11 window, bestie) and the edge of the screen. See the note on_NET_WORKAREAunder themenu_{v,h}alignvariables. πmenu_margin_y= integer (default0) β the vertical equivalent ofmenu_margin_x.menu_width= integer (default200) β the minimum menu width. The actual width will adjust to fit the longest item in the current (sub)menu. But if a filter is applied (e.g. by the user typing) the menu width will not adjust. She's committed to the bit. πmenu_height_min= integer (default0) β set the minimum height of the root menu. Ifmenu_height_minandmenu_height_maxare set to the same value, the menu height will be fixed at that value. If set to zero, they'll be ignored.menu_height_max= integer (default0) β "Minimum height of the root menu. Seemenu_height_min". Yes, it literally says minimum here π the docs said what they said, we don't make the rules.menu_height_mode= (static|dynamic) (defaultstatic) β mode of menu height.staticβ the height of the initial root menu will be used for any subsequent^root()action.dynamicβ the root menu height gets re-calculated every time a new tag is opened using^root().
menu_padding_top= integer (default5) β distance between top border and item/widget.menu_padding_right= integer (default5) β distance between right border and item/widget.menu_padding_bottom= integer (default5) β distance between bottom border and item/widget.menu_padding_left= integer (default5) β distance between left border and item/widget.menu_radius= integer (default1) β radius of the menu's rounded corners. Rounded corners are so cute, obsessed πmenu_border= integer (default0) β thickness of the menu border.menu_halign= (left|right|center) (defaultleft) β horizontal alignment of the menu. If it's not set, jgmenu will try to guess the alignment by reading_NET_WORKAREA, which is a freedesktop EWMH root window property. And here's the tea: not all Window Managers and Panels respect_NET_WORKAREA. The following do:openbox,xfwm4,tint2andpolybar. The following do NOT:awesome,i3,bspwmandplank. Noted πmenu_valign= (top|bottom|center) (defaultbottom) β vertical alignment of the menu. Seemenu_halign.menu_gradient_pos= (none|top|right|bottom|left|top_left|top_right|bottom_left|bottom_right) (defaultnone) β start position of the menu window gradient. The end position is at the opposite side or corner. The colourscolor_menu_bgandcolor_menu_bg_tospecify the start (from) and the finish (to). It's giving sunset πsub_spacing= integer (default1) β horizontal space between windows. A negative value results in each submenu window overlapping its parent window. Chaotic, love that for you πsub_padding_top= integer (defaultauto) β same asmenu_padding_topbut it applies to submenu windows only. It understands the keywordauto, which means the smallest of the fourmenu_padding_*variables will be used.sub_padding_right= integer (defaultauto) β seesub_padding_top.sub_padding_bottom= integer (defaultauto) β seesub_padding_top.sub_padding_left= integer (defaultauto) β seesub_padding_top.sub_hover_action= integer (default1) β open a submenu when hovering over an item. Note that this only works in multi-window mode.item_margin_x= integer (default3) β horizontal distance between items and the edge of the menu.item_margin_y= integer (default3) β vertical distance between items and the edge of the menu.item_height= integer (default25) β height of menu items.item_padding_x= integer (default4) β horizontal distance between the item edge and its content (e.g. text or icon).item_radius= integer (default1) β radius of rounded corners of items.item_border= integer (default0) β thickness of item border.item_halign= (left|right) (defaultleft) β horizontal alignment of menu items. If you set it toright, you should change thearrow_stringoption too. Just saying πsep_height= integer (default5) β height of a separator without text (as defined by^sep()). Separators with text useitem_height.sep_halign= (left|center|right) (defaultleft) β horizontal alignment of separator text.sep_markup= string (unset by default) β if specified,<span $sep_markup>foo</span>will be passed to pango for^sep(foo).
See the following link for pango attributes: https://docs.gtk.org/Pango/pango_markup.html
Keywords include (but are not limited to):
fontsize(x-small, small, medium, large, x-large) -style(normal, oblique, italic)weight(ultralight, light, normal, bold, ultrabold, heavyforeground(using format#rrggbbor a colour name)underline(none, single, double)
Example:
sep_markup = font="Sans Italic 12" foreground="blue"
font= string (unset by default) β font description for menu items.fontaccepts a string such asCantarell 10orUbuntuCondensed 11. The font description without a specified size unit is interpreted as points. Ifpxis added, it will be read as pixels. Using "points" enables consistency with other applications. Slay β¨font_fallback= string (defaultxtg) β same asicon_theme_fallback, except that the xsettings variableGtk/FontNameis read.icon_size= integer (default22) β size of icons in pixels. If set to0, icons will be disabled. πicon_text_spacing= integer (default10) β distance between icon and text within a menu item.icon_norm_alpha= integer (default100) β opacity of menu item icons, expressed as a percentage (0-100).icon_sel_alpha= integer (default100) β opacity of the currently selected menu item's icon, expressed as a percentage (0-100).icon_theme= string (unset by default) β name of icon theme. E.g.Adwaita,breeze,Paper,PapirusandNumix. Seels /usr/share/icons/(or similar) for the available icon themes on your system.icon_theme_fallback= string (defaultxtg) β fallback sources of the icon theme, in order of precedence, where the left-most letter designates the source with the highest precedence. The following characters are acceptable:x=xsettingsNet/IconThemeName;t=tint2;g=gtk3.0.icon_themetakes priority if set. And in order to increase consistency with tint2, xsettings variables will only be read if the tint2rc variablelauncher_icon_theme_overrideis0.arrow_string= string (defaultβΈ) β the string used to indicate that an item will open a submenu. Seejgmenuunicode(7)for examples.arrow_width= integer (default15) β width allowed forarrow_string. Set to0to hide the arrow.search_empty_string= string (default<empty>) β the string to show when no entries match a search. It's giving "she's not here" πcolor_menu_bg= color (default#000000 100) β background colour of the menu window. If gradients are enabled, this will be the 'from' color.color_menu_bg_to= color (default#000000 100) β background 'to' colour of the menu window, for use with gradients.color_menu_border= color (default#eeeeee 8) β border colour of the menu window.color_norm_bg= color (default#000000 0) β background colour of menu items, except the one currently selected.color_norm_fg= color (default#eeeeee 100) β font (foreground) colour of menu items, except the one currently selected.color_sel_bg= color (default#ffffff 20) β background color of the currently selected menu item.color_sel_fg= color (default#eeeeee 100) β font (foreground) color of the currently selected menu item.color_sel_border= color (default#eeeeee 8) β border color of the currently selected menu item.color_sep_fg= color (default#ffffff 20) β font (foreground) colour of separators without text.color_title_fg= color (default#eeeeee 50) β font (foreground) colour of separators with text. The font colour can be overridden bysep_markup.color_title_bg= color (default#000000 0) β background colour of separators with text.color_title_border= color (default#000000 0) β border colour of separators with text.color_scroll_ind= color (default#eeeeee 40) β colour of the scroll indicator lines (the little ones that show whether there are menu items above or below the ones you can actually see). π
π CSV generator variables π
The following variables begin with csv_, which denotes that they set environment variables which are used by the CSV generators. Teamwork, honestly π«Ά
csv_name_format= string (default%n (%g)) β defines the format of the name field for CSV generators. Supported byappsandlx. It understands the following two fields:%nβ Application name
%gβ the application's generic name. And if there's no generic name, or it's literally identical to the name? Then%ngets used instead, with zero formatting. no drama. π
csv_single_window = boolean (default 0)β flip this on and csv-generators will spit out^root()instead of^checkout(). Translation: you get a single window menu where the submenus show up in the same window instead of spawning new ones. Supported byappsandpmenu. one window, one vibe πͺcsv_no_dirs = boolean (default 0)β set it and csv-generators will output applications with no directory structure at all. just flat. Supported byapps,pmenuandlx. no folders, we die like icons πcsv_i18n = string (no default)β tells it to look for a translation file in the file or directory you name. Seejgmenu-i18n(1)for the full tea. Supported byappsandob. πcsv_no_duplicates = boolean (default 0)β keeps applications from showing up in more than one directory. one app, one home, periodt. Supported byapps. π
π¬ INTER-PROCESS COMMUNICATION (IPC) π¬
IPC is how you get jgmenu to line up with a panel launcher in real-time β like, live, as it happens. Right now this is supported by tint2 and xfce-panel. Here's how the whole thing goes down:
jgmenu_run reads the environment variables listed below and passes them through a unix socket to the long-running instance of jgmenu. so they're literally gossiping over a socket, love that for them π«Ά
If position_mode=ipc, jgmenu aligns to those variables every single time it's launched.
These four environment variables are the ones that define the extremities of the panel: TINT2_BUTTON_PANEL_X1, TINT2_BUTTON_PANEL_X2, TINT2_BUTTON_PANEL_Y1, TINT2_BUTTON_PANEL_Y2.
(X1,Y1)
ββββββββββββββββββββββββ
β panel β
ββββββββββββββββββββββββ
(X2,Y2)
The next batch of environment variables define where the launcher sits. And heads up β these get interpreted differently depending on panel alignment, so read carefully bestie:
In the case of a horizontal panel:
TINT2_BUTTON_ALIGNED_X1andTINT2_BUTTON_ALIGNED_X2define the launcher button's horizontal extremities to align to.TINT2_BUTTON_ALIGNED_Y1andTINT2_BUTTON_ALIGNED_Y2define the edge of the panel to align to. These shall be the same.
In the case or a vertical panel, the same rules apply with X and Y reversed. π
And if none of the above variables are set? Then menu_margin_x and menu_margin_y get used instead. fallback queens π
π¨ DIAGRAMS π¨
General Notes
margin β refers to space outside an object.
padding β refers to space inside an object (between border and content).
Vertical Menu
ββββββββββββββββββββββββββ
β 1 β
ββββββββββββββββββββββββββ’
β 2 β
ββββββββββββββββββββββββββ’
β item β
ββββββββββββββββββββββββββ’
β 2 β
ββββββββββββββββββββββββββ’
β item β
ββββββββββββββββββββββββββ’
β 2 β
ββββββββββββββββββββββββββ’
β 3 β
ββββββββββββββββββββββββββ
menu_padding_topitem_margin_ymenu_padding_bottom
Horizontal Menu
βββ€ββ€βββββββββββββββββ€ββ€ββ
β β β β β β
β β ββββββββββββββββββ€ β β
β β βicon text >β β β
β β ββββββββββββββββββ€ β β
β2β1β β1β3β
β β ββββββ¬ββ¬ββββββββ¬ββ€ β β
β β β 4 β5β β6β β β
β β ββββββ΄ββ΄ββββββββ΄ββ€ β β
β β β β β β
β β β β β β
βββ§ββ§βββββββββββββββββ§ββ§ββ
item_margin_xpadding_leftpadding_righticon_sizeicon_to_text_spacingarrow_width
External to menu
screen
ββββββββββββββββββββββββββ
β 2 β
β ββββββββ β
β β root β ββββββββ β
β1β menu β β sub β β
β β β3β menu β β
β ββββββββ β β β
β ββββββββ β
β β
β β
β β
ββββββββββββββββββββββββββ
menu_margin_xmenu_margin_ysub_spacing
πͺ HOOKS πͺ
A hook in jgmenu is a rule which optionally triggers a command and then performs a restart if a file or directory has changed since the last time the instance of jgmenu was mapped (= made visible β normally by running jgmenu_run). so it's like, "hey bestie, something moved, time for a glow-up" β¨
Hooks are specified in the file $HOME/.config/jgmenu/hooks are take the format
<file>,<command>
For example, to synchronise with the GTK theme, use this hook:
~/.config/gtk-3.0/settings.ini,jgmenu_run gtktheme
Leave the <command> empty to just restart. (yes, a lil restart-and-refresh moment, no command needed π§)
A number of restart-hooks are built-in by default, for example ~/.config/jgmenu/{jgmenurc,append.csv,prepend.csv} and /usr/share/applications.
To list all the built-in hooks, use the keyword print in the hook file (on a line on its own). In order to remove all the built-in hooks, use the keyword clear. so print = show me everything, clear = burn it all down π₯
π STARTUP SCRIPT π
Unless the --vsimple argument is used, the file ~/.config/jgmenu/startup is executed on initial startup. that's your lil main-character entrance π
π SEE ALSO π
The jgmenu source code and documentation can be downloaded from https://github.com/johanmalm/jgmenu/ β go get it, it's giving open source excellence π«Ά
π AUTHORS π
Johan Malm. (the icon, the legend, the whole entire vibe β)
and that's a wrap on JGMENU(1) bestie π this page is from the jgmenu manual set, dated 2 January, 2021 β go forth and menu, you absolute legend πΈπ¦π
π¦ where this page comes from
- alpine 3.24: jgmenu-doc 4.5.0-r0 Β· GPL-2.0-or-later
- arch rolling: jgmenu 4.6.0-1 Β· GPL
- debian trixie: jgmenu 4.5.0-1 Β· GPL-2.0-only
- fedora 43: jgmenu 4.5.0-3.fc43 Β· GPL-2.0-or-later
- fedora 44: jgmenu 4.5.0-4.fc44 Β· GPL-2.0-or-later
- nixos 26.05: jgmenu 4.5.0
- nixpkgs unstable: jgmenu 4.7.0
- ubuntu questing: jgmenu 4.5.0-1build1
- ubuntu resolute: jgmenu 4.5.0-1build2 Β· GPL-2.0-only
- ubuntu stonking: jgmenu 4.5.0-1build2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms