You are not logged in.

#1 2013-12-10 19:06:39

koshak
Member
Registered: 2013-03-13
Posts: 35

dmenu - launches apps with zsh process dependency

Hi!

dmenu launches any process as the child of shell, like this thunar example:

$ pstree
systemd─┬─at-spi-bus-laun─┬─dbus-daemon
        │                 └─3*[{at-spi-bus-laun}]
        ├─at-spi2-registr───{at-spi2-registr}
       ...
        ├─xfconfd
        └─zsh───thunar───2*[{thunar}]

If I type "thunar&", for example, it starts it without $SHELL support.

What's the intention? And is there any method to unbind executing prorgam from $SHELL?

Offline

#2 2013-12-12 17:47:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dmenu - launches apps with zsh process dependency

I think it's the way dmenu works:

man dmenu wrote:

dmenu_run is a script used by dwm(1) which lists programs in the user's $PATH and runs the result in their $SHELL.

Offline

#3 2014-01-04 20:30:06

koshak
Member
Registered: 2013-03-13
Posts: 35

Re: dmenu - launches apps with zsh process dependency

I modified dmenu_run a little bit if someone is curious to get it work as I want it to:

#!/bin/sh
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
	cache=$cachedir/dmenu_run
else
	cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
fi
$(
	IFS=:
	if stest -dqr -n "$cache" $PATH; then
		stest -flx $PATH | sort -u | tee "$cache" | dmenu "$@"
	else
		dmenu "$@" < "$cache"
	fi
)&

Offline

Board footer

Powered by FluxBB