aboutsummaryrefslogtreecommitdiff
path: root/bin/my-dmenu
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-06-19 23:56:13 +0800
committerGuangxiong Lin <[email protected]>2022-06-19 23:56:13 +0800
commitb5d772f01e410d4fe0dcdc661c958657fbf0ca28 (patch)
tree54d3a01f991613df21e2e94ae4085d9b350a7308 /bin/my-dmenu
parent36286917b3e209fc4556d7350c065aee55a6f7ec (diff)
downloaddotfiles-b5d772f01e410d4fe0dcdc661c958657fbf0ca28.tar.gz
dotfiles-b5d772f01e410d4fe0dcdc661c958657fbf0ca28.tar.bz2
dotfiles-b5d772f01e410d4fe0dcdc661c958657fbf0ca28.zip
Switch to swaywm
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"