aboutsummaryrefslogtreecommitdiff
path: root/bin/my-dmenu
blob: fe514b0a93da872f16242e4aca84d0fb897751cd (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
#!/bin/bash

tui_apps=(
    vim
    mutt

    nnn
    ranger

    newsboat
    podboat
    cmus
    ncmpcpp
)

terminal=${TERMINAL:-"/usr/bin/xterm"}

prog=$(dmenu_path | dmenu "$@")

if [[ " ${tui_apps[*]} " =~ " ${prog} " ]]; then
    prog="$terminal -e $prog"
fi

if [[ "${prog}" == emacs ]]; then
    prog="LC_CTYPE='zh_CN.UTF-8' emacs"
fi

echo "$prog"