#!/bin/rc # 2020-04-19T21:18:37-04:00 # Open rio windows along the top of the screen. # NOTE: Creating a window may fail silently # if it is too short for a large font. rfork en bind /bin/rcpu /bin/cpu scr=(`{cat /dev/draw/new >[2]/dev/null}) w=$scr(11) h=$scr(12) fn headerclock{ if(~ $w 1600 2966 && ~ $h 1200) r=(1467 0 1600 115) if(~ $w 1920 1918 1918 && ~ $h 1080 1078) r=(1747 0 1910 115) window -r $r clock } fn headerstats{ if(~ $w 1024 && ~ $h 768) r=(802 2 1024 54) if(~ $w 1280 && ~ $h 800) r=(1015 0 1280 54) if(~ $w 1280 && ~ $h 1024) r=(636 0 945 110) if(~ $w 1366 1376 && ~ $h 768) r=(1021 0 1366 115) if(~ $w 1400 1408 && ~ $h 1050) r=(700 0 1074 115) if(~ $w 1440 && ~ $h 900) r=(716 0 1103 115) if(~ $w 1600 && ~ $h 900) r=(796 0 1210 115) if(~ $w 1600 2966 && ~ $h 1200) r=(1206 0 1462 115) if(~ $w 1680 1696 && ~ $h 1050) r=(836 0 1261 115) if(~ $w 1920 1918 1918 && ~ $h 1080 1078) r=(1478 0 1739 115) window -r $r stats -Llcme ewsd.inri.net fs.stanleylieber.com mars2.inri.net $sysname } fn headerkprint{ if(~ $w 1280 && ~ $h 1024) r=(636 0 945 111) if(~ $w 1366 1376 && ~ $h 768) r=(674 0 1009 115) if(~ $w 1400 1408 && ~ $h 1050) r=(700 0 1074 115) if(~ $w 1440 && ~ $h 900) r=(716 0 1103 115) if(~ $w 1600 && ~ $h 900) r=(796 0 1210 115) if(~ $w 1600 2966 && ~ $h 1200) r=(796 0 1201 115) if(~ $w 1680 1696 && ~ $h 1050) r=(836 0 1261 115) if(~ $w 1920 1918 1918 && ~ $h 1080 1078) r=(1045 0 1471 115) window -scroll -r $r 'label kprint; rc -c ''cat /dev/kprint''' window -scroll -r $r 'label kprint; rc -c ''cat /mnt/term/dev/kprint''' } fn headerstatusmsg{ if(~ $w 1024 && ~ $h 768) r=398,0,805,54 if(~ $w 1280 && ~ $h 800) r=552,0,1018,54 if(~ $w 1280 && ~ $h 1024) r=976,0,1279,54 if(~ $w 1366 1376 && ~ $h 768) r=1048,0,1365,54 if(~ $w 1400 1408 && ~ $h 1050) r=1082,5,1400,59 if(~ $w 1440 && ~ $h 900) r=497,0,1017,54 if(~ $w 1600 && ~ $h 900) r=1281,0,1600,54 if(~ $w 1600 2966 && ~ $h 1200) r=1281,0,1599,54 if(~ $w 1680 1696 && ~ $h 1050) r=1335,0,1679,85 if(~ $w 1920 1918 1918 && ~ $h 1080 1078) r=1082,5,1400,59 font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w $r & } fn headerfaces{ if(~ $w 1280 && ~ $h 1024) r=(941 0 1280 111) if(~ $w 1366 1376 && ~ $h 768) r=(1004 0 1368 115) if(~ $w 1400 1408 && ~ $h 1050) r=(1070 0 1400 115) if(~ $w 1440 && ~ $h 900) r=(1099 0 1440 115) if(~ $w 1600 && ~ $h 900) r=(1206 0 1600 115) if(~ $w 1600 2966 && ~ $h 1200) r=(1206 0 1600 115) if(~ $w 1680 1696 && ~ $h 1050) r=(1498 0 1920 1918 1918 115) if(~ $w 1920 1918 1918 && ~ $h 1080 1078) r=(1487 0 1910 115) window -r $r 'rc -c ''font=/lib/font/bit/lucm/unicode.9.font; faces -i''' } switch($1){ case stats; headerstats case kprint; headerkprint case statusmsg; headerstatusmsg case headerfaces; headerfaces case * headerstats headerkprint headerclock #headerstatusmsg #headerfaces }