commit a482a7fd7e44f8f3eb912e97bba37eec44478c7d
Author: Thuban <thuban_AT_singularity.fr>
Date: Thu Jun 20 10:05:57 2013 +0200
added script section to dmenu, with one example
diff --git a/tools.suckless.org/dmenu/scripts/index.md b/tools.suckless.org/dmenu/scripts/index.md
new file mode 100644
index 0000000..f6418d7
--- /dev/null
+++ b/tools.suckless.org/dmenu/scripts/index.md
_AT_@ -0,0 +1,13 @@
+Scripts using dmenu
+=====
+
+dmenu's user, feel free to add your own scripts, or comment existents.
+
+Download
+--------
+
+* [run-recent](run-recent) : List recent commands first. End a command
+ with ";" to run it in e terminal.
+ [source](
https://bbs.archlinux.org/viewtopic.php?id=56646&p=12)
+
+
diff --git a/tools.suckless.org/dmenu/scripts/run-recent b/tools.suckless.org/dmenu/scripts/run-recent
new file mode 100755
index 0000000..654e2b5
--- /dev/null
+++ b/tools.suckless.org/dmenu/scripts/run-recent
_AT_@ -0,0 +1,23 @@
+#!/bin/sh
+# end a command with ; to run in a terminal
+
+SB="#336699"
+SF="#ccc"
+NB="#111"
+NF="#ccc"
+OPTIONS="-fn $FN -nb $NB -nf $NF -sb $SB -sf $SF -i"
+
+DMENU="dmenu -i $OPTIONS"
+TERMI="st -e"
+CACHE="$HOME/.dmenu_cache_recent"
+
+touch $CACHE
+MOST_USED=`sort $CACHE | uniq -c | sort -r | colrm 1 8`
+RUN=`(echo "$MOST_USED"; dmenu_path | grep -vxF "$MOST_USED") | $DMENU $_AT_` &&
+(echo $RUN; head -n 99 $CACHE) > $CACHE.$$ &&
+mv $CACHE.$$ $CACHE
+
+case $RUN in
+ *\;) exec `echo $TERMI $RUN | sed -e 's/;$//'`;;
+ *) exec $RUN;;
+esac
Received on Thu Jun 20 2013 - 10:06:02 CEST