[wmii] Dual-monitor setup

From: Jonne Lehtinen <jms_AT_modeemi.fi>
Date: Fri, 18 Jan 2008 04:09:12 +0200

Hello,

I found Christians script rather useful - thanks for that.
Even though it took me a while to figure it out (3am, what can I say..)
I managed to get it working and I found a small "bug" - or rather missing
feature - in it, so I modified it a little.
The original script failed if the other wmii had some tag selected which
didn't have any windows open. This one works with that also.

I'm sorry that I couldn't quote or reply properly but I just subscribed
to this mailing list (and I fail at mail clients).

- Jonne Lehtinen

#!/bin/sh

if [ "x$1" == "x" ]; then
   if [ $DISPLAY == ":0.0" ]; then
      $0 1
   else
      $0 0
   fi
   exit
fi

if [ $1 == '0' ]; then
  address=unix!/tmp/ns.$USER.:0/wmii
else
  address=unix!/tmp/ns.$USER.:0.$1/wmii
fi
if [ `wmiir -a $address ls /client | grep ^sel/$ | wc -l` -eq "0" ];
then
  # no clients open, just warp to upper left corner
  DISPLAY=:0.$1 swarp 50 50
else
  client=`wmiir -a $address read /client/sel/ctl`
  client_info=`wmiir -a $address read /tag/sel/index | grep $client`
  col=`echo $client_info | awk '{ print $1}'`
  if [ $col = '~' ]; then
     x=`echo $client_info | awk '{ print $3}'`
     y=`echo $client_info | awk '{ print $4}'`
  else
     y=`echo $client_info | awk '{ print $3}'`
     x=`wmiir -a $address read /tag/sel/index | grep "^# $col" | awk '{
print $3 }'`
  fi
  DISPLAY=:0.$1 swarp $[$x+5] $[$y+5] # the +5 is to avoid those
little column resizing handles
fi
Received on Fri Jan 18 2008 - 03:23:55 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:33:26 UTC