summaryrefslogtreecommitdiff
path: root/dmenu
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu')
-rwxr-xr-xdmenu28
1 files changed, 7 insertions, 21 deletions
diff --git a/dmenu b/dmenu
index 31f9f6e..0acd186 100755
--- a/dmenu
+++ b/dmenu
@@ -1,30 +1,16 @@
#!/bin/sh
TOFI_CONF="$XDG_CONFIG_HOME/tofi/themes/dmenu"
-while getopts "bPrl:p:" o; do case "${o}" in
- "b")
- ARGS="$ARGS --anchor=bottom"
- ;;
- "P")
- ARGS="$ARGS --hide-input=true"
- ;;
- "r")
- ARGS="$ARGS --require-match=true"
- ;;
- "l")
- TOFI_CONF="$XDG_CONFIG_HOME/tofi/themes/dmenu_vertical"
- ;;
- "p")
- ARGS="$ARGS --prompt-text=$OPTARG"
- ;;
- "*")
- notify-send "Unsupported tofi args!" "Unsupported tofi args!"
- ;;
-esac done
+if echo "$@" | grep -qE -- '-l [0-9]+'; then
+ TOFI_CONF="$XDG_CONFIG_HOME/tofi/themes/dmenu_vertical"
+ ARGS="$(echo "$@" | grep -qE -- '-l [0-9]+' | sed 's/-l [0-9]+//' )"
+else
+ ARGS="$@"
+fi
if [ -n "$WAYLAND_DISPLAY" ]; then
# Wayland
- tofi -c "$TOFI_CONF" $ARGS 2>/dev/null
+ tofi -c "$TOFI_CONF" -d $ARGS 2>/dev/null
unset ARGS
elif [ -n "$DISPLAY" ]; then
# X11