[wiki] [sites] Add dmenu_run_i script to start a command in term if input ends with ! || prx

From: <git_AT_suckless.org>
Date: Mon, 19 Aug 2019 09:54:08 +0200

commit 46f3a2cfe06fba98d15a35b9f04d9c9b36711321
Author: prx <prx_AT_ybad.name>
Date: Mon Aug 19 09:54:33 2019 +0200

    Add dmenu_run_i script to start a command in term if input ends with !

diff --git a/tools.suckless.org/dmenu/scripts/dmenu_run_i b/tools.suckless.org/dmenu/scripts/dmenu_run_i
new file mode 100755
index 00000000..a232e78a
--- /dev/null
+++ b/tools.suckless.org/dmenu/scripts/dmenu_run_i
_AT_@ -0,0 +1,14 @@
+#!/bin/sh
+# dmenu_run improved
+# if a command ends with "!", it is started in term.
+
+termcmd="st -e"
+test -s $HOME/.dmenurc && . $HOME/.dmenurc
+
+cmd="$(dmenu_path | dmenu $_AT_)"
+case $cmd in
+ *\! ) ${termcmd} "$(printf "%s" "${cmd}" | cut -d'!' -f1)";;
+ * ) ${cmd} ;;
+esac
+exit
+
diff --git a/tools.suckless.org/dmenu/scripts/index.md b/tools.suckless.org/dmenu/scripts/index.md
index df30a0c2..3128abab 100644
--- a/tools.suckless.org/dmenu/scripts/index.md
+++ b/tools.suckless.org/dmenu/scripts/index.md
_AT_@ -32,3 +32,5 @@ Download
   remove it.
 * [via](https://github.com/xalexalex/via): simple dmenu-based launcher for apps,
   files, folders and shell commands
+* [dmenu_run_i](./dmenu_run_i): When dmenu_path input end with "!", the
+command is started in a terminal. i.e. "top!".
Received on Mon Aug 19 2019 - 09:54:08 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 19 2019 - 10:00:25 CEST