You are not logged in.
Hi,
is there a way to create a filter list to prevent certain programs from showing up in dmenu or dmenu2?
Thanks ![]()
Last edited by ryzion (2015-07-01 20:47:06)
Offline
isn't that file being overwritten regularly?
Offline
dmenu is just a menu - the only things that show up are what is passed to dmenu via stdin. Dmenu_run, however, is probably what you are talking about - and that is just a *very* short script. Feel free to modify it (a `grep -v -f /path/to/your/excludes.file` would probably do it).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
cheers. probably a stupid question, but why doesn't that line work:
dmenu "$@" < "$cache" | grep -v -w -f $HOME/.scas/configs/user/dmenu_excludeOffline
You have to grep what goes into dmenu, not what comes out. I don't know what that cache variable is, but here is the original dmenu_run:
dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &You could edit that as follows:
dmenu_path | grep -v -f /home/username/configs/user/dmenu_exclude | dmenu "$@" | ${SHELL:-"/bin/sh"} &"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yep, funny enough I had it the line above.. my dmenu_run was a bit longer though. Here's the file if anyone else comes across this
#!/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" | grep -v -w -f $HOME/path/dmenu_exclude | dmenu "$@"
else
grep -v -w -f $HOME/path/dmenu_exclude "$cache" | dmenu "$@"
fi
) | ${SHELL:-"/bin/sh"} &Offline