summaryrefslogtreecommitdiff
path: root/dmenu
blob: 31f9f6e50d351623f2cc6f9011ecc616ab4c475e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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