Difference between revisions of "Dmenu"

From ArchWiki
Jump to: navigation, search
(improve install link as recommended in Help:Style#Package management instructions)
 
(43 intermediate revisions by 18 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:dmenu}}
 
{{DISPLAYTITLE:dmenu}}
 
[[Category:Application launchers]]
 
[[Category:Application launchers]]
[[da:dmenu]]
+
[[da:Dmenu]]
 
[[es:Dmenu]]
 
[[es:Dmenu]]
 +
[[ja:Dmenu]]
 
[[zh-CN:Dmenu]]
 
[[zh-CN:Dmenu]]
 +
{{Related articles start}}
 +
{{Related|List of applications/Other#Application launchers}}
 +
{{Related articles end}}
 +
 
[http://tools.suckless.org/dmenu dmenu] is a fast and lightweight dynamic menu for X. It reads arbitrary text from stdin, and creates a menu with one item for each line. The user can then select an item, through the arrow keys or typing a part of the name, and the line is printed to stdout. dmenu_run is a wrapper that ships with the dmenu distribution that allows its use as an application launcher.
 
[http://tools.suckless.org/dmenu dmenu] is a fast and lightweight dynamic menu for X. It reads arbitrary text from stdin, and creates a menu with one item for each line. The user can then select an item, through the arrow keys or typing a part of the name, and the line is printed to stdout. dmenu_run is a wrapper that ships with the dmenu distribution that allows its use as an application launcher.
 +
 
== Installation ==
 
== Installation ==
  
[[Pacman|Install]] {{Pkg|dmenu}} from the [[official repositories]].
+
[[Install]] the {{Pkg|dmenu}} package from the [[official repositories]]. If you want the development build from git, install the {{AUR|dmenu-git}} package from the [[Arch User Repository]].
  
You may run dmenu with
+
Various patched variants exist which extend dmenu's default functionality. Consider installing one of the following packages from the [[AUR]]:
 +
 
 +
* {{AUR|dmenu-xft}}{{Broken package link|{{aur-mirror|dmenu-xft}}}}: XFT font support
 +
* {{AUR|dmenu-xft-height}}{{Broken package link|{{aur-mirror|dmenu-xft-height}}}}: XFT font support and custom height support
 +
* {{AUR|dmenu-xft-transparency}}{{Broken package link|{{aur-mirror|dmenu-xft-transparency}}}}: XFT font support and transparency
 +
* {{AUR|dmenu-xft-mouse-height}}{{Broken package link|{{aur-mirror|dmenu-xft-mouse-height}}}}: XFT font support, custom height, and mouse support
 +
* {{AUR|dmenu2}}: dmenu fork with many useful patches applied and additional capabilities added including dimming, specifying a custom opacity, and underlining.
 +
 
 +
You may run ''dmenu'' with:
  
 
  $ dmenu_run
 
  $ dmenu_run
Line 15: Line 29:
 
== Configuration ==
 
== Configuration ==
  
Now, you will want to attach the {{Ic|dmenu_run}} command to a keystroke combination. This can be done either via your window manager or desktop environment configuration, or with a program like {{Pkg|xbindkeys}}. See the [[Hotkeys]] article for more information.
+
Now, you will want to attach the {{Ic|dmenu_run}} command to a keystroke combination. This can be done either via your window manager or desktop environment configuration, or with a program like {{Pkg|xbindkeys}}. See the [[Hotkeys]] article for more information. Also, it is helpful to [[Prelink]] ''dmenu''.
Also, it is helpful to [[Prelink]] dmenu.
+
  
 
=== Displaying Custom Items ===
 
=== Displaying Custom Items ===
 
+
Custom items may be shown by piping them into ''dmenu''. For example:
Custom items may be shown by piping them into dmenu. For example:
+
  
 
  $ echo -e "first\nsecond\nthird" | dmenu
 
  $ echo -e "first\nsecond\nthird" | dmenu
 +
 +
=== Manually Adding Items ===
 +
''dmenu'' will look for executables in the directories defined in your {{ic|$PATH}}. See the following article for information on modifying your {{ic|$PATH}}: [[Environment variables]]
  
 
=== Fonts ===
 
=== Fonts ===
  
dmenu can be patched to allow using xft [[fonts]] which don't seem to be working with the version from upstream. The patched version can be found in the {{AUR|dmenu-xft}} package from the [[AUR]]. Using this version, fonts like Droid Sans Mono can be set.
+
{{Out of date|Since dmenu 4.6 XFT font rendering is enabled by default: [http://lists.suckless.org/dev/1511/27503.html 4.6 Release Notes]. Specifying fonts via [[wikipedia:XLFD|X logical font description]] does not work anymore. Instead {{Pkg|fontconfig}}'s [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html font.conf syntax] is used.}}
 +
 
 +
''dmenu'' can display fonts using the [[wikipedia:XLFD|X logical font description]] as found using the tool ''xfontsel'', which is provided by {{Pkg|xorg-xfontsel}}. This example will run dmenu using the {{Pkg|terminus-font}}:
 +
 
 +
$ dmenu_run -fn "-xos4-terminus-medium-r-*-*-14-*"
 +
 
 +
The syntax is similar if using a ''dmenu'' variant patched with XFT support.
  
 
  $ dmenu_run -fn 'Droid Sans Mono-9'
 
  $ dmenu_run -fn 'Droid Sans Mono-9'
 +
 +
=== Support for shell aliases ===
 +
''dmenu'' does not support [[Bash#Aliases|shell aliases]]. To have ''dmenu'' recognize your aliases, [[install]] the {{AUR|dmenu-recent-aliases}}{{Broken package link|{{aur-mirror|dmenu-recent-aliases}}}} package  from the [[AUR]] and run {{ic|dmenu_run_aliases}}. Your aliases must be in either {{ic|~/.bash_aliases}} or {{ic|~/.zsh_aliases}} to be recognized by ''dmenu_run_aliases''.
  
 
== Troubleshooting ==
 
== Troubleshooting ==
  
=== Strange segfaulting ===
+
=== No locale support ===
  
If executing {{Ic|dmenu_run}} results in an error similar to this:
+
Running ''dmenu_run'' results in the following error message:
  
{{bc|
+
{{hc|$ dmenu_run|
$ dmenu_run
+
no locale support
/usr/bin/dmenu_run: line 15: 1879 Segmentation fault          dmenu "$@" < "$cache"
+
 
}}
 
}}
  
And running dmenu crashes like the following:
+
Make sure that the environment variable {{ic|LANG}} is correctly set. See the following for more information: [[Locale#Troubleshooting]]
 
+
{{bc|
+
$ echo "blahblahblah" | dmenu
+
no locale support
+
Segmentation fault
+
}}
+
  
Make sure {{Ic|$LANG}} is set to something valid. For example, this problem may occur if one needs to set {{Ic|$LANG}} to {{ic|en_US.UTF_8}} or something similar in {{ic|/etc/locale.conf}} (see [[Locale.conf#Setting_system-wide_locale|locale.conf]]).
+
=== Missing menu entries ===
  
Keep in mind that the value contained in {{Ic|$LANG}} must be uncommented in {{ic|/etc/locale.gen}} and generated via [[Locale.conf#Enabling_necessary_locales|locale-gen]] as well.
+
If certain entries are missing from ''dmenu'', the cache may be malformed. Delete it and restart ''dmenu''.
 +
$ rm ~/.dmenu_cache
 +
$ rm ~/.cache/dmenu_run
 +
Note that there will most likely be only one cache file, depending on if {{ic|$XDG_CACHE_HOME}} is set. See the contents of {{ic|/usr/bin/dmenu_run}} for more information.
  
== See Also ==
+
== See also ==
 
* [http://tools.suckless.org/dmenu dmenu] &ndash; The official dmenu website
 
* [http://tools.suckless.org/dmenu dmenu] &ndash; The official dmenu website
* [http://dmwit.com/yeganesh Yeganesh] &ndash; a light wrapper that reorders commands based on popularity. Written in Haskell
+
* [https://bbs.archlinux.org/viewtopic.php?id=80145 Dmenu Hacking thread ] &ndash; Dmenu hacking thread in arch linux forums. An overview of scripts is provided in the [https://github.com/orschiro/dmenu-scripts-collection dmenu_scripts collection].
* [https://bitbucket.org/dehun/xboomx xboomx] &ndash; yet another light wrapper that reorders commands based on popularity. Written in Python. Minimal dependencies
+
* [https://aur.archlinux.org/packages.php?ID=33379 dmenu-launch (AUR)] &ndash; A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
+
* [https://bbs.archlinux.org/viewtopic.php?id=80145 Dmenu Hacking thread ] &ndash; Dmenu hacking thread in arch linux forums.
+

Latest revision as of 21:17, 13 December 2015

dmenu is a fast and lightweight dynamic menu for X. It reads arbitrary text from stdin, and creates a menu with one item for each line. The user can then select an item, through the arrow keys or typing a part of the name, and the line is printed to stdout. dmenu_run is a wrapper that ships with the dmenu distribution that allows its use as an application launcher.

Installation

Install the dmenu package from the official repositories. If you want the development build from git, install the dmenu-gitAUR package from the Arch User Repository.

Various patched variants exist which extend dmenu's default functionality. Consider installing one of the following packages from the AUR:

You may run dmenu with:

$ dmenu_run

Configuration

Now, you will want to attach the dmenu_run command to a keystroke combination. This can be done either via your window manager or desktop environment configuration, or with a program like xbindkeys. See the Hotkeys article for more information. Also, it is helpful to Prelink dmenu.

Displaying Custom Items

Custom items may be shown by piping them into dmenu. For example:

$ echo -e "first\nsecond\nthird" | dmenu

Manually Adding Items

dmenu will look for executables in the directories defined in your $PATH. See the following article for information on modifying your $PATH: Environment variables

Fonts

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Since dmenu 4.6 XFT font rendering is enabled by default: 4.6 Release Notes. Specifying fonts via X logical font description does not work anymore. Instead fontconfig's font.conf syntax is used. (Discuss in Talk:Dmenu#)

dmenu can display fonts using the X logical font description as found using the tool xfontsel, which is provided by xorg-xfontsel. This example will run dmenu using the terminus-font:

$ dmenu_run -fn "-xos4-terminus-medium-r-*-*-14-*"

The syntax is similar if using a dmenu variant patched with XFT support.

$ dmenu_run -fn 'Droid Sans Mono-9'

Support for shell aliases

dmenu does not support shell aliases. To have dmenu recognize your aliases, install the dmenu-recent-aliasesAUR[broken link: archived in aur-mirror] package from the AUR and run dmenu_run_aliases. Your aliases must be in either ~/.bash_aliases or ~/.zsh_aliases to be recognized by dmenu_run_aliases.

Troubleshooting

No locale support

Running dmenu_run results in the following error message:

$ dmenu_run
no locale support

Make sure that the environment variable LANG is correctly set. See the following for more information: Locale#Troubleshooting

Missing menu entries

If certain entries are missing from dmenu, the cache may be malformed. Delete it and restart dmenu.

$ rm ~/.dmenu_cache
$ rm ~/.cache/dmenu_run

Note that there will most likely be only one cache file, depending on if $XDG_CACHE_HOME is set. See the contents of /usr/bin/dmenu_run for more information.

See also