[hackers] [wmii] Add rehash action to update the programs list and cleanup wmiirc a bit

From: Kris Maglione <jg_AT_suckless.org>
Date: Sun Feb 11 04:05:38 2007

changeset: 1837:f2dcb9621dbd
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sat Feb 10 22:04:13 2007 -0500
summary: Add rehash action to update the programs list and cleanup wmiirc a bit

diff -r a4d93bf92fd1 -r f2dcb9621dbd rc/rehash
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rc/rehash Sat Feb 10 22:04:13 2007 -0500
@@ -0,0 +1,8 @@
+#!/bin/sh
+proglist() {
+ ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq
+}
+
+proglist `echo "$PATH" | sed 'y/:/ /'` >$PROGS_FILE.new
+
+mv $PROGS_FILE.new $PROGS_FILE
diff -r a4d93bf92fd1 -r f2dcb9621dbd rc/wmiirc
--- a/rc/wmiirc Sat Feb 10 21:36:06 2007 -0500
+++ b/rc/wmiirc Sat Feb 10 22:04:13 2007 -0500
@@ -1,28 +1,15 @@
 #!/bin/sh
 # Configure wmii
 
-# FUNCTIONS
-xwrite() {
- file="$1"; shift
- echo -n "$@" | wmiir write "$file"
-}
-
-proglist() {
- ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq
-}
-
-conf_which () {
- prog=$1; shift
- if [ -n "$prog" ]
- then
- echo `PATH="$WMII_CONFPATH:$PATH" which $prog` "$@"
- fi
-}
-
-tagsmenu() {
- tag=`wmiir read /tag/sel/ctl`
- wmiir ls /tag | sed "s|/||; /^sel\$/d" | $DMENU
-}
+# Contents
+# Configuration Variables
+# WM Configuration
+# Column Rules
+# Tagging Rules
+# Utility Functions
+# Tag Bar Setup
+# List of Bound Keys
+# Event Processing Loop
 
 # CONFIGURATION VARIABLES
 MODKEY=Mod1
@@ -67,16 +54,57 @@ wmiir write /tagrules <<EOF
 /.*/ -> 1
 EOF
 
+# FUNCTIONS
+xwrite() {
+ file="$1"; shift
+ echo -n "$@" | wmiir write "$file"
+}
+
+proglist() {
+ ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq
+}
+
+conf_which () {
+ prog=$1; shift
+ if [ -n "$prog" ]; then
+ echo `PATH="$WMII_CONFPATH:$PATH" which $prog` "$@"
+ fi
+}
+
+tagsmenu() {
+ tag=`wmiir read /tag/sel/ctl`
+ wmiir ls /tag | sed "s|/||; /^sel\$/d" | $DMENU
+}
+
+
 # MISC
 PROGS_FILE="$WMII_NS_DIR/.dmenu.proglist"
 ACTIONS_DIRS=`echo "$WMII_CONFPATH" | tr : ' '`
 
 `conf_which status` &
-xsetroot -solid $WMII_BACKGROUND
-proglist `echo "$PATH" | tr : ' '` >$PROGS_FILE &
+xsetroot -solid $WMII_BACKGROUND &
+proglist `echo "$PATH" | sed 'y/:/ /'` >$PROGS_FILE &
 
 # Stop any running instances of wmiirc
 echo Start wmiirc | wmiir write /event || exit 1
+
+# SETUP TAG BAR
+wmiir ls /lbar |
+while read bar
+do
+ wmiir remove "/lbar/$bar"
+done
+
+seltag="`wmiir read /tag/sel/ctl 2>/dev/null`"
+wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
+while read tag
+do
+ if [ "X$tag" = "X$seltag" ]; then
+ echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
+ else
+ echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
+ fi
+done
 
 # BOUND KEYS
 wmiir write /keys <<EOF
@@ -120,24 +148,6 @@ wmiir write /keys <<EOF
 $MODKEY-Shift-8
 $MODKEY-Shift-9
 EOF
-
-# SETUP TAG BAR
-wmiir ls /lbar |
-while read bar
-do
- wmiir remove "/lbar/$bar"
-done
-
-seltag="`wmiir read /tag/sel/ctl 2>/dev/null`"
-wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
-while read tag
-do
- if [ "X$tag" = "X$seltag" ]; then
- echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
- else
- echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
- fi
-done
 
 # EVENT LOOP
 wmiir read /event 2>/dev/null |
Received on Sun Feb 11 2007 - 04:05:38 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:09 UTC