Permalink
Browse files

Initial commit:

	new file: .Xresources
	new file: .emacs
	new file: .wmii-3.5/rc.wmii
	new file: .wmii-3.5/welcome
	new file: .wmii-3.5/wmiirc
	new file: .xmodmap
  • Loading branch information...
Noah Tye
Noah Tye committed Jun 20, 2008
0 parents commit a7015592de4e5b6b335d8c7a818796207979b8b0
Showing with 631 additions and 0 deletions.
  1. +6 −0 .Xresources
  2. +10 −0 .emacs
  3. +278 −0 .wmii-3.5/rc.wmii
  4. +57 −0 .wmii-3.5/welcome
  5. +262 −0 .wmii-3.5/wmiirc
  6. +18 −0 .xmodmap
@@ -0,0 +1,6 @@
+emacs.font: -windows-proggysquare-medium-r-normal--11-80-96-96-c-70-iso8859-1
+rxvt.font: -windows-proggysquare-medium-r-normal--11-80-96-96-c-70-iso8859-1
+rxvt.background: gray10
+rxvt.foreground: gray90
+rxvt.scrollBar: False
+rxvt.visualBell: True
10 .emacs
@@ -0,0 +1,10 @@
+;; noah tye's .emacs file.
+
+(global-set-key "\C-w" 'backward-kill-word)
+(global-set-key "\C-x\C-k" 'kill-region)
+(global-set-key "\C-c\C-k" 'kill-region)
+
+(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
+(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
+(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
+
@@ -0,0 +1,278 @@
+#!/usr/bin/env wmii9rc
+# WMII Configuration
+
+confpath=`{echo $WMII_CONFPATH | sed 'y/:/ /'}
+oldpath=$path
+path=($PLAN9/bin $path)
+
+# Sanity checks
+if(echo $0 | grep -s '(^|/)rc\.wmii\.local$') {
+ echo >[1=2] Fatal: This file must not be named rc.wmii.local
+ exit badname
+}
+
+fn config_whatis {
+ prog = `{@{path=$confpath whatis $1} | grep -v '^fn|=' || echo /dev/null}
+ shift; echo $prog $*
+}
+
+if(! test -x $PLAN9/bin/read) {
+ echo 'Can''t find the ''read'' command' >[1=2]
+ xmessage -file - <<'!'
+ path=$oldpath
+ exec `{config_whatis wmiirc}
+}
+rc.wmii can't run:
+ You have a Plan 9 utilities installed, but are missing the 'read' command.
+ This likely means that you have an out-of-date 9base installed.
+
+wmiirc will be run instead.
+!
+
+# Configurables
+MODKEY=Mod1
+UP=k
+DOWN=j
+LEFT=h
+RIGHT=l
+
+WMII_FONT='fixed'
+WMII_NORMCOLORS=('#888888' '#222222' '#333333')
+WMII_FOCUSCOLORS=('#ffffff' '#285577' '#4C7899')
+WMII_BACKGROUND='#333333'
+
+WMII_TERM=(xterm)
+
+# Column Rules
+wmiir write /colrules <<!
+/./ -> 60+40
+!
+
+# Tagging Rules
+wmiir write /tagrules <<!
+/XMMS.*/ -> ~
+/MPlayer.*/ -> ~
+/.*/ -> sel
+/.*/ -> 1
+!
+
+# Status Bar Info
+fn status { echo -n `{uptime | sed 's/.*://; s/,//g'} '|' `{date} }
+
+fn viewtitle { echo $* }
+
+# Convenience Functions
+fn wmiimenu {
+ dmenu -b -fn $WMII_FONT \
+ -nf $WMII_NORMCOLORS(1) -nb $WMII_NORMCOLORS(2) \
+ -sf $WMII_FOCUSCOLORS(1) -sb $WMII_FOCUSCOLORS(2)
+}
+
+fn 9menu {
+ wmii9menu -font $WMII_FONT \
+ -^(nf nb br)^$WMII_NORMCOLORS \
+ -^(sf sb br)^$WMII_FOCUSCOLORS $*
+}
+
+fn proglist {
+ /bin/ls -lL `{echo $* | sed 'y/:/ /'} >[2]/dev/null \
+ | awk '$1 ~ /^[^d].*x/ && NF > 2 { print $NF }' \
+ | sort | uniq
+}
+
+fn actionlist {
+ { proglist $WMII_CONFPATH
+ getfuns Action
+ } | sort | uniq
+}
+
+fn run_command { @{
+ rfork ns
+ path=$oldpath
+ eval exec $* &
+ }
+}
+
+fn getfuns { env | sed -n 's/^fn#'^$1^'-([^=]+).*/\1/p' }
+fn initkeys { getfuns Key | wmiir write /keys }
+fn read_tags { wmiir ls /tag | sed 's,/,,; /^sel$/d' }
+fn 'fn?' {rc -c 'whatis '$1 >[2]/dev/null | grep -s '^fn ' }
+
+# Events
+fn Event-Start {
+ switch($1) {
+ case wmiirc
+ rm -f $progs_file
+ exit
+ }
+}
+fn Event-Key { Key-$1 $1 }
+
+fn Event-CreateTag { echo $WMII_NORMCOLORS `{viewtitle $*} | wmiir create /lbar/$"* }
+fn Event-DestroyTag { wmiir remove /lbar/$"* }
+fn Event-FocusTag { wmiir xwrite /lbar/$"* $WMII_FOCUSCOLORS `{viewtitle $*} }
+fn Event-UnfocusTag { wmiir xwrite /lbar/$"* $WMII_NORMCOLORS `{viewtitle $*} }
+fn Event-UrgentTag { shift; wmiir xwrite /lbar/$"* '*'$"* }
+fn Event-NotUrgentTag { shift; wmiir xwrite /lbar/$"* $"* }
+
+fn Event-LeftBarClick { shift; wmiir xwrite /ctl view $* }
+
+fn Event-ClientMouseDown {
+ client = $1; button = $2
+ if(~ $button 3) {
+ do=`{9menu -initial $menulast Nop Delete Fullscreen}
+ switch($do) {
+ case Delete
+ wmiir xwrite /client/$client/ctl kill
+ case Fullscreen
+ wmiir xwrite /client/$client/ctl Fullscreen on
+ }
+ if(! ~ $#do 0)
+ menulast = $do;
+ }
+}
+menulast = Nop
+
+fn Action {
+ cmd=$1 action=Action-$cmd { shift
+ if('fn?' $action)
+ $action $*
+ if not
+ run_command `{config_whatis $cmd} $*
+ } &
+}
+
+# Actions
+fn Action-rehash {
+ if(test -d /proc/$pid)
+ for(i in $WMII_NS_DIR/proglist.*) {
+ id=`{echo $i | sed 's/.*\.(.*)/\1/'} \
+ if(! test -d /proc/$id) rm $i
+ }
+ proglist $PATH >$progs_file
+}
+fn Action-quit { wmiir xwrite /ctl quit }
+fn Action-exec { wmiir xwrite /ctl exec $* }
+fn Action-status {
+ flag x -; flag r -
+ if(wmiir remove /rbar/status >[2]/dev/null)
+ sleep 2
+ echo $WMII_NORMCOLORS | wmiir create /rbar/status
+ while(status | wmiir write /rbar/status)
+ sleep 1
+}
+
+# Source Variables, &c
+local = `{config_whatis rc.wmii.local}
+. <{awk '//;
+ /^# Overrides/ {
+ print "xmessage -file - <<!"
+ print "rc.wmii: Warning:"
+ print " Your rc.wmii.local contains an ''# Overrides'' line."
+ print " This line has a deprecated special meaning. Functions"
+ print " you wish to override should be defined in a function"
+ print " called Action-overridekeys"
+ print "!"
+ exit
+ }' $local </dev/null}
+
+# Key Bindings
+fn key {
+ key=()
+ for(k in Key-$*) if(! 'fn?' $k) key = ($key $k)
+ ~ $#key 0
+}
+
+key $MODKEY-Control-t || fn $key {
+ switch(`{wmiir read /keys | wc -l}) {
+ case 0 1
+ initkeys
+ wmiir xwrite /ctl grabmod $MODKEY
+ case *
+ wmiir xwrite /keys $MODKEY-Control-t
+ wmiir xwrite /ctl grabmod Mod3
+ }
+}
+
+key $MODKEY-$LEFT || fn $key { wmiir xwrite /tag/sel/ctl select left }
+key $MODKEY-$RIGHT || fn $key { wmiir xwrite /tag/sel/ctl select right }
+key $MODKEY-$DOWN || fn $key { wmiir xwrite /tag/sel/ctl select down }
+key $MODKEY-$UP || fn $key { wmiir xwrite /tag/sel/ctl select up }
+
+key $MODKEY-Shift-$LEFT || fn $key { wmiir xwrite /tag/sel/ctl send sel left }
+key $MODKEY-Shift-$RIGHT || fn $key { wmiir xwrite /tag/sel/ctl send sel right }
+key $MODKEY-Shift-$DOWN || fn $key { wmiir xwrite /tag/sel/ctl send sel down }
+key $MODKEY-Shift-$UP || fn $key { wmiir xwrite /tag/sel/ctl send sel up }
+
+key $MODKEY-f || fn $key { wmiir xwrite /client/sel/ctl Fullscreen toggle }
+
+key $MODKEY-space || fn $key { wmiir xwrite /tag/sel/ctl select toggle }
+key $MODKEY-Shift-space || fn $key { wmiir xwrite /tag/sel/ctl send sel toggle }
+key $MODKEY-d || fn $key { wmiir xwrite /tag/sel/ctl colmode sel default }
+key $MODKEY-s || fn $key { wmiir xwrite /tag/sel/ctl colmode sel stack }
+key $MODKEY-m || fn $key { wmiir xwrite /tag/sel/ctl colmode sel max }
+
+key $MODKEY-Shift-c || fn $key { wmiir xwrite /client/sel/ctl kill }
+
+key $MODKEY-a || fn $key { Action `{actionlist | wmiimenu} & }
+key $MODKEY-p || fn $key { ifs=() { run_command `{wmiimenu <$progs_file} & } }
+key $MODKEY-Return || fn $key { run_command $WMII_TERM & }
+
+key $MODKEY-t || fn $key { wmiir xwrite /ctl view `{read_tags | wmiimenu} & }
+key $MODKEY-Shift-t || fn $key {
+ sel = `{wmiir read /client/sel/ctl | sed 1q} \
+ wmiir xwrite /client/$sel/tags `{read_tags | wmiimenu} &
+}
+
+key $MODKEY-^`{seq 0 9}|| fn $key { wmiir xwrite /ctl view `{echo $1 | sed 's/.*-//'} }
+key Shift-$MODKEY-^`{seq 0 9} || fn $key {
+ wmiir xwrite /client/sel/tags `{echo $1 | sed 's/.*-//'}
+}
+
+# WM Configuration
+wmiir write /ctl <<!
+grabmod $MODKEY
+border 2
+font $WMII_FONT
+focuscolors $WMII_FOCUSCOLORS
+normcolors $WMII_NORMCOLORS
+!
+xsetroot -solid $WMII_BACKGROUND
+
+# Source Overrides
+. <{awk '/^# Overrides/, 0' $local </dev/null}
+if('fn?' Action-overridekeys)
+ Action-overridekeys
+if not
+ . `{config_whatis overridekeys}
+
+# Misc Setup
+progs_file=$WMII_NS_DIR/proglist.$pid
+Action status
+Action rehash
+
+# Tag Bar Setup
+ifs='#
+'{ for(bar in `{comm -23 <{wmiir ls /lbar} <{read_tags}})
+ wmiir remove /lbar/$bar
+ seltag=`{wmiir read /tag/sel/ctl | sed 1q}
+ for(tag in `{read_tags}) {
+ if(~ $tag $seltag)
+ echo $WMII_FOCUSCOLORS `{viewtitle $tag} | wmiir create /lbar/$tag
+ if not
+ echo $WMII_NORMCOLORS `{viewtitle $tag} | wmiir create /lbar/$tag
+ }
+}
+
+# Keygrab Setup
+initkeys
+
+if(echo Start wmiirc | ! wmiir write /event >[2]/dev/null)
+ exit write
+
+# Event Loop
+wmiir read /event |
+ while(*=`{read}) {
+ event = $1; shift
+ Event-$event $*
+ } >[2]/dev/null </dev/null
@@ -0,0 +1,57 @@
+#!/bin/sh
+# display a welcome message that contains the wmii tutorial
+
+xmessage -file - <<'EOF'
+Welcome to wmii, the non-wimp environment of the Suckless Project.
+
+This is a small step by step tutorial, intended to make you a
+little bit familiar with wmii.
+
+From here on, keypresses will be described such that M-a refers to
+pressing $MODKEY and a at the same time. $MODKEY refers to a
+configuration variable which contains the Alt key by default.
+
+Let's go!
+
+- Start two xterms by pressing M-Return twice.
+- Switch between the three windows: M-j, M-k,
+ M-h, M-l
+ If you prefer to use the mouse, then just move the pointer to
+ the desired window.
+- Try the other column modes: M-s for stack mode,
+ M-m for max mode Press M-d to return to default
+ mode.
+- Create a new column with: M-Shift-l
+ This moves the client rightwards.
+- Tag the selected client with another tag: M-Shift-2
+ IMPORTANT: before you do the next step, note that you
+ can select the current tag with M-1.
+- Select the new tag: M-2
+- Select the floating area: M-Space
+- Open the programs menu: M-p
+ Type 'xclock' and press Enter.
+- Move the xclock window: Hold $MODKEY, left-click on the
+ window and move the cursor around.
+- Resize the xclock window: Hold $MODKEY, right-click the
+ window and move the cursor around.
+- Kill the selected client (the xclock window) with: M-Shift-c
+- Open the actions menu: M-a
+ Rerun wmiirc by selecting 'wmiirc'.
+- We'll now have a look at the internal filesystem used by
+ wmii. Executing
+ wmiir ls /
+ in the shell of the terminal will list all the files in the
+ root directory.
+ Entries ending with / are directories.
+ If you are curious, you can now dig deeper into the
+ directory trees. For instance,
+ wmiir ls /rbar/
+ will show you the content of the right half of the bar.
+
+We hope that these steps gave you an idea of how wmii works.
+You can reread them at any time by pressing $MODKEY-a and
+selecting 'welcome'.
+
+You should now take a look at the wmii(1) man page. A FAQ is
+available at <http://wmii.suckless.org>.
+EOF
Oops, something went wrong.

0 comments on commit a701559

Please sign in to comment.