Created
April 28, 2014 22:43
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/plan9/bin/rc | |
. /usr/local/plan9/lib/acme.rc | |
winname `{pwd}^/$1 | |
winctl clean | |
winctl get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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