Skip to content

Instantly share code, notes, and snippets.

@nvkv
Created November 19, 2012 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvkv/4112224 to your computer and use it in GitHub Desktop.
Save nvkv/4112224 to your computer and use it in GitHub Desktop.
A bit modified acmeedit from 9fans
#!/usr/bin/env rc
. $PLAN9/lib/acme.rc
newwindow
st=$status
terminal=dumb
shell=rc
if (~ $st 1) {
acme -f /mnt/font/Menlo-Regular/13a/font $* &
exit ''
}
dir=`{dirname $1}
b=`{basename $1}
winctl name `{cd $"dir; pwd}^/$"b
winctl get
winctl cleartag
echo -n ' Put Undo Redo Cancel | Look ' | winwrite tag
fn event {
switch($1$2) {
case Mx MX
if(~ $9 Cancel) {
windel sure
exit cancelled
}
winwriteevent $*
case Ml ML
winwriteevent $*
}
}
wineventloop
exit ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment