#!/bin/sh percent_to_pixels_x() { $RATPOISON --command fdump|sed 's/,/\n/g'|awk '{print $15" "$9*(100-'$1')/100 }'|sort --numeric|tail --lines=1|awk '{printf "-%d\n", $2 }' } percent_to_pixels_y() { $RATPOISON --command fdump|sed 's/,/\n/g'|awk '{print $15" "$11*(100-'$1')/100 }'|sort --numeric|tail --lines=1|awk '{printf "-%d\n", $2 }' } [ "$1" = "0" ] && echo 0 `percent_to_pixels_y "$2"` [ "$2" = "0" ] && echo `percent_to_pixels_x "$1"` 0