aboutsummaryrefslogtreecommitdiff
path: root/bin/my-dmenu-run
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-02-04 22:40:02 +0800
committerGuangxiong Lin <[email protected]>2022-02-04 22:40:02 +0800
commit9f008af03f54ae9a3f9aecb83581cd79a84be7a3 (patch)
treef84884e5715bc7382678eb4f909a7024cc858700 /bin/my-dmenu-run
parent43983b7240f4b64b6e8415beb296507a77c52587 (diff)
downloaddotfiles-9f008af03f54ae9a3f9aecb83581cd79a84be7a3.tar.gz
dotfiles-9f008af03f54ae9a3f9aecb83581cd79a84be7a3.tar.bz2
dotfiles-9f008af03f54ae9a3f9aecb83581cd79a84be7a3.zip
Add my custom dmenu_run script
Diffstat (limited to 'bin/my-dmenu-run')
-rwxr-xr-xbin/my-dmenu-run24
1 files changed, 24 insertions, 0 deletions
diff --git a/bin/my-dmenu-run b/bin/my-dmenu-run
new file mode 100755
index 0000000..6596b52
--- /dev/null
+++ b/bin/my-dmenu-run
@@ -0,0 +1,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 &