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

tui_apps=(
    vim
    mutt

    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"