shithub: rc

Download patch

ref: 286ada03460f6a8cf1b1651eb6a47fa089cd0abe
parent: c0403e2bf7ec0122ff0cc93a8f92a7e80ad74b9f
author: qwx <qwx@sciops.net>
date: Thu Sep 30 15:37:25 EDT 2021

add rescale: scale a sized window up as much as possible

--- /dev/null
+++ b/bin/rescale
@@ -1,0 +1,10 @@
+#!/bin/rc
+echo $vgasize | awk -Fx -v 'w='$1 -v 'h='$2 '
+{
+	dx = $1 / w
+	dy = $2 / h
+	scale = int(dy < dx ? dy : dx)
+	if(scale * w == $1 || scale * h == $2)
+		scale--
+	print "resize -dx", scale * w + 8, "-dy", scale * h + 8 >"/dev/wctl"
+}'