#!/bin/awk -f function alloc(id, r, b, g){ printf "b%s%c%c%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" \ "%c%c%c%c", \ id, 0, 0, 0, 0, 0, 8, 24, 40, 0, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, \ 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 1, 0, 0, 0, 1, \ 255, g, b, r \ >data } function draw(src, mask){ printf "dscrn%s%s%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", \ src, mask, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ >data } function b0(n){return n % 256} function b1(n){return int(n / 256)} function load(c){ printf "ypixl%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", \ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 255, c, 0 >data } function blob(r, a, c){ load(c) x = cx + int(s[a] * (maxr - r)); y = cy + int(s[a+2] * (maxr - r)); printf "Escrnpixl%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c%c%c%c%c" \ "%c%c%c%c%c%c%c%c", \ b0(x), b1(x), 0, 0, b0(y), b1(y), 0, 0, \ b0(r), b1(r), 0, 0, b0(r), b1(r), 0, 0, \ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0 \ >data } BEGIN{ print "resize -r 0 0 9999 9999" >"/dev/wctl" getline <"/dev/draw/new" data = "/dev/draw/" $1 "/data" ctl = "/dev/draw/" $1 "/ctl" getline name <"/dev/winname" printf "nscrn%c%s", length(name), name >data getline data system("sleep .001") } }