scripts/build-windows.awk

49 lines
1.5 KiB
Awk

# This script uses information from /dev/screen to place windows where
# they should go. It should be invoked automatically by riostart-custom
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
}
{
# calculate screen dimensions
scr_width = $4
scr_height = $5
# 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"
}