aboutsummaryrefslogtreecommitdiff
path: root/bin/my-dmenu
diff options
context:
space:
mode:
Diffstat (limited to 'bin/my-dmenu')
-rwxr-xr-xbin/my-dmenu28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/my-dmenu b/bin/my-dmenu
new file mode 100755
index 0000000..fe514b0
--- /dev/null
+++ b/bin/my-dmenu
@@ -0,0 +1,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"