Difference between revisions of "Dmenu"

From ArchWiki
Jump to: navigation, search
(Installation)
(Style updates, see Help:Style)
Line 8: Line 8:
 
== Installation ==
 
== Installation ==
  
Installing dmenu is simple:
+
[[Pacman|Install]] {{Pkg|dmenu}} from the [[official repositories]].
# pacman -S dmenu
+
 
 +
You may run dmenu with
  
run it
 
 
  $ dmenu_run
 
  $ dmenu_run
 
to display own items
 
$ echo "first\nsecond\nthird" | dmenu
 
  
 
== 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.
  
== Strange segfaulting ==
+
=== Displaying Custom Items ===
 +
 
 +
Custom items may be shown by piping them into dmenu. For example:
 +
 
 +
$ echo "first\nsecond\nthird" | dmenu
 +
 
 +
=== 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.
 +
 
 +
$ dmenu_run -fn 'Droid Sans Mono-9'
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Strange segfaulting ===
  
 
If executing {{Ic|dmenu_run}} results in an error similar to this:
 
If executing {{Ic|dmenu_run}} results in an error similar to this:
 +
 +
{{bc|
 
  $ dmenu_run
 
  $ dmenu_run
 
  /usr/bin/dmenu_run: line 15: 1879 Segmentation fault          dmenu "$@" < "$cache"
 
  /usr/bin/dmenu_run: line 15: 1879 Segmentation fault          dmenu "$@" < "$cache"
 +
}}
  
 
And running dmenu crashes like the following:
 
And running dmenu crashes like the following:
 +
 +
{{bc|
 
  $ echo "blahblahblah" | dmenu
 
  $ echo "blahblahblah" | dmenu
 
  no locale support
 
  no locale support
 
  Segmentation fault
 
  Segmentation fault
 +
}}
  
Make sure {{Ic|$LANG}} is set to something valid. For example, I was experiencing this problem because I had set {{Ic|$LANG}} to "en_US.UTF_8" in /etc/locale.conf. In my case it should have been "en_US.UTF-8".
+
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]]).
  
Keep in mind that the value contained in {{Ic|$LANG}} must be uncommented in /etc/locale.gen and generated via {{Ic|locale-gen}} as well.
+
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.
 
+
== More font support ==
+
dmenu can be patched to allow using more fonts which don't seem to be working with the version from mainstream. The patched version can be found on [https://bbs.archlinux.org/viewtopic.php?pid=1135475 AUR]. Using this version, fonts like Droid Sans mono can be set.
+
$ dmenu_run -fn 'Droid Sans Mono-9'
+
  
== External Resources ==
+
== 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
 
* [http://dmwit.com/yeganesh Yeganesh] &ndash; a light wrapper that reorders commands based on popularity
 
* [https://aur.archlinux.org/packages.php?ID=33379 dmenu-launch (AUR)] &ndash; A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
 
* [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.
 
* [https://bbs.archlinux.org/viewtopic.php?id=80145 Dmenu Hacking thread ] &ndash; Dmenu hacking thread in arch linux forums.

Revision as of 16:55, 9 June 2013


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 dmenu from the official repositories.

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 "first\nsecond\nthird" | dmenu

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 dmenu-xftAUR package from the AUR. Using this version, fonts like Droid Sans Mono can be set.

$ dmenu_run -fn 'Droid Sans Mono-9'

Troubleshooting

Strange segfaulting

If executing dmenu_run results in an error similar to this:

 $ dmenu_run
 /usr/bin/dmenu_run: line 15: 1879 Segmentation fault           dmenu "$@" < "$cache"

And running dmenu crashes like the following:

 $ echo "blahblahblah" 

Make sure $LANG is set to something valid. For example, this problem may occur if one needs to set $LANG to en_US.UTF_8 or something similar in /etc/locale.conf (see locale.conf).

Keep in mind that the value contained in $LANG must be uncommented in /etc/locale.gen and generated via locale-gen as well.

See Also

  • dmenu – The official dmenu website
  • Yeganesh – a light wrapper that reorders commands based on popularity
  • dmenu-launch (AUR) – A simple Dmenu-based application launcher. Launches binaries and XDG shortcuts.
  • Dmenu Hacking thread – Dmenu hacking thread in arch linux forums.