Re: [wmii] wmii-2.5 'Oranienburger defloration' released

From: Stefan Tibus <sjti_AT_gmx.net>
Date: Thu, 29 Dec 2005 00:16:37 +0100

Hello,

I just downloaded the new release today and it compiles and works
fine up to now (on my notebook). I'm going to try it on my Sun on
the beginning of next week. Since I always needed to make small
changes to some source- and makefiles, I'll record these in detail
this time.

For now I'll attach my version of wmiirc, as I have tried to
rearrange some things to make it easier to understand it.

Regards,
Stefan

===== file: wmiirc =====

#!/usr/local/9/bin/rc
# configure wmii

# ---
# ???
# ---
nl='
'

# -----------------
# WMII VISUAL STYLE
# -----------------

# helper functions
# ================
fn selstyle {
    wmiir write $1/text-font $TEXT_FONT
    wmiir write $1/text-color $SELECTED_FG_COLOR
    wmiir write $1/bg-color $SELECTED_BG_COLOR
    wmiir write $1/border-color $SELECTED_BORDER_COLOR
}

fn normstyle {
    wmiir write $1/text-font $TEXT_FONT
    wmiir write $1/text-color $NORMAL_FG_COLOR
    wmiir write $1/bg-color $NORMAL_BG_COLOR
    wmiir write $1/border-color $NORMAL_BORDER_COLOR
}

# load variables from file
. theme_2.5

# ---------------------
# WMIIBAR CONFIGURATION
# ---------------------

# helper functions
# ================
fn barsucks {
    wmiir write /bar/$1/b1press 'wmiir write /wm/ctl ''select prev'''
    wmiir write /bar/$1/b3press 'wmiir write /wm/ctl ''select next'''
    wmiir write /bar/$1/b4press 'wmiir write /wm/ctl ''select prev'''
    wmiir write /bar/$1/b5press 'wmiir write /wm/ctl ''select next'''
}

# appearance
# ==========
wmiir write /bar/ctl reset
wmiir write /bar/font $TEXT_FONT
wmiir write /bar/fgcolor $NORMAL_FG_COLOR
wmiir write /bar/bgcolor $NORMAL_BG_COLOR
wmiir write /bar/bordercolor $NORMAL_BORDER_COLOR
wmiir write /bar/geometry 0,south,east,$BAR_HEIGHT

# labels
# ======
# - pager
plab=`{wmiir read /bar/new}
wmiir write /bar/$plab/b1press 'wmiir write /wm/ctl pager'
# - client
clab=`{wmiir read /bar/new}
wmiir write /bar/$clab/fgcolor $SELECTED_FG_COLOR
wmiir write /bar/$clab/bgcolor $SELECTED_BG_COLOR
wmiir write /bar/$clab/bordercolor $SELECTED_BG_COLOR
barsucks $clab
wmiir write /bar/expandable $clab

# show bar
# ========
wmiir write /bar/ctl 'display 1'

# --------------------
# WMIIWM CONFIGURATION
# --------------------

# helper functions
# ================
fn frameconf {
    wmiir write $1/event/b3press 'wmiir write /wm/page/sel/ctl toggle'
    wmiir write $1/event/b2press 'wmiir write /wm/ctl close'
    normstyle $1/norm-style
    selstyle $1/sel-style
    wmiir write $1/tab-height $TAB_HEIGHT
    if(~ $2 refresh)
        wmiir write $1/size +0,+0,+0,+0 # causes refresh
}

fn framesconf {
    for(frame in `{wmiir read $1 | grep '^[0-9]'})
        frameconf $1/$frame $2
}

# appearance
# ==========
# default layout (tiled, max, grid, vsplit or float):
wmiir write /wm/default/page/layout tiled
# width of the left frame in tiled layout in percent:
wmiir write /wm/default/page/tile-width 60
#
wmiir write /wm/default/core/trans-color $SELECTED_FG_COLOR
# handle incremental resize
wmiir write /wm/default/frame/handle-inc 1
# some broken WIMP apps:
. brokenapps
# set border width
wmiir write /wm/default/frame/border-width $BORDER_WIDTH
# set page size
wmiir write /wm/default/page/size '0,0,east,south-'^$BAR_HEIGHT
# event handler to update client info
wmiir write /wm/event/client-update \
'text=`{wmiir read /wm/page/sel/mode/sel/client/sel/name} \
wmiir write /bar/'^$clab^'/data $"text'
wmiir write /wm/event/page-update \
'text=`{wmiir read /wm/page/sel/name} ^ \
`{wmiir read /wm/page/sel/mode/name|awk ''{print substr($0,0,1)}''} ^ \
`{wmiir read /keys/lookup|awk ''{print substr($0,7,1)}''} \
wmiir write /bar/'^$plab^'/data $"text'
# refresh pages
for(page in `{wmiir read /wm/page | grep '^[0-9]'}) {
    framesconf /wm/page/$page/floating refresh
    framesconf /wm/page/$page/managed refresh
}
frameconf /wm/default/frame norefresh
# set styles
for(i in norm-style norm-style/client)
    normstyle /wm/default/core/pager/$i
for(i in sel-style sel-style/client)
    selstyle /wm/default/core/pager/$i
# set current page's size (do that for all pages?)
wmiir write /wm/page/sel/managed/size 0,0,east,south-$BAR_HEIGHT >[2]/dev/null

# ----------------------
# WMIIKEYS CONFIGURATION
# ----------------------

# helper functions
# ================
fn kbind {
    wmiir create /keys/mode/$1/$2 $3
}

# appearance
# ==========
wmiir write /keys/size center,center,100,$BAR_HEIGHT
selstyle /keys/box/style

# variables
# =========
MODKEY=WIN # M, M2, M3, WIN, or M5
NORTHKEY=Up
SOUTHKEY=Down
WESTKEY=Left
EASTKEY=Right

# bare mode
# =========
# switch modes (Control-)
# -----------------------
kbind bare $MODKEY-Escape 'kmode normal'

# move mode
# =========
# switch modes (Control-)
# -----------------------
kbind move $MODKEY-Escape 'kmode normal'
kbind move Escape 'kmode normal'
kbind move $MODKEY-C-r 'kmode resize'
kbind move r 'kmode resize'
# move stepwise
# -------------
kbind move $NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size -0,-30,-0,-0'
kbind move $SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+30,+0,+0'
kbind move $WESTKEY 'wmiir write /wm/page/sel/mode/sel/size -40,-0,-0,-0'
kbind move $EASTKEY 'wmiir write /wm/page/sel/mode/sel/size +40,+0,+0,+0'
# move to edges (Shift-)
# ----------------------
kbind move S-$NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size -0,north,-0,-0'
kbind move S-$SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,south-'^$BAR_HEIGHT^',+0,+0'
kbind move S-$WESTKEY 'wmiir write /wm/page/sel/mode/sel/size west,-0,-0,-0'
kbind move S-$EASTKEY 'wmiir write /wm/page/sel/mode/sel/size east,+0,+0,+0'
# move to centers (Alt-)
# ----------------------
kbind move M-$NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,center,+0,+0'
kbind move M-$SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,center,+0,+0'
kbind move M-$WESTKEY 'wmiir write /wm/page/sel/mode/sel/size center,+0,+0,+0'
kbind move M-$EASTKEY 'wmiir write /wm/page/sel/mode/sel/size center,+0,+0,+0'

# resize mode
# ===========
# switch modes (Control-)
# -----------------------
kbind resize $MODKEY-Escape 'kmode normal'
kbind resize Escape 'kmode normal'
kbind resize $MODKEY-C-m 'kmode move'
kbind resize m 'kmode move'
# resize stepwise
# ---------------
kbind resize $NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+0,+0,-30'
kbind resize $SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+0,+0,+30'
kbind resize $WESTKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+0,-40,+0'
kbind resize $EASTKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+0,+40,+0'
# resize stepwise & symmetrically (Shift-)
# ----------------------------------------
kbind resize S-$NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,+15,+0,-30'
kbind resize S-$SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,-15,+0,+30'
kbind resize S-$WESTKEY 'wmiir write /wm/page/sel/mode/sel/size +20,+0,-40,+0'
kbind resize S-$EASTKEY 'wmiir write /wm/page/sel/mode/sel/size -20,+0,+40,+0'
# resize to width/height/both (Alt-)
# ----------------------------------
kbind resize M-$NORTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,north,+0,south-'^$BAR_HEIGHT
kbind resize M-$SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/size +0,north,+0,south-'^$BAR_HEIGHT
kbind resize M-$WESTKEY 'wmiir write /wm/page/sel/mode/sel/size east,+0,west,+0'
kbind resize M-$EASTKEY 'wmiir write /wm/page/sel/mode/sel/size east,+0,west,+0'

# normal mode
# ===========
# switch modes (Control-)
# -----------------------
kbind normal $MODKEY-C-b 'kmode bare'
kbind normal $MODKEY-C-m 'kmode move'
kbind normal $MODKEY-C-r 'kmode resize'
# window manager (Control-)
# -------------------------
# - actions
kbind normal $MODKEY-C-a 'wmiir write /menu/precmd ''''; wmiir write /menu/lookup /items/actions; wmiir write /menu/ctl ''display 1'''
# - programs
kbind normal $MODKEY-C-p 'wmiir write /menu/precmd extern; wmiir write /menu/lookup /items/programs; wmiir write /menu/ctl ''display 1'''
# - quit wm
kbind normal $MODKEY-C-q,y quit
kbind normal $MODKEY-C-End,y quit
# - reload wm configuration
kbind normal $MODKEY-C-w,y wmiirc
# - create new page
#kbind normal $MODKEY-C-y 'wmiir write /wm/ctl new'
kbind normal $MODKEY-C-Insert 'wmiir write /wm/ctl new'
# - remove page
kbind normal $MODKEY-C-Delete,y 'wmiir write /wm/ctl destroy'
# windows
# -------
# - detach/attach/close window
kbind normal $MODKEY-d 'wmiir write /wm/ctl detach'
kbind normal $MODKEY-Delete 'wmiir write /wm/ctl detach'
kbind normal $MODKEY-a 'wmiir write /wm/ctl attach'
kbind normal $MODKEY-Insert 'wmiir write /wm/ctl attach'
#kbind normal $MODKEY-C-c 'wmiir write /wm/ctl close'
kbind normal $MODKEY-c 'wmiir write /wm/ctl close'
kbind normal $MODKEY-End 'wmiir write /wm/ctl close'
# - show iconised/detached windows
#kbind normal $MODKEY-S-a 'wmiir write /wm/ctl icons'
kbind normal $MODKEY-i 'wmiir write /wm/ctl icons'
# - select page
kbind normal $MODKEY-$WESTKEY 'wmiir write /wm/ctl ''select prev'''
kbind normal $MODKEY-$EASTKEY 'wmiir write /wm/ctl ''select next'''
# - select window
kbind normal $MODKEY-Tab 'wmiir write /wm/page/sel/ctl ''select next'''
kbind normal $MODKEY-$SOUTHKEY 'wmiir write /wm/page/sel/ctl ''select next'''
kbind normal $MODKEY-$NORTHKEY 'wmiir write /wm/page/sel/ctl ''select prev'''
# - select window within frame
kbind normal $MODKEY-S-Tab 'wmiir write /wm/page/sel/mode/sel/ctl ''select next'''
kbind normal $MODKEY-S-$SOUTHKEY 'wmiir write /wm/page/sel/mode/sel/ctl ''select next'''
kbind normal $MODKEY-S-$NORTHKEY 'wmiir write /wm/page/sel/mode/sel/ctl ''select prev'''
# - select toggled layer
kbind normal $MODKEY-space 'wmiir write /wm/page/sel/ctl ''select toggled'''
# - toggle window to floating layer
kbind normal $MODKEY-S-space 'wmiir write /wm/page/sel/ctl toggle'
# - toggle window to new max page and back
kbind normal $MODKEY-m 'wmiir write /wm/ctl togglemax'
# - zoom window
kbind normal $MODKEY-Return 'wmiir write /wm/page/sel/ctl ''select zoomed'''
# - unlock/lock frame
kbind normal $MODKEY-u 'wmiir write /wm/page/sel/mode/sel/locked 0'
#kbind normal $MODKEY-S-u 'wmiir write /wm/page/sel/mode/sel/locked 1'
kbind normal $MODKEY-l 'wmiir write /wm/page/sel/mode/sel/locked 1'
# management
# ----------
kbind normal $MODKEY-S-t 'wmiir write /wm/page/sel/managed/name tiled'
kbind normal $MODKEY-S-g 'wmiir write /wm/page/sel/managed/name grid'
kbind normal $MODKEY-S-v 'wmiir write /wm/page/sel/managed/name vsplit'
kbind normal $MODKEY-S-f 'wmiir write /wm/page/sel/managed/name float'
kbind normal $MODKEY-S-m 'wmiir write /wm/page/sel/managed/name max'
# pager
# -----
kbind normal $MODKEY-S-p 'wmiir write /wm/ctl pager'
kbind normal $MODKEY-S-0 'wmiir write /wm/ctl ''select 10'''
for(i in 1 2 3 4 5 6 7 8 9) {
    kbind normal $MODKEY-S-$i 'wmiir write /wm/ctl ''select '^$i^''''
}
# user programs
# -------------
#kbind normal $MODKEY-t 'extern xterm ''+sb'' -bg ''#000000'' -fg ''#eeeeee'' -cr ''#ffffff'' -sl 4000'
kbind normal $MODKEY-t 'extern rxvt ''+sb'' -bg '''^$TERM_BG^''' -fg '''^$TERM_FG^''' -cr '''^$TERM_CR^''' -sl 4000'

# startup mode
# ============
kmode normal

# ----------------------
# WMIIMENU CONFIGURATION
# ----------------------

# helper functions
# ================
fn items {
    ifs=:$nl { dirs=`{echo $2} }
    {
        for(dir in $dirs) {
            for(file in $dir/*) {
                if(! ~ $file $dir^'/*' && ! test -d $file && test -x $file) {
                    file=`{basename $file}
                    echo create /menu/items/$1/$"file $"file
                }
            }
        }
    } | sort | wmiir -f &
}

# appearance
# ==========
wmiir write /menu/size 0,south,east,$BAR_HEIGHT
normstyle /menu/style >[2]/dev/null
normstyle /menu/norm-style >[2]/dev/null
selstyle /menu/sel-style >[2]/dev/null

# populate menus
# ==============
items actions $WMII_CONFDIR:$HOME/.wmii-2.5
#wmiir create /menu/items/actions/rmpage 'wmiir write /wm/ctl destroy'
items programs $OLD_PATH

# ----
# MISC
# ----

# start status programs
# =====================
status &

===== file: theme_2.5 =====

# -----------------
# WMII VISUAL STYLE
# -----------------

# variables
# =========
TAB_HEIGHT=16
BAR_HEIGHT=16
BORDER_WIDTH=3

SELECTED_BG_COLOR='#304050'
SELECTED_FG_COLOR='#eeeeee'
SELECTED_BORDER_COLOR='#506070'
NORMAL_BG_COLOR='#222222'
NORMAL_FG_COLOR='#bbbbbb'
NORMAL_BORDER_COLOR='#111111'
#TEXT_FONT='fixed'
TEXT_FONT='-*-fixed-medium-r-*-*-*-130-*-*-*-*-iso8859-1'

TERM_FONT=$TEXT_FONT
TERM_BG='#000000'
TERM_FG='#eeeeee'
TERM_CR='#ffffff'

# background
# ==========
#xsetroot -mod 2 2 -fg '#000000' -bg '#111111'
# flickers on my notebook
xsetroot -mod 2 2 -fg '#000000' -bg '#121212'

===== file: brokenapps =====

# some broken WIMP apps:
wmiir create /wm/default/client/'xmms:*'/manage 0
wmiir create /wm/default/client/'Gimp:*'/manage 0

# broken WIMP apps, which should be floating (unmanaged) by default:
wmiir create /wm/default/client/'Cryostat:*'/manage 0 # frm2 specific
wmiir create /wm/default/client/'dbdev:*'/manage 0
wmiir create /wm/default/client/'Dbdev:*'/manage 0
wmiir create /wm/default/client/'Find:*'/manage 0 # acrobat reader
wmiir create /wm/default/client/'Idl:*'/manage 0
wmiir create /wm/default/client/'Gimp:*'/manage 0
wmiir create /wm/default/client/'Gimp-2.2:*'/manage 0
wmiir create /wm/default/client/'Gmpc:*'/manage 0
wmiir create /wm/default/client/'Gorm:*'/manage 0
wmiir create /wm/default/client/'Kdesu:*'/manage 0
wmiir create /wm/default/client/'Vncviewer:*'/manage 0
wmiir create /wm/default/client/'xmms:*'/manage 0
wmiir create /wm/default/client/'Xsane:*'/manage 0
wmiir create /wm/default/client/'xvnc4viewer:*'/manage 0
Received on Thu Dec 29 2005 - 00:17:23 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:59:41 UTC