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

tui_apps=(
    vim
    mutt
    neomutt

    nnn
    ranger

    newsboat
    podboat
    cmus
    ncmpcpp
    weechat
)

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"