Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to get WMII to split horizontally at 80 columns for xterm, but I'm only seeing a way to do this via percentage. It would be nice to be able to set it by something other than percentage for various resolutions, but if I have to deal with that I will.

The problem is that even percentages don't work at my resolution (1366x768). 47+47 in /colrules yields 79 characters and 48+48 yields 81 characters. As far as I can tell, there is no decimal system allowed so I could do 47.5 for instance.

I came from Ion3 and I'm used to using 80 column terminals, resizable by the keyboard, to get a reasonable cut off point for VIM when I'm coding. I would just settle with using the mouse, but WMII seems to be much more fluid than Ion3, so I would have to do it a LOT, which sounds annoying.

Any ideas?

EDIT: (more info)

grml@dalek:~$ wmiir xwrite /view/ctl next
wmiir: fatal: Can't open file '/view/ctl': file not found
grml@dalek:~$ wmiir ls /
client/
colrules
ctl
event
keys
lbar/
rbar/
tag/
tagrules
grml@dalek:~$ wmiir xwrite /tag/sel/ctl grow sel sel right +2
wmiir: fatal: cannot write file '/tag/sel/ctl': bad command

Any ideas what's going on?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Using colrules and percentages, as you said, can't take you anywhere.

If you are forced to manual resizing, then, instead of using the mouse, you can add the following to your wmiirc script in order to control the width of a client using keyboard shortcuts:

Key $MODKEY-Control-h
    wmiir xwrite /tag/sel/ctl grow sel sel left +2
Key $MODKEY-Control-j
    wmiir xwrite /tag/sel/ctl grow sel sel left -2
Key $MODKEY-Control-k
    wmiir xwrite /tag/sel/ctl grow sel sel right -2
Key $MODKEY-Control-l
    wmiir xwrite /tag/sel/ctl grow sel sel right +2

See the section Configuration of the wmii man page for more info.

Since you can not specify a fixed width using the grow command, then, supposing that you know how many pixels you want your column, say width=600, you can do something like:

  1. read the width of the first column:

    cur_width=$(wmiir cat /tag/sel/index | grep '^# 1' | awk '{print $4}')
    
  2. grow or shrink the selected client by the needed amount:

    wmiir xwrite /tag/sel/ctl grow sel sel right $(($width - $cur_width))px
    

But you will have to work a bit to make it flexible to different resolution, different columns etc.

share|improve this answer
    
Thank you for your great response! The man pages showed up with nothing, though (debian squeeze), got any ideas? I just finally realized I could find a default wmiirc file by downloading the source, and I did so I'll start working on that config. Thanks for all the help! –  BCable May 6 '10 at 19:49
    
It seems that the documentation is on a separate package wmii-doc. In the source tree you can also find the wmii user guide in the doc folder. –  mrucci May 7 '10 at 4:27
    
Okay I just edited the main post to have some output from my terminal. I'm really confused now... I'm running wmii 3.6, what's going on? –  BCable May 9 '10 at 0:18
    
Simple: the 3.6 version of wmii is old and deprecated and does not support the grow command. Try downloading and installing the latest beta from here: dl.suckless.org/wmii/wmii+ixp-3.9b1.tbz . –  mrucci May 9 '10 at 9:13
    
My system is complicated and it's best if I stick to the Debian repositories for everything. Thanks for the help, though! I definitely like this WM, not sure if I like it more than Ion3 or not, yet. –  BCable May 9 '10 at 21:10
show 1 more comment

I solved the workspace toggling with the following keybindings. All that is left now is to figure out how to get the width working.

Key $MODKEY-comma
    wmiir xwrite /ctl view $(echo $(wmiir read /ctl | grep -E "^view" | cut -d ' ' -f2)-1 | bc | sed -r "s/^0$/1/g")
Key $MODKEY-period
    wmiir xwrite /ctl view $(echo $(wmiir read /ctl | grep -E "^view" | cut -d ' ' -f2)+1 | bc)
share|improve this answer
add comment
Key $MODKEY-u # make left side 80 columns wide
    cur=$(wmiir cat /tag/sel/index | grep -E "^# 1 " | cut -d ' ' -f4)
    if [ "$cur" -lt "646" ]; then
        wmiir xwrite /tag/sel/ctl grow sel sel right $((646-$cur))px
    elif [ "$cur" -gt "646" ]; then
        wmiir xwrite /tag/sel/ctl grow sel sel right -$(($cur-646))px
    #else # do nothing
    fi
Key $MODKEY-i # make right side 80 columns wide
    cur=$(wmiir cat /tag/sel/index | grep -E "^# 1 " | cut -d ' ' -f4)
    width=$(
        xrandr | grep "*" | sed -r "s/[ ]+/ /g" |
            cut -d ' ' -f2 | cut -d 'x' -f1
    )
    if [ "$cur" -lt "$(($width-646))" ]; then
        wmiir xwrite /tag/sel/ctl grow sel sel left $(($cur-$width+646))px
        echo $width > /tmp/width
        echo $cur > /tmp/cur
    elif [ "$cur" -gt "$(($width-646))" ]; then
        wmiir xwrite /tag/sel/ctl grow sel sel left -$(($width-646-$cur))px
    #else # do nothing
    fi

These are my two keybindings after updating to WMII 3.9 from the repository mrucci mentioned.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.