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

tui_apps=(
    vim
    mutt

    nnn
    ranger

    newsboat
    podboat
    cmus
)

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

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

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

echo "$prog" | $shell &