shithub: windir

Download patch

ref: 05532cc57f40c59f45d7ed7cdd005506e7ebfa28
author: glenda <glenda@cirno>
date: Fri Feb 7 23:53:40 EST 2025

initial commit

--- /dev/null
+++ b/windir
@@ -1,0 +1,19 @@
+#!/bin/rc
+
+prevdir=''
+self=`{cat /dev/winid} 
+
+while(~ 1 1) {
+    for(wsys in /dev/wsys/[0-9]*) {
+    	ctl=`{read -c 60 $wsys/wctl}
+    	if(~ $ctl(5) 'current' && ! ~ $wsys $self){
+    		dir=`{cat $wsys/wdir}
+    		if(! ~ $dir $prevdir){
+    			>/dev/text
+    			lc $dir
+    			prevdir=$dir
+    		}
+    	}
+    sleep 0.5
+    }
+}