update Toolbox and scripts

This commit is contained in:
Iris Lightshard 2022-04-07 15:52:36 -06:00
parent 8920dc9db2
commit ccb2aa148e
Signed by: nilix
GPG key ID: 3B7FBC22144E6398
6 changed files with 81 additions and 2 deletions

View file

@ -3,6 +3,7 @@
[ Edit 1,$-1d ] # clear win
[ Edit x/^[ ]*/ a/# / ] # comment (replace # with comment prefix)
[ Edit x/^[ ]*# ?/ x/# ?/d ] # uncomment (replace # with comment prefix)
[ Edit s/^[ ][ ]//g ] # unindent
[ Edit s/^/ /g ] # indent
[ Edit s/^([ ][ ]|[\t]//g ] # unindent (2 spaces or tab)
[ Edit s/^/ /g ] # indent 2 spaces
[ Edit s/^/\t/g ] #indent tabs
[ Edit x/[^\n]\n[^\n]/ s/\n/ / ] # join lines

17
scripts/F+ Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
nx=1
if [ ! -z "$1" ]; then
nx=$1
fi
ctl=$(9p read acme/$winid/ctl)
set -- $ctl
size=$(echo $7 | awk -F/ '{print $5}')
size=${size%a}
newsize=$((size + nx))
newfont=$(echo $7 | sed -e s/$size/$newsize/g)
echo font ${newfont} | 9p write acme/${winid}/ctl

16
scripts/F- Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
nx=1
if [ ! -z "$1" ]; then
nx=$1
fi
ctl=$(9p read acme/$winid/ctl)
set -- $ctl
size=$(echo $7 | awk -F/ '{print $5}')
size=${size%a}
newsize=$((size - nx))
newfont=$(echo $7 | sed -e s/$size/$newsize/g)
echo font ${newfont} | 9p write acme/${winid}/ctl

5
scripts/Slide Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
echo name $(pwd)/$1 | 9p write acme/${winid}/ctl
echo clean | 9p write acme/${winid}/ctl
echo get | 9p write acme/${winid}/ctl

23
scripts/Slide+ Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
tagdata=$(9p read acme/${winid}/tag)
set -- ${tagdata}
path=$1
slide=$(basename ${path})
oldifs=${IFS}
IFS='
'
found=0
for s in *; do
if [ ${found} -eq 1 ]; then
Slide ${s}
break;
fi
if [ "${s}" != "${slide}" ]; then
continue
else
found=1
fi
done

17
scripts/Slide- Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
tagdata=$(9p read acme/${winid}/tag)
set -- ${tagdata}
path=$1
slide=$(basename ${path})
IFS='
'
for s in *; do
if [ "${s}" != "${slide}" ]; then
newslide=${s}
else
Slide ${newslide}
break;
fi
done