From dac3811c06a3d14d978e951795066b4b73d2a1a6 Mon Sep 17 00:00:00 2001 From: jlamothe Date: Tue, 17 Oct 2023 02:21:05 +0000 Subject: [PATCH] initial commit --- build-windows.awk | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 build-windows.awk diff --git a/build-windows.awk b/build-windows.awk new file mode 100644 index 0000000..2d1f635 --- /dev/null +++ b/build-windows.awk @@ -0,0 +1,49 @@ +# This script uses wloc on the (maximised) refwin window to calculate +# the screen size and produce the commands necessary to build the +# initial windows for my Plan9 session. + +BEGIN { + # constants + stat_width = 235 + stat_height = 176 + cat_width = 150 + cat_height = 300 + term_width = 903 + term_height = 612 + com_height = 300 + acme_overlap = 100 # how much acme should overlap com + cascade_size = 50 # the amount of offset for a window cascade +} + +/ refwin$/ { + # calculate screen dimensions + scr_width = $5 + scr_height = $6 + + # status window + print "window -minx 0 -miny 0 -dx", stat_width, "-dy", stat_height, "stats -lmisce" + + # cat clock + cat_x = scr_width - cat_width + print "window -minx", cat_x, "-miny 0 -dx", cat_width, "-dy", cat_height, "games/catclock" + + # acme editor + acme_x = stat_width + acme_width = scr_width - stat_width - cat_width + acme_height = scr_height - com_height + acme_overlap + print "window -minx", acme_x, "-miny 0 -dx", acme_width, "-dy", acme_height, "acme -a" + + # terminal window + term_y = stat_height + print "window -minx 0 -miny", term_y, "-dx", term_width, "-maxy", scr_height, "termwin" + + # commode chat + com_x = term_width + com_y = scr_height - com_height + print "window -minx", com_x, "-miny", com_y, "-maxx", scr_width, "-maxy", scr_height, "-scroll comwin" + + # original terminal + orig_x = cascade_size + orig_y = stat_height + cascade_size + print "window -minx", orig_x, "-miny", orig_y, "-dx", term_width, "-dy", term_height, "-hide /usr/sdf/lib/9legacy/first.window" +}