You are not logged in.

#1 2011-09-24 19:09:46

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

dmenu isn't loading everything in $PATH (scrotwm)

I'm using scrotwm, which has dmenu as it's launcher.  I have ~/bin added to $PATH in ~/.bashrc. It works fine in a shell.  dmenu isn't getting the scripts there, which it says it will in the the manual.

What am I missing?

Offline

#2 2011-09-24 19:25:52

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: dmenu isn't loading everything in $PATH (scrotwm)

The WM is irrelevant here.  The important part is the "dmenu_run" command.  It is a shell script responsible for scraping $PATH.  Looking at the script's source, it looks like it should work.

Did you remember to log out and back in after changing your $PATH?

Offline

#3 2011-09-24 20:04:16

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

Re: dmenu isn't loading everything in $PATH (scrotwm)

lol. Yeah, about a hundred times.

I've had ~/bin in $PATH almost since I installed Arch.  I doubt my script is different than your's, and it looks like it should work to me too, but I'm not pro, so here it is for review.

#!/bin/sh
CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run
(
	IFS=:
	if test "`ls -dt $PATH "$CACHE" 2> /dev/null | sed 1q`" != "$CACHE"; then
		mkdir -p "`dirname "$CACHE"`" && lsx $PATH | sort -u > "$CACHE"
	fi
)
cmd=`dmenu "$@" < "$CACHE"` && exec sh -c "$cmd"

Last edited by ninjaaron (2011-09-24 21:36:05)

Offline

#4 2011-10-04 09:23:41

kalhartt
Member
Registered: 2011-10-04
Posts: 2

Re: dmenu isn't loading everything in $PATH (scrotwm)

Deleting ~/.cache/dmenu_run fixed it for me. I guess the cache file isn't updating properly.

Offline

#5 2011-10-04 10:22:58

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: dmenu isn't loading everything in $PATH (scrotwm)

Setting $PATH in ~/.bashrc doesn't ensure your WM/dmenu will inherint this env.
A more relevant question to ask is, "How do you login?" Usually the env exported in ~/.bash_profile or ~/.profile are available in your X applications.
Launch dmenu_run as you normally do, then in dmenu, type

echo $PATH > /tmp/path

Then in a terminal, `cat /tmp/path` to see what that $PATH is.

Last edited by lolilolicon (2011-10-04 10:24:35)


This silver ladybug at line 28...

Offline

#6 2011-10-04 23:11:58

ninjaaron
Member
Registered: 2010-12-10
Posts: 296

Re: dmenu isn't loading everything in $PATH (scrotwm)

Looks like path for dmenu is this.
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl

Same as my shell path, minus ~/bin.  Hmm...  I login with slim, which uses my .xinitrc.  If I export a new value for $PATH in my .xinitrc, will that do anything?

This may also explain whey aurbuild keeps on telling me that $EDITOR isn't defined when it's also in my .bashrc  (or .zshrc, as it has recently become).

Offline

#7 2011-10-05 03:12:57

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: dmenu isn't loading everything in $PATH (scrotwm)

ninjaaron wrote:

Looks like path for dmenu is this.
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl

Same as my shell path, minus ~/bin.  Hmm...  I login with slim, which uses my .xinitrc.  If I export a new value for $PATH in my .xinitrc, will that do anything?

This may also explain whey aurbuild keeps on telling me that $EDITOR isn't defined when it's also in my .bashrc  (or .zshrc, as it has recently become).

Either exporting $PATH (and $EDITOR etc.) in .xinitrc or .bash_profile should do it.

The reason is SLiM's login command as set in /etc/slim.conf

login_cmd           exec /bin/bash --norc -login ~/.xinitrc %session

This silver ladybug at line 28...

Offline

#8 2020-10-31 08:51:11

supermario9590
Member
Registered: 2020-06-09
Posts: 17

Re: dmenu isn't loading everything in $PATH (scrotwm)

The dmenu_run script does NOT use Bash so your bash settings will not be used


Linux is simple, but it takes a genius to understand it

Offline

#9 2020-10-31 10:43:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: dmenu isn't loading everything in $PATH (scrotwm)

Please note that you are posting in a 9 year old thread so that might've very well been true back in those days. Don't necrobump

https://wiki.archlinux.org/index.php/Co … bumping%22

Closing.

Offline

Board footer

Powered by FluxBB