From eba1b09b5b72806d90dc255f3dba1eb573fa9c08 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Sat, 24 Dec 2022 10:48:30 -0500 Subject: add patch: dmenu_omit - filter omitted entries dmenu_omit is a filtering tool that appends any supplied entries to a list of items to filter from the dmenu result. This allows the user to remove troublesome items that exist in path, that need to exist in path, but are useless from dmenu. dmenu_omit is the command line tool to append these items to the list. dmenu_path was modified to filter based on the items in this list. dmenu_omitlist is the file stored in your configdir containing these files. Makefile was updated to install/uninstall the dmenu_omit --- dmenu_omit | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 dmenu_omit (limited to 'dmenu_omit') diff --git a/dmenu_omit b/dmenu_omit new file mode 100755 index 0000000..d07d8f8 --- /dev/null +++ b/dmenu_omit @@ -0,0 +1,22 @@ +#!/bin/sh + +configdir="${XDG_CONFIG_HOME:-"$HOME/.config/dmenu"}" +config="$configdir/dmenu_omitlist" + +[ ! -e "$configdir" ] && mkdir -p "$configdir" + +if [ $# -lt 1 ]; then + echo "Missing argument(s). + Usage: dmenu_omit item" >&2 + exit 1 +fi + +for item in "$@" +do + echo "$item" >> $config +done + +# using grep to filter out any blanks or empty lines +# useful if manually edited +cat -s $config | grep -v -E '^([[:space:]])*$' | sort -u -o $config + -- cgit v1.2.3-54-g00ecf