dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

Slide (617B)


      1 #!/usr/local/plan9/bin/rc
      2 # Slide[-+] - go back and forwards in a slide show
      3 # usage: Slide[-+]
      4 #
      5 # bugs:  slides must be named 1, 2, 3...
      6 #        to "install" the script copy it to /acme/bin/Slide{,-,+}
      7 
      8 switch($0){
      9 case *Slide
     10     ls `{pwd}
     11     exit
     12 case *Slide+
     13     page=`{echo `{basename $%} + 1 | hoc}
     14     if(! test -f $page) exit
     15 case *Slide-
     16     page=`{echo `{basename $%} - 1 | hoc}
     17     if(! test -f $page) exit
     18 case *
     19     echo Error: bogus program name!
     20     exit wrongname
     21 }
     22 
     23 echo 'name '`{pwd}^/$page'' | 9p write acme/$winid/ctl
     24 echo clean | 9p write acme/$winid/ctl
     25 echo get   | 9p write acme/$winid/ctl