shithub: rcmisc

ref: 468e61644c1d6c846d737b5eb8f370f8938c0ec0
dir: /common/

View raw version
#!/bin/rc

screen=`{read -c 60 < /dev/screen}
screenx=$screen(4)
screeny=$screen(5)
factor=`{echo '(' ^ $screenx ^ '*' ^ $screeny ^ ') / (1920 * 1080)' | bc}
if(~ $factor 0) factor = 1
fn scale {
    for(num in $*)
        echo $factor ^ '*' ^ $num | bc
}
fn offsetx {
    echo $screenx ^ '-' ^ $* | bc
}
fn offsety {
    echo $screeny ^ '-' ^ $* | bc
}

window -r `{scale (5 5 161 200)} stats -lmisce
window -r `{scale (5 205 161 400)} winwatch
window -r `{scale (5 405 200 600)} calwidget
window -miny 130
#window riowstart


# run a system shell on the serial console
~ $#console 0 || window -scroll console