diff options
Diffstat (limited to 'dmenu_omit')
-rwxr-xr-x | dmenu_omit | 22 |
1 files changed, 22 insertions, 0 deletions
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 + |