You are not logged in.
this been asked before here but this is actually not a working answer. This excludes anything with that string of characters. So for instance if i wanted to exclude "Go" it would exclude say "google-chrome-stable" because it has "go" in it.
Is there a way to not do this, or better yet just exclude all non-gui applications?
Last edited by salmon (2022-08-30 15:59:14)
Offline
this been asked before here but this is actually not a working answer. This excludes anything with that string of characters. So for instance if i wanted to exclude "Go" it would exclude say "google-chrome-stable" because it has "go" in it.
Is there a way to not do this, or better yet just exclude all non-gui applications?
Just change the regex to include 'go$' but not 'go'?
Or just tell dmenu to only look at the desktop files in /usr/share/applications
Offline
Don't change the regex format - just don't do a regex match if that's not what you want. Perhaps you want the -x flag to grep.
Of course if you do just want "gui applications" using desktop files will be a much better approach.
Last edited by Trilby (2022-08-29 23:46:49)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Perhaps you want the -x flag to grep.
That just removes all suggestions.
Ive tried using .desktops before, and it generally works. I have a ~/Bin dir in my path where i put all my shell scripts and stuff from projects on github, appimages, etc. Anything not from a package manager. Its just that that area changes so often that its kinda a pain to amange all those .desktops.
Offline
I gather you removed the -v flag from grep. Don't flail, think about what the commands are doing. Read the man page(s) to get what you actually want.
Last edited by Trilby (2022-08-29 23:58:03)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
no i kept -v
grep -v -x -f(same result with and without -v)
Offline
Post the full command / script used as well as the list file.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Post the full command / script used as well as the list file.
sorry went to bed
#!/bin/sh
dmenu_path | grep -v --file=/home/salmon/.config/dmenu/dmenu_exclude | dmenu "$@" | ${SHELL:-"/bin/sh"} &
// list of excludes. "not_exec" is just a test sh script in ~/Bin
not_exec
disco
goOffline
What's "dmenu_path" and where's the "-x"?
Offline
Seth, dmenu_path is an executable from the dmenu package that is used in the dmenu_run script. It basically just lists all executables in $PATH (which is really silly as find will do this just fine on it's own).
Salmon, as noted above, the command you just posted is a bit different from what you claimed to not be working. In any case, test one bit at a time in an interactive shell, e.g.:
dmenu_path | grep ...Then you can see exactly what will / will not be included at polish your grep command and exclusion list as needed.
Last edited by Trilby (2022-08-30 15:32:15)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What's "dmenu_path"
$ cat $(which dmenu_path)
#!/bin/sh
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
cache="$cachedir/dmenu_run"
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
IFS=:
if stest -dqr -n "$cache" $PATH; then
stest -flx $PATH | sort -u | tee "$cache"
else
cat "$cache"
fii removed -x cause removed all results. maybe its seeing smthn like "disco\n" instead of "disco"
Offline
I'm guessing you posted what you *see* in your exclude file. I was asking for the actual file (e.g., on a file sharing site). I'd guess there may be a blank line in it.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
wget https://github.com/TH3-S4LM0N/AFishMadeThisWebsite/raw/main/dmenu_exclude just slapped it on my old website thing
Offline
That file works fine for me and I still get all the entries that don't match anything in that file.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
with "grep -v -f"?
Offline
Oh i see.
"grep -v -x -f" works, thanks!
Offline
Yeah, what I suggested in post #3 and you confirmed that your were (allegedly) using in post #6 but apparently didn't really try until #16.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
yeah i think in 6 i did '-x -f'; my bad
Last edited by salmon (2022-08-30 16:08:42)
Offline