How to set dmenu's $PATH (especially in LightDM)

Share your own howto's etc. Not for support questions!

How to set dmenu's $PATH (especially in LightDM)

Postby confuseling » 2014-06-13 08:34

(edit - heavily revised after a bit more research / head scratching)

This has been driving me nutty for ages.

dmenu_run uses the $SHELL's environment to execute commands through the $SHELL.

So how to add something to the path it sees depends on what your login shell is set to. It seems to also depend on how you log in to the system, in a way I really don't understand (any insight is welcome if you do...).

Still, this seems to be working for several systems.

If it's bash (the default), ~/.bashrc is a likely candidate. Add something like

Code: Select all
export PATH="$HOME/mybinaries:$PATH"

If it's zsh, edit ~/.zshenv to include

Code: Select all
typeset -U path
path=(~/mybinaries $path)

If all else fails (and it seems to at least sometimes with Zsh and LightDM), adding the bash example to ~/.xsessionrc can work.

Whichever your method, you may need to delete ~/cache/dmenu_run (~/.dmenu_cache in older versions) and log out and back in again.

Credit to this page ... ightdm-i3/ for the ~/.xsessionrc trick, and the Arch wiki for the right Zsh syntax.
The Forum's search box is terrible. Use site specific search, e.g. ... terms+here
Posts: 2144
Joined: 2009-10-21 01:03

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 4 guests