Unified · Split
| @@ -402,8 +402,9 @@ fs_read(Ixp9Req *r) { · 401 unmodified lines | ||
| 402 | 402 | ixp_respond(r, nil); |
| 403 | 403 | return; |
| 404 | 404 | case FsFWctl: |
| 405 | − // XXX TODO: visible, current | |
| 406 | − sprint(buf, "%11d %11d %11d %11d %s %s ", w->orig.x + w->screenr.min.x, w->orig.y + w->screenr.min.y, w->screenr.max.x, w->screenr.max.y, w-> visible ? "visible" : "hidden", "current"); | |
| 405 | + // XXX TODO: current | |
| 406 | + s = w-> visible ? "visible" : "hidden"; | |
| 407 | + sprint(buf, "%11d %11d %11d %11d %s %s ", w->orig.x + w->screenr.min.x, w->orig.y + w->screenr.min.y, w->screenr.max.x, w->screenr.max.y, s, "current"); | |
| 407 | 408 | ixp_srv_readbuf(r, buf, strlen(buf)); |
| 408 | 409 | ixp_respond(r, nil); |
| 409 | 410 | return; |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #!/bin/rc |
| 2 | 2 | |
| 3 | 3 | # Usage |
| 4 | −# wctl=`{wctl $wsys} | |
| 4 | +# wctl=`{ wctl wsys [defaultcmd] } | |
| 5 | 5 | |
| 6 | 6 | fn window-m { |
| 7 | 7 | dir = /mnt/wsys |
| @@ -26,11 +26,15 @@ fn window-m { · 18 unmodified lines | ||
| 26 | 26 | case -hide |
| 27 | 27 | shift |
| 28 | 28 | } |
| 29 | − if(~ $#* 0) cmd = rc | |
| 29 | + if(~ $#* 0) cmd = $defaultcmd | |
| 30 | 30 | if not cmd = $* |
| 31 | 31 | echo -n `{basename $cmd(1)} > /dev/label >[2] /dev/null |
| 32 | − { | |
| 33 | − echo kill > /proc/^`{cat $dir/kill}^/note | |
| 32 | + if(test -f $dir/kill){ | |
| 33 | + f=/proc/^`{cat $dir/kill}^/note | |
| 34 | + # the proces could have finished on | |
| 35 | + # its own, check it is still there. | |
| 36 | + if(test -f $f) | |
| 37 | + echo kill > $f | |
| 34 | 38 | } & |
| 35 | 39 | exec $cmd < /dev/cons > /dev/cons >[2] /dev/cons |
| 36 | 40 | } |
| @@ -51,12 +55,17 @@ fn wctl { · 14 unmodified lines | ||
| 51 | 55 | if (~ $a(1) new) $a |
| 52 | 56 | } |
| 53 | 57 | |
| 54 | −if(! ~ $1 '') | |
| 58 | +defaultcmd=(rio -i window) | |
| 59 | +if(! ~ $1 ''){ | |
| 55 | 60 | wsys=$1 |
| 61 | + shift | |
| 62 | +} | |
| 56 | 63 | if(~ $wsys ''){ |
| 57 | 64 | echo 'wctl: $wsys not defined' |
| 58 | 65 | exit bad |
| 59 | 66 | } |
| 67 | +if(! ~ $1 '') | |
| 68 | + defaultcmd=$* | |
| 60 | 69 | |
| 61 | 70 | service=wctl.$user |
| 62 | 71 | # we want to know the pid of the wctl rc, |