~mil/sxmo-utils

ref: 00e495374d48236c1332bd7f5ee2f73422c3ca54 sxmo-utils/scripts/core/sxmo_dmenu.sh -rwxr-xr-x 1010 bytes
00e49537Peter John Hartman (wart) bump up the number of lines in sxmo_dmenu.sh (see patch to sxmo-dmenu) a month ago
                                                                                
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env sh

# We still use dmenu in dwm|worgs cause pointer/touch events
# are not implemented yet in the X11 library of bemenu

case "$1" in
	isopen)
		case "$(sxmo_wm.sh)" in
			sway|ssh)
				exec pgrep bemenu
				;;
			xorg|dwm)
				exec pgrep dmenu
				;;
		esac
		;;
	close)
		case "$(sxmo_wm.sh)" in
			sway|ssh)
				exec pkill bemenu
				;;
			xorg|dwm)
				exec pkill dmenu
				;;
		esac
		;;
esac > /dev/null

case "$(sxmo_wm.sh)" in
	sway)
		swaymsg mode menu -q # disable default button inputs
		bemenu --scrollbar autohide -s -n -w -c -l "$(sxmo_rotate.sh isrotated > /dev/null && printf 8 ||  printf 15)" "$@"
		returned=$?
		swaymsg mode default -q
		exit "$returned"
		;;
	xorg|dwm)
		if sxmo_keyboard.sh isopen; then
			exec dmenu -c -l "$(sxmo_rotate.sh isrotated > /dev/null && printf 6 || printf 15)" "$@"
		else
			exec dmenu -c -l "$(sxmo_rotate.sh isrotated > /dev/null && printf 8 || printf 20)" "$@"
		fi
		;;
	ssh)
		export BEMENU_BACKEND=curses
		exec bemenu -w "$@"
		;;
esac