[hackers] [wmii] Add command history to rc.wmii || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 14 Oct 2008 04:17:06 +0000 (UTC)

changeset: 2361:cc274f4cc289
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Oct 14 00:17:01 2008 -0400
files: cmd/Makefile cmd/menu/Makefile cmd/wmii.rc.rc rc/rc.wmii.rc
description:
Add command history to rc.wmii

diff -r fd1f153409b1 -r cc274f4cc289 cmd/Makefile
--- a/cmd/Makefile Tue Oct 14 00:02:30 2008 -0400
+++ b/cmd/Makefile Tue Oct 14 00:17:01 2008 -0400
@@ -4,7 +4,8 @@
 
 wmiir.c: $(ROOT)/mk/wmii.mk
 
-DIRS = wmii
+DIRS = wmii \
+ menu
 TARG = wihack \
         wmii.rc \
         wmii.sh \
diff -r fd1f153409b1 -r cc274f4cc289 cmd/menu/Makefile
--- a/cmd/menu/Makefile Tue Oct 14 00:02:30 2008 -0400
+++ b/cmd/menu/Makefile Tue Oct 14 00:17:01 2008 -0400
@@ -4,7 +4,7 @@
 
 main.c: $(ROOT)/mk/wmii.mk
 
-TARG = menu
+TARG = wimenu
 HFILES= dat.h fns.h
 
 LIB = $(LIBIXP)
diff -r fd1f153409b1 -r cc274f4cc289 cmd/wmii.rc.rc
--- a/cmd/wmii.rc.rc Tue Oct 14 00:02:30 2008 -0400
+++ b/cmd/wmii.rc.rc Tue Oct 14 00:17:01 2008 -0400
@@ -42,12 +42,6 @@
 wmiifont=`{wi_readctl font}
 wmiinormcol=`{wi_readctl normcolors}
 wmiifocuscol=`{wi_readctl focuscolors}
-
-fn wi_menu {
- dmenu -b -fn $wmiifont \
- -nf $wmiinormcol(1) -nb $wmiinormcol(2) \
- -sf $wmiifocuscol(1) -sb $wmiifocuscol(2)
-}
 
 fn wi_9menu {
         wmii9menu -font `{echo $wmiifont | sed 's/,.*//'} \
diff -r fd1f153409b1 -r cc274f4cc289 rc/rc.wmii.rc
--- a/rc/rc.wmii.rc Tue Oct 14 00:02:30 2008 -0400
+++ b/rc/rc.wmii.rc Tue Oct 14 00:17:01 2008 -0400
@@ -215,17 +215,21 @@
         wmiir xwrite /client/sel/ctl kill}
 
 key $MODKEY-a || fn $key {
- Action `{wi_actions | wi_menu} &}
+ Action `{wi_actions | wimenu} &}
 key $MODKEY-p || fn $key {
- ifs=() { wi_runcmd `{wi_menu <$progs_file} & }}
+ ifs=() { cmd = `{wimenu -h $progs_hist <$progs_file} }
+ wi_runcmd $cmd &
+ { cat $progs_hist; echo $cmd; } | uniq | sed '/^$/d' \
+ | tail -$progs_len >$progs_hist.$pid
+ mv $progs_hist.$pid $progs_hist}
 key $MODKEY-Return || fn $key {
         wi_runcmd $WMII_TERM &}
 
 key $MODKEY-t || fn $key {
- wmiir xwrite /ctl view `{wi_tags | wi_menu} &}
+ wmiir xwrite /ctl view `{wi_tags | wimenu} &}
 key $MODKEY-Shift-t || fn $key {
         sel = `{wmiir read /client/sel/ctl | sed 1q} \
- wmiir xwrite /client/$sel/tags `{wi_tags | wi_menu} &}
+ wmiir xwrite /client/$sel/tags `{wi_tags | wimenu} &}
 
 key $MODKEY-^`{seq 0 9} || fn $key {
         wmiir xwrite /ctl view `{echo $1 | sed 's/.*-//'}}
@@ -247,6 +251,9 @@
 
 # Misc Setup
 progs_file=`{namespace}^/proglist.$pid
+progs_hist=`{namespace}^/proghist
+progs_len=5000
+touch $progs_hist
 Action status &
 Action rehash &
 
Received on Tue Oct 14 2008 - 04:17:06 UTC

This archive was generated by hypermail 2.2.0 : Tue Oct 14 2008 - 04:24:05 UTC