divert(-1)dnl !----------------------------------------------------------------------------- ! ! Macros for creating larswm config files ! ! Created by Christopher Biggs , when I realized that ! maintaining my .larswmrc was just too painful, with all the numbered ! window-class and application key sections. These macros allow the ! numbering to be generated automagically. ! ! A second benefit is that the total size of this macro package plus my ! larswm.mc input file is less than half the size of my original .larswmrc! ! ! ! Counters used for auto-increment properties ! define(`appkey_counter',`0')dnl define(`toolclass_counter',`0')dnl define(`floatclass_counter',`0')dnl define(`stickyclass_counter',`0')dnl define(`dotileclass_counter',`0')dnl define(`dtclass_counter',`0')dnl define(`COUNTER_INCR',`define(`$1',incr($1))')dnl ! ! PROP(`prop', `value') => larswm.prop: value ! define(`PROP',`larswm.$1: $2') ! ! DTPROP(`prop', ,
, `value') => larswm..
.prop: value ! DTASPROP(`prop',
, `value') => larswm.?.
.prop: value ! DTALLPROP(`prop', `value') => larswm.?.?.prop: value ! ! DTPROP sets property on one DeskTop (on one specific screen). ! DTASPROP sets property on one DeskTop (on All Screens). ! DTALLPROP sets property on ALL desktops on all screens. define(`DTPROP',`larswm.$2.$3.$1: $4') define(`DTASPROP',`larswm.?.$2.$1: $3') define(`DTALLPROP', `larswm.?.?.$1: $2') ! ! KEY(, , ) => larswm._key: ! larswm._mod: ! define(`KEY',`larswm.$3_key: $1 larswm.$3_mod: $2 ') ! ! DTKEY(, , , ) => larswm._key.n: ! larswm._mod.n: ! define(`DTKEY',`larswm.$3_key.$4: $1 larswm.$3_mod.$4: $2 ') ! ! APPBUTTON(, ) => larswm.buttonn.application: ! define(`APPBUTTON',`larswm.button$1.application: $2') ! ! APPKEY(, , ) => larswm.application.n: ! larswm.application_key.n: ! larswm.application_mod.n: ! ! XF86KEY(, ) => larswm.application.n: ! larswm.application_key.n: XF86 ! larswm.application_mod.n: None ! (n auto-increments, starting at zero) define(`APPKEY',`larswm.application.appkey_counter: $3 larswm.application_key.appkey_counter: $1 larswm.application_mod.appkey_counter: $2 COUNTER_INCR(`appkey_counter')') define(`XF86KEY',`larswm.application.appkey_counter: $2 larswm.application_key.appkey_counter: XF86$1 larswm.application_mod.appkey_counter: None COUNTER_INCR(`appkey_counter')') ! ! TOOLCLASS() => larswm.toolclass.n: ! FLOATCLASS() => larswm.floatclass.n: ! STICKYCLASS() => larswm.stickyclass.n: ! DOTILECLASS() => larswm.dotileclass.n: ! ! (n auto-increments, starting at zero) ! define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl define(`FOOCLASS2',`define(`$1CLASS',`larswm.$2.$3: '`COUNTER_INCR(`$3')'$`'1)') define(`FOOCLASS',`FOOCLASS2(upcase($1),$1class,`$1class_counter')') FOOCLASS(`tool') FOOCLASS(`float') FOOCLASS(`sticky') FOOCLASS(`dotile') ! ! DTCLASS(, dt) => larswm.dtclass.n: ! => larswm.dtnum.n: ! define(`DTCLASS',`larswm.dtclass.dtclass_counter: $1 larswm.dtnum.dtclass_counter: $2 COUNTER_INCR(`dtclass_counter') ') divert(0)dnl