summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdmenu33
1 files changed, 33 insertions, 0 deletions
diff --git a/dmenu b/dmenu
new file mode 100755
index 0000000..31f9f6e
--- /dev/null
+++ b/dmenu
@@ -0,0 +1,33 @@
+#!/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 [ -n "$WAYLAND_DISPLAY" ]; then
+ # Wayland
+ tofi -c "$TOFI_CONF" $ARGS 2>/dev/null
+ unset ARGS
+elif [ -n "$DISPLAY" ]; then
+ # X11
+ dmenu $@
+fi
+unset TOFI_CONF