[hackers] [wmii] Update docs; install wmii.pdf. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 29 Sep 2009 00:12:31 +0000 (UTC)

changeset: 2492:f85f25277fa6
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Sep 28 20:09:38 2009 -0400
files: .hgignore Makefile config.mk doc/wmii.pdf doc/wmii.tex man/wmii.1 man/wmii.man1 mk/common.mk mk/hdr.mk mk/wmii.mk
description:
Update docs; install wmii.pdf.

diff -r b6e9a0875f95 -r f85f25277fa6 .hgignore
--- a/.hgignore Mon Sep 28 17:24:01 2009 -0400
+++ b/.hgignore Mon Sep 28 20:09:38 2009 -0400
@@ -1,7 +1,7 @@
 syntax: regexp
 (^|/)\.((.*\.)?sw.|depend|hgignore)$
 (^|/)(tags|mkfile)$
-\.([oa]|out|o_pic|so|orig|bak|pyc|pyo)$
+\.([oa]|out|o_pic|so|orig|bak|pyc|pyo|rej)$
 ^cmd/(stfo|osd|wiwarp)(/|$)
 syntax: glob
 config.local.mk
diff -r b6e9a0875f95 -r f85f25277fa6 Makefile
--- a/Makefile Mon Sep 28 17:24:01 2009 -0400
+++ b/Makefile Mon Sep 28 20:09:38 2009 -0400
@@ -6,6 +6,7 @@
         libwmii_hack \
         rc \
         alternative_wmiircs \
+ doc \
         man
 
 DIRS = \
diff -r b6e9a0875f95 -r f85f25277fa6 config.mk
--- a/config.mk Mon Sep 28 17:24:01 2009 -0400
+++ b/config.mk Mon Sep 28 20:09:38 2009 -0400
@@ -4,6 +4,7 @@
 PREFIX = /usr/local
   BIN = $(PREFIX)/bin
   MAN = $(PREFIX)/share/man
+ DOC = $(PREFIX)/share/doc/wmii
   ETC = $(PREFIX)/etc
   LIBDIR = $(PREFIX)/lib
   INCLUDE = $(PREFIX)/include
diff -r b6e9a0875f95 -r f85f25277fa6 doc/wmii.pdf
Binary file doc/wmii.pdf has changed
diff -r b6e9a0875f95 -r f85f25277fa6 doc/wmii.tex
--- a/doc/wmii.tex Mon Sep 28 17:24:01 2009 -0400
+++ b/doc/wmii.tex Mon Sep 28 20:09:38 2009 -0400
@@ -1057,6 +1057,11 @@
         ‹Command›. ‹Command› is split according to rc quoting
         rules, and no expansion occurs. If the command fails to
         execute, \wmii\ will respawn.
+ \item[spawn ‹Command›] Spawns ‹Command› as it would spawn
+ |wmiirc| at startup. If ‹Command› is a single argument
+ and doesn't begin with |/| or |./|,\hskip 1ex|$WMII_CONFPATH| is
+ searched for the executable. Otherwise, the whole
+ argument is passed to the shell for evaluation.
     \end{description}
   \item[props] The client's window class (the X11 |WM_CLASS|
     property) and title string, separated by colons. This file
@@ -1108,7 +1113,7 @@
     wmiir xwrite /ctl view ${2##*-};;
 \end{code}
 
-\section{Tying it All Together}
+\section{Tieing it All Together}
 
 \begin{code}
   #!/bin/sh
@@ -1121,6 +1126,203 @@
   «Event Loop»
 \end{code}
 
+\section{The End Result}
+
+For clarity, here is the end result:
+
+\begin{code}
+ #!/bin/sh
+ # «Click Menu Initialization»
+ clickmenu() {
+ if res=$(wmii9menu -- “$@”); then eval “$res”; fi
+ }
+ # «Command Execution Initialization»
+ terminal() { wmiir setsid xterm “$@” }
+ proglist() {
+ IFS=: set -- $1
+ find -L $@ -maxdepth 1 -perm /111 | sed ‘s,.*/,,’ | sort | uniq
+ unset IFS
+ }
+
+ # «Configuration»
+ # «Theme Definitions»
+ normcolors=‘#000000 #c1c48b #81654f’
+ focuscolors=‘#000000 #81654f #000000’
+ background=‘#333333’
+ font=‘drift,-*-fixed-*-*-*-*-9-*-*-*-*-*-*-*’
+
+ xsetroot -solid $background
+ wmiir write /ctl <<!
+ border 2
+ focuscolors $focuscolors
+ normcolors $normcolors
+ font $font
+ grabmod Mod4
+ !
+
+ # «Bind Keys»
+ {
+ cat <<!
+ Mod4-space
+ Mod4-d
+ Mod4-s
+ Mod4-m
+ Mod4-a
+ Mod4-p
+ Mod4-t
+ Mod4-Return
+ Mod4-Shift-space
+ Mod4-f
+ Mod4-Shift-c
+ Mod4-Shift-t
+ Mod4-h
+ Mod4-j
+ Mod4-k
+ Mod4-l
+ Mod4-Shift-h
+ Mod4-Shift-j
+ Mod4-Shift-k
+ Mod4-Shift-l
+ !
+ for i in 1 2 3 4 5 6 7 8 9 0; do
+ echo Mod4-$i
+ echo Mod4-Shift-$i
+ done
+ } | wmiir write /keys
+
+ # «Event Loop»
+ # Broadcast a custom event
+ wmiir xwrite /event Start wmiirc
+
+ # Turn off globbing
+ set -f
+ # Open /event for reading
+ wmiir read /event |
+ # Read the events line by line
+ while read line; do
+ # Split the line into words, store in $@
+ set -- $line
+ event=$1; shift
+ line = "$(echo $line | sed ‘s/^[^ ]* //’ | tr -d ‘\n’)"
+
+ # Process the event
+ case $event in
+ Start) # Quit when a new instance starts
+ [ $1 = wmiirc ] && exit;;
+
+ # «Event Handlers»
+ # «View Button Events»
+ CreateTag) # CreateTag ‹Tag Name›
+ echo $normcolors $1 | wmiir create /lbar/$1;;
+ DestroyTag) # DestroyTag ‹Tag Name›
+ wmiir rm /lbar/$1;;
+ FocusTag) # FocusTag ‹Tag Name›
+ wmiir xwrite /lbar/$1 $focuscolors $1;;
+ UnfocusTag) # UnfocusTag ‹Tag Name›
+ wmiir xwrite /lbar/$* $normcolors $1;;
+
+ # «Urgency Events»
+ # The urgency events are ‘Client’ events when the program
+ # owning the window sets its urgency state. They're ‘Manager’
+ # events when wmii or the wmii user sets the state.
+ UrgentTag) # UrgentTag ‹‘Client’ or ‘Manager’› ‹Tag Name›
+ wmiir xwrite /lbar/$2 *$2;;
+ NotUrgentTag) # NotUrgentTag ‹‘Client’ or ‘Manager’› ‹Tag Name›
+ wmiir xwrite /lbar/$2 $2;;
+
+ # «Unresponsive Clients»
+ UnresponsiveClient) # UnresponsiveClient ‹Client ID›
+ {
+ # Use wihack to make the xmessage a transient window of
+ # the problem client. This will force it to open in the
+ # floaing layer of whatever views the client is attached to
+ resp=$(wihack -transient $1 \
+ xmessage -nearmouse -buttons Kill,Wait -print \
+ “The following client is not responding.” \
+ “What would you like to do?$(echo)” \
+ $(wmiir read /client/$1/label))
+ [ $resp = Kill ] && wmiir xwrite /client/$1/ctl slay
+ } &;;
+
+ # «Notice Events»
+ Notice)
+ wmiir xwrite /rbar/!notice $line
+ kill $xpid 2>/dev/null # Let's hope this isn't reused...
+ { sleep 5; wmiir xwrite /rbar/!notice ‘ ’; } &
+ xpid = $!;;
+
+ # «Key Events»
+ Key) # Key ‹Key Name›
+ case $1 in
+ # «Motion Keys»
+ Mod4-h) wmiir xwrite /tag/sel/ctl select left;;
+ Mod4-l) wmiir xwrite /tag/sel/ctl select right;;
+ Mod4-k) wmiir xwrite /tag/sel/ctl select up;;
+ Mod4-j) wmiir xwrite /tag/sel/ctl select down;;
+ Mod4-space) wmiir xwrite /tag/sel/ctl select toggle;;
+
+ # «Client Movement Keys»
+ Mod4-Shift-h) wmiir xwrite /tag/sel/ctl send sel left;;
+ Mod4-Shift-l) wmiir xwrite /tag/sel/ctl send sel right;;
+ Mod4-Shift-k) wmiir xwrite /tag/sel/ctl send sel up;;
+ Mod4-Shift-j) wmiir xwrite /tag/sel/ctl send sel down;;
+ Mod4-Shift-space) wmiir xwrite /tag/sel/ctl send sel toggle;;
+
+ # «Column Mode Keys»
+ Mod4-d) wmiir xwrite /tag/sel/ctl colmode sel -stack-max;;
+ Mod4-s) wmiir xwrite /tag/sel/ctl colmode sel stack-max;;
+ Mod4-m) wmiir xwrite /tag/sel/ctl colmode sel stack+max;;
+
+ # «Client Command Keys»
+ Mod4-Shift-c) wmiir xwrite /client/sel/ctl kill;;
+ Mod4-f) wmiir xwrite /client/sel/ctl Fullscreen toggle;;
+
+ # «Command Execution Keys»
+ Mod4-Return) terminal & ;;
+ Mod4-p) eval exec wmiir setsid "$(proglist $PATH | wimenu)" &;;
+ Mod4-a) {
+ set -- $(proglist $WMII_CONFPATH | wimenu)
+ prog = $( (PATH=$WMII_CONFPATH which $1) ); shift
+ eval exec $prog “$@”
+ } &;;
+
+ # «Tag Selection Keys»
+ Mod4-Shift-t)
+ # Prompt the user for a tag
+ tags=$(wmiir ls /tag | sed ‘s,/,,; /sel/d’ | wimenu)
+ # Write it to the filesystem.
+ wmiir xwrite /ctl view $tag;;
+ Mod4-[0-9])
+ wmiir xwrite /ctl view ${2##*-};;
+
+ # «Tagging Keys»
+ Mod4-Shift-t)
+ # Get the selected client's id
+ c=$(wmiir read /client/sel/tag | sed 1q)
+ # Prompt the user for new tags
+ tags=$(wmiir ls /tag | sed ‘s,/,,; /sel/d’ | wimenu)
+ # Write them to the client
+ wmiir xwrite /client/$c/tags $tag;;
+ Mod4-Shift-[0-9])
+ wmiir xwrite /client/sel/tags ${2##*-};;
+
+ esac;;
+
+ # «Client Menu Events»
+ ClientMouseDown) # ClientMouseDown ‹Client ID› ‹Button›
+ [ $2 = 3 ] && clickmenu \
+ “Delete:xwrite /client/$1/ctl kill” \
+ “Kill:xwrite /client/$1/ctl slay” \
+ “Fullscreen:/client/$1/ctl Fullscreen on”
+
+ # «Tag Menu Events»
+ LeftBarMouseDown) # LeftBarMouseDown ‹Button› ‹Bar Name›
+ [ $1 = 3 ] && clickmenu \
+ “Delete:delete_view $2”
+ esac
+ done
+\end{code}
+
 \backmatter
 
 \printindex
diff -r b6e9a0875f95 -r f85f25277fa6 man/wmii.1
--- a/man/wmii.1 Mon Sep 28 17:24:01 2009 -0400
+++ b/man/wmii.1 Mon Sep 28 20:09:38 2009 -0400
@@ -359,6 +359,15 @@
 exec \fI<prog>\fR
 Replace \fBwmii\fR with \fI<prog>\fR
 
+.RS
+: spawn \fI<prog>\fR
+.RS
+Spawn a new program, as if by the \fI\-r\fR flag.
+.RE
+.RE
+.P
+ :
+:
 
 .SS The /client/ Hierarchy
 .P
@@ -525,10 +534,10 @@
 /tmp/ns.\fB$USER\fR.\fB${DISPLAY\fR%.0\fB}\fR/wmii
 The wmii socket file which provides a 9P service.
 .TP
-/home/kris/wmiiinst/etc/wmii\-3.5
+/home/kris/wmiiinst/etc/wmii-hg
 Global action directory.
 .TP
-\fB$HOME\fR/.wmii\-3.5
+\fB$HOME\fR/.wmii-hg
 User\-specific action directory. Actions are first searched here.
 
 
@@ -550,6 +559,9 @@
 dmenu(1), wmiir(1)
 
 .P
+/home/kris/wmiiinst/share/doc/wmii/wmii.pdf
+
+.P
 \fI[1]\fR http://www.suckless.org/wiki/wmii/tips/9p_tips
 
 
diff -r b6e9a0875f95 -r f85f25277fa6 man/wmii.man1
--- a/man/wmii.man1 Mon Sep 28 17:24:01 2009 -0400
+++ b/man/wmii.man1 Mon Sep 28 20:09:38 2009 -0400
@@ -10,7 +10,7 @@
 
 = SYNOPSIS =
 
-wmii [-a <address>] [-c <wmiirc>] +
+wmii [-a <address>] [-r <wmiirc>] +
 wmii -v
 
 = DESCRIPTION =
@@ -300,6 +300,8 @@
                 Quit `wmii`
         : exec <prog>
                 Replace `wmii` with <prog>
+ : spawn <prog>
+ Spawn a new program, as if by the _-r_ flag.
         :
 :
 
@@ -451,5 +453,7 @@
 = SEE ALSO =
 dmenu(1), wmiir(1)
 
+@DOCDIR@/wmii.pdf
+
 [1] http://www.suckless.org/wiki/wmii/tips/9p_tips
 
diff -r b6e9a0875f95 -r f85f25277fa6 mk/common.mk
--- a/mk/common.mk Mon Sep 28 17:24:01 2009 -0400
+++ b/mk/common.mk Mon Sep 28 20:09:38 2009 -0400
@@ -4,7 +4,7 @@
 
 MANDIRS=$(MAN)/man1
 mkdirs:
- for i in $(BIN) $(ETC) $(LIBDIR) $(MANDIRS) $(INCLUDE); do \
+ for i in $(BIN) $(ETC) $(DOC) $(LIBDIR) $(MANDIRS) $(INCLUDE); do \
                 test -d $(DESTDIR)$$i || echo MKDIR $$i; \
                 mkdir -pm 0755 $(DESTDIR)$$i; \
         done
diff -r b6e9a0875f95 -r f85f25277fa6 mk/hdr.mk
--- a/mk/hdr.mk Mon Sep 28 17:24:01 2009 -0400
+++ b/mk/hdr.mk Mon Sep 28 20:09:38 2009 -0400
@@ -29,7 +29,7 @@
 BINSH != echo /bin/sh
 
 .SILENT:
-.SUFFIXES: .out .o .o_pic .c .sh .rc .$(SOEXT) .awk .1 .man1 .depend .install .uninstall .clean
+.SUFFIXES: .out .o .o_pic .c .pdf .sh .rc .$(SOEXT) .awk .1 .man1 .depend .install .uninstall .clean
 all:
 
 .c.depend:
@@ -87,6 +87,14 @@
         echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
         rm -f $(DESTDIR)$(INCLUDE)/$<
 
+.pdf.install:
+ echo INSTALL $$($(CLEANNAME) $(BASE)$<)
+ cp -f $< $(DESTDIR)$(DOC)/$<
+ chmod 0644 $(DESTDIR)$(DOC)/$<
+.pdf.uninstall:
+ echo UNINSTALL $$($(CLEANNAME) $(BASE)$<)
+ rm -f $(DESTDIR)$(DOC)/$<
+
 .1.install:
         set -e; \
         man=1; \
diff -r b6e9a0875f95 -r f85f25277fa6 mk/wmii.mk
--- a/mk/wmii.mk Mon Sep 28 17:24:01 2009 -0400
+++ b/mk/wmii.mk Mon Sep 28 20:09:38 2009 -0400
@@ -11,6 +11,7 @@
 FILTER = sed "s|@CONFPREFIX@|$(ETC)|g; \
               s|@CONFVERSION@|$(CONFVERSION)|g; \
               s|@P9PATHS@|$(P9PATHS)|g; \
+ s|@DOCDIR@|$(DOC)|g; \
               s|@LIBDIR@|$(LIBDIR)|g; \
               s|@BINSH@|$(BINSH)|g; \
               s|@AWKPATH@|$(AWKPATH)|g"
Received on Tue Sep 29 2009 - 00:12:31 UTC

This archive was generated by hypermail 2.2.0 : Tue Sep 29 2009 - 00:24:05 UTC