#!/bin/sh # jumpview - jump to left or right view in wmii, as specified in $1 # # Usage in wmiirc action section: # # Key $MODKEY-y # ~/s/wmii/jumpview left # Key $MODKEY-x # ~/s/wmii/jumpview right if [ "$1" = "left" ] then p='v=`expr $i - 1`' elif [ "$1" = "right" ] then p='v=`expr $i + 1`' else exit fi array=(`wmiir ls /lbar | tr '\n' ' '`) count=${#array[@]} view=`wmiir read /ctl | head -n 1 | sed 's/view //'` i=0 while [ $i -le $count ] do if [ ${array[$i]} = $view ] then eval $p [ $v = -1 ] && v=`expr $count - 1` [ $v = $count ] && v=0 wmiir xwrite /ctl view ${array[$v]} exit fi i=`expr $i + 1` done exit