Skip to content

Instantly share code, notes, and snippets.

@jordanwade90
Created April 28, 2014 22:43
Show Gist options
  • Save jordanwade90/11386227 to your computer and use it in GitHub Desktop.
Save jordanwade90/11386227 to your computer and use it in GitHub Desktop.
Use acme to switch between “slides” (actually just text files) in a directory. Blatantly stolen from Russ Cox (http://research.swtch.com/acme).
#!/usr/local/plan9/bin/rc
. /usr/local/plan9/lib/acme.rc
winname `{pwd}^/$1
winctl clean
winctl get
#!/usr/local/plan9/bin/rc
current=`{basename $%}
currentx=`{9 grep -n '^'$current'([ ]|$)' index | sed 's/:.*//'}
pagex=`{echo $currentx + 1 | hoc}
page=`{sed -n $pagex^p index | awk '{print $1}'}
if(~ $#page 0){
echo no such page
exit 0
}
Slide $page
#!/usr/local/plan9/bin/rc
current=`{basename $%}
currentx=`{9 grep -n '^'$current'([ ]|$)' index | sed 's/:.*//'}
pagex=`{echo $currentx - 1 | hoc}
page=`{sed -n $pagex^p index | awk '{print $1}'}
if(~ $#page 0) {
echo no such page
exit 0
}
Slide $page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment