{"id":13437603,"url":"https://github.com/phillbush/xmenu","last_synced_at":"2025-04-06T00:08:30.843Z","repository":{"id":40418063,"uuid":"264309640","full_name":"phillbush/xmenu","owner":"phillbush","description":"a x11 menu utility","archived":false,"fork":false,"pushed_at":"2024-07-08T03:09:25.000Z","size":614,"stargazers_count":303,"open_issues_count":8,"forks_count":26,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T22:09:21.365Z","etag":null,"topics":["c","imlib2","menu","unix","x11","xlib","xmenu"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phillbush.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T22:13:48.000Z","updated_at":"2025-03-27T13:48:41.000Z","dependencies_parsed_at":"2023-02-19T12:40:28.265Z","dependency_job_id":"2315ef56-6066-4208-bcdf-ee3e0e464540","html_url":"https://github.com/phillbush/xmenu","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fxmenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fxmenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fxmenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillbush%2Fxmenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phillbush","download_url":"https://codeload.github.com/phillbush/xmenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","imlib2","menu","unix","x11","xlib","xmenu"],"created_at":"2024-07-31T03:00:58.637Z","updated_at":"2025-04-06T00:08:30.826Z","avatar_url":"https://github.com/phillbush.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# XMenu\n\nXMenu is a menu utility for X.\nXMenu receives a menu specification in stdin, shows a menu for the user\nto select one of the options, and outputs the option selected to stdout.\nXMenu can be controlled both via mouse and via keyboard.\n\nIn order to generate a menu of applications based on .desktop entries,\nas specified by XDG, checkout [xdg-xmenu](https://github.com/OliverLew/xdg-xmenu)\nby [OliverLew](https://github.com/OliverLew).\n\nCheck out my other project, [xclickroot](https://github.com/phillbush/xclickroot) for an application that can\nspawn xmenu by right clicking on the root window (i.e. on the desktop).\n\n## Options\nXMenu understand the following command-line options.\n\n* `-f`:           Enable file system navigation.\n* `-N name`:      Specify a resource/instance name for XMenu.\n* `-p position`:  Specify a position to place XMenu.\n* `-t window`:    Bind XMenu to given window.\n* `-w`:           Initiate XMenu as a regular window.\n* `-x button`:    Run XMenu whenever button is pressed on root window.\n\n## Environment\nXMenu understands the following environment variable.\n\n* `ICONPATH`: Colon-separated list of directories to search for images.\n\n## Input\nXMenu reads menu entries from standard input.\nEach entry correspond to a line; and lines can be indented to represent\nsubmenus.  Tab separates the label from the string to be output.  An\noptional image can be inserted on the line to be rendered as the entry's\nicon.\n\nFor example, the following input...\n\n```\nApplications\n\tIMG:./icons/web.png\tWeb Browser\tfirefox\n\tIMG:./icons/gimp.png\tImage editor\tgimp\nTerminal (xterm)\txterm\nTerminal (urxvt)\turxvt\nTerminal (st)\t\tst\n\nShutdown\t\tpoweroff\nReboot\t\t\treboot\n```\n\n...generates the following menu:\n\n![demo](./demo.png)\n\nAn example script can be found at `./examples/xmenu.sh`.\n\n## Customization\nXMenu can be customized by setting the following X resources before\ninvoking XMenu.\n\n* `XMenu.activeBackground`: Background color for selected entry.\n* `XMenu.activeForeground`: Text color for selected enty.\n* `XMenu.alignment`:        Text alignment.\n* `XMenu.background`:       Background color.\n* `XMenu.borderColor`:      Border color.\n* `XMenu.borderWidth`:      Border size.\n* `XMenu.faceName`:         Font for drawing text.\n* `XMenu.faceSize`:         Font size.\n* `XMenu.foreground`:       Text color.\n* `XMenu.gap`:              Gap between windows.\n* `XMenu.maxItems`:         Maximum number of items displayed on a menu.\n* `XMenu.opacity`:          Background opacity (from 0.0 to 1.0).\n* `XMenu.separatorColor`:   Separator color.\n* `XMenu.shadowThickness`:  3D relief size.\n* `XMenu.tearOff`:          Enable menus to be torn off.\n* `XMenu.topShadowColor`, `XMenu.middleShadowColor`, `XMenu.bottomShadowColor`:\n  Colors of the 3D relief.\n\nAn example style configurationcanbe found at `./examples/Xresources`.\n\n## Installation\nRun `make all` to build, and `make install` to install the binary and\nthe manual into `${PREFIX}` (`/usr/local`).\n\n## Features\n\n* XMenu reads something in and prints something out, the UNIX way.\n* Submenus (some menu entries can spawn another menu).\n* Torn off menus (menus can be managed by the window manager like a regular window).\n* Separators (menu entries can be separated by a line).\n* Icons (menu entries can be preceded by an icon image).\n* X resources support (you don't need to recompile xmenu for configuring it).\n* Multi-head (xmenu supports multiple monitors by using Xinerama).\n\n## License\nThe code and manual are under the MIT/X license.\nSee `./LICENSE` for more information.\n\n## Acknowledgements\n\n* [thingmenu](http://r-36.net/scm/thingmenu/log.html) for being the base\n  for xmenu's code.  However, xmenu evolved enough that it no longer resembles\n  thingmenu at all.\n* [dmenu](https://tools.suckless.org/dmenu/) for inspiring the stdin-to-stdout\n  interface, and being base for drawing routines and input method code.\n\n## Manual\n\n\tXMENU(1)                    General Commands Manual                   XMENU(1)\n\n\tNAME\n\t     xmenu - menu utility for X\n\n\tSYNOPSIS\n\t     xmenu [-fw] [-N name] [-p position] [-t window] [-x modifier-button]\n\t           [title]\n\n\tDESCRIPTION\n\t     xmenu is a menu for X.  It reads a list of newline-separateditems from\n\t     standard input; shows a menu for the user to select one of the items; and\n\t     writes the selected item into standard output.\n\n\t     The options are as follows:\n\n\t     -f      Enable file system navigation.  If this flag is set, any menu\n\t             item whose output begins with a slash is interpreted as the path\n\t             to a directory.  Entering this item will open a menu containing\n\t             the entries of that directory, so the user can navigate the\n\t             contents of the directory with xmenu.  When an item is selected,\n\t             its absolute path is output prefixed with \"file:\".  A directory's\n\t             path can be output by selecting it with the middle mouse button.\n\n\t     -N name\n\t             Specifiy the res_name member of the XClassHint(3) property.  Ar\n\t             name is used to retrieve resources.  If not specified, defaults\n\t             to the command that xmenu was invoked as (that is, the\n\t             basename(3) of its argv[0]).\n\n\t     -p position\n\t             Set the position to spawn xmenu.  Without this option, xmenu\n\t             spawns next to the cursor.  Position is a string of the form\n\t             GEOMETRY[:MONITOR], where GEOMETRY is a geometry parsed by\n\t             XParseGeometry(3).  MONITOR is the number of the monitor the\n\t             geometry is relative to (counting from 0); it can instead be a\n\t             string like \"current\" or \"cursor\", specifyingthe monitor where\n\t             the cursor is on.\n\n\t     -t window\n\t             Make the menu windows transient for the given window.  That is,\n\t             notify the window manager that the menus are bound to the given\n\t             window.  This also makes xmenu close when the window is\n\t             destroyed.\n\n\t     -w      Asks the window manager to draw a border around the menu.  This\n\t             makes xmenu start torn off.\n\n\t     -x modifier-button\n\t             This option requires an argument of the form modifier-button or\n\t             button; where modifier is Mod1 to Mod5, or Alt (equivalent to\n\t             Mod1), or Super (equivalent to Mod4); and button is the number of\n\t             a mouse button.  When this option is used, xmenu listens to\n\t             button presses on the root window, and shows the menu when the\n\t             given button is pressed on the root window or when that button is\n\t             pressed together with the given modifier on any window.  This\n\t             option makes xmenu run continuously; so it should be used when\n\t             xmenu is invoked in background on a X11 startup file (like\n\t             ~/.xinitrc or ~/.xsession).  This option cannot be used together\n\t             with -w or -t.\n\n\t     If the argument title is given, the title of the menu window is set to\n\t     it.\n\n\tSYNTAX\n\t     Each item read from standard input has the following format (bracket\n\t     groups optional elements):\n\n\t           [TABS] [IMAGE TABS] LABEL [TABS OUTPUT] NEWLINE\n\t     or\n\n\t           [TABS] [:] NEWLINE\n\n\t     The components are as follows:\n\n\t     o   The initial tabs indicate the menu hierarchy: items indented with a\n\t         tab are placed in a submenu of the preceding item not indented.  An\n\t         item without initial tabs is a top-level item.\n\n\t     o   The image is a string of the form \"IMG:/path/to/image.png\".  It\n\t         specifies the path to an image file to be shown as icon at the left\n\t         of the entry.  If the path does not begin with \"/\", \"./\", or \"../\",\n\t         the file is searched on the paths specified in the ICONPATH\n\t         environment variable.\n\n\t     o   The label is the string that will be shown as an item in the menu.\n\t         An item without label or with a single colon (:) as label is\n\t         considered a separator and is drawn as a thin line in the menu\n\t         separating the item above from the item below.  An item whose label\n\t         is equal to two apostrophes \"''\" does not appear on the menu, it's\n\t         output provides an alternative output for the previous item when the\n\t         user clicks with the middle mouse button.\n\n\t     o   The output is the string that will be output after selecting the\n\t         item.  If an item does not have tabs after the label, its label is\n\t         used as its output.  If the output is empty or is a colon (:), the\n\t         item cannot be selected.\n\n\t     o   The newline terminates the item specification.\n\n\tUSAGE\n\t     xmenu is controlled by the mouse.  Each menu has a list of items that can\n\t     be activated by clicking on it with the first, second or third mouse\n\t     buttons.\n\n\t     o   If there is a right-pointing triangle on the item, it pops up a\n\t         submenu when activated.\n\n\t     o   If the item is a dash at the top of the menu, it tears the menu off\n\t         (that is, the menu becomes \"windowed\").\n\n\t     o   If the item is a continuous horizontal line, it is a separator and\n\t         cannot be selected.\n\n\t     o   Otherwise, the item outputs some string when activated.  Some items\n\t         output an \"alternative string\" when activated with the second mouse\n\t         buton (see above at SYNTAX).\n\n\t     but can also be controlled by the keyboard.  Items can be selected using\n\t     the arrow keys.  Tab (with and without Shift), Home, End, Enter and Esc,\n\t     and 1-9 keys.  Items can also be selected by typing the first several\n\t     characters in it.\n\n\t     Down    Cycle through the items in the regular direction.\n\n\t     End     Selects the last item in the menu.\n\n\t     Esc     Go to the menu above in the hierarchy or exit xmenu.\n\n\t     Home    Selects the first item in the menu.\n\n\t     Left    Go to the menu above in the hierarchy.\n\n\t     Right, Enter\n\t             Select the highlighted item.\n\n\t     Shift-Tab\n\t             Cycle through the items in the reverse direction.  When the type-\n\t             to-select feature is active, cycle through matching items\n\t             instead.\n\n\t     Tab     Cycle through the items in the regular direction.  When the type-\n\t             to-select feature is active, cycle through matching items\n\t             instead.\n\n\t     Up      Cycle through the items in the reverse direction.\n\n\t     Additional key bindings can be set at compile time by changing the\n\t     config.h file.\n\n\tRESOURCES\n\t     xmenu understands the following X resources.  They must be prefixed with\n\t     either the \"XMenu\" class, or the name given with the -N command-line\n\t     option, followed by a period.\n\n\t     activeBackground\n\t             The backround color of selected items in the menu.\n\n\t     activeForeground\n\t             The color of the label text of selected items in the menu.\n\n\t     alignment\n\t             If set to \"left\", \"center\", or \"right\", text is aligned to the\n\t             left, center, or right of the menu, respectively.  By default,\n\t             text is aligned to the left.\n\n\t     background\n\t             The background color of non-selected items in the menu.\n\n\t     borderColor\n\t             The color of the border around the menu.\n\n\t     borderWidth\n\t             The size in pixels of the border around the menu.\n\n\t     faceName\n\t             Font for drawing text.  If the value is prefixed with \"xft:\"\n\t             (case insensitive), then xmenu uses the Xft(3) library for\n\t             drawing text; and fallback fonts can be specified by delimiting\n\t             the fonts with commas.  If the value is prefixed with \"x:\" or\n\t             \"x11:\" (case insensitive), then xmenu uses the X11 library for\n\t             drawing text.\n\n\t     faceSize\n\t             The size, in points of the font.  This only affects Xft(3) fonts.\n\n\t     foreground\n\t             The color of the label text of non-selected items in the menu.\n\n\t     gap     The gap, in pixels, between the menus.\n\n\t     maxItems\n\t             Maximum number of items to be displayed in a menu.  If a menu has\n\t             more than this number of items, they will be scrolled with arrow\n\t             buttons.\n\n\t     opacity\n\t             Background opacity as a floating point number between 0.0 and 1.0\n\t             inclusive.\n\n\t     separatorColor\n\t             The color of the separator between items in the menu.\n\n\t     shadowThickness\n\t             The size in pixels of the Motif-like 3D relief.\n\n\t     tearOff\n\t             If set to \"True\", \"On\", or \"Enable\", creates a dashed line on the\n\t             top of each non-windowed menu to tear them off into a new\n\t             windowed menu.\n\n\t     topShadowColor, middleShadowColor, bottomShadowColor\n\t             The color of the top/light, middle and bottom/dark parts of the\n\t             Motif-like 3D relief.  Setting these resources override\n\t             background and separateColor.\n\n\tENVIRONMENT\n\t     The following environment variables affect the execution of xmenu.\n\n\t     DISPLAY\n\t             The display to start xmenu on.\n\n\t     ICONPATH\n\t             A colon-separated list of directories used to search for the\n\t             location of image files.\n\n\tEXAMPLES\n\t     The following script illustrates the use of xmenu.  The output is\n\t     redirected to sh(1), creating a command to be run by the shell.\n\n\t           $!/bin/sh\n\n\t           xmenu -f \u003c\u003cEOF | sh \u0026\n\t           Applications\n\t                   IMG:./web.png   Web Browser     firefox\n\t                   IMG:./gimp.png  Image Editor    gimp\n\t           Terminal (xterm)                        xterm\n\t           Terminal (urxvt)                        urxvt\n\t           Terminal (st)                           st\n\n\t           Navigate Home                           /home/user\n\n\t           Shutdown                                poweroff\n\t           Reboot                                  reboot\n\t           EOF\n\n\t     For example, by selecting \"Applications\", a new menu will appear.\n\t     Selecting \"Web Browser\" in the new menu opens firefox.\n\n\t     The -f option makes it possible to browse the contents of the home\n\t     directory by selecting the \"Navigate Home\" item.  This will open a\n\t     submenu listing all the entries of the home directory.\n\n\tSEE ALSO\n\t     xclickroot(1), X(7)\n\n\tUNIX                             July 9, 2023                             UNIX\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillbush%2Fxmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphillbush%2Fxmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillbush%2Fxmenu/lists"}