all repos — taro @ 62a4845edda44a9dd497cf4374dedb884d0c3a5c

mblaze frontend in uxn + crystal

update build script and add quote escape to config; taro-ls: fix scroll wrap by keyboard if the number of items is less than the height of the listbox
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmQkf2MACgkQO3+8IhRO
Y5iBBw//cqu4/mUTqI3RySQ7397Cj7pSOwk+rc0mtLH96SDtz2XPs3QYk1JDXu+z
4M8ZRZ/rFzgkQlaBecpM9xim7K/D9lyMjCkTF9A5nCc/3wHgs6XGMdu65XJ5NcHV
JY5bP3pxHTt5hSc5h8plSRUzzuxHk/1uUO4HyF7Zl2mYEwL85l7GNBRj2gJrxcjV
Zce3a+8oKCQz81Gd+Of7UDZQAVqpV4QhmLqlF6JEDYlkUpiJ4ygIej6n4sJufMsC
G7sDD0guhocp6ZD7VqgMkJJJiHLjPq+dYmXKIOGuP1vNGRtQXCchvuHVpQ+xG4WN
++vHm+rfdVpUxd+bUA8BsJRISAgRhSpYUsXwnIN+xOQA3buZ9g8OUJvTUktscCO3
WCD/ry3kdgq+iI8IRwzzyjTkEZ1JDXqlj2dQOy3ri5ME67Cnp/7K0+XTtvUiysiA
ACusmSNF42uvjPey3z8Xwaa4LjH0DHcbWBPAB0fdwphM5NwvDE1wpBKI6b5Kivlz
f3PSegQWmctuaGilm/dubZAVTLmvGp/aj/cVChPDAszhmVWY6/m1st4SjXfvwgdp
JCQVazPT7DSttx64k+vT524HxKo+DatFTFbWiQdq7aOoz3NpFBS+5W+o9y5BM5JO
i1LsbAPVg8yJAEj+T/pUEUDkbKBcNYKP/RH/TRxJO9ZDYhf97lc=
=iNjd
-----END PGP SIGNATURE-----
commit

62a4845edda44a9dd497cf4374dedb884d0c3a5c

parent

f3a781e42b661778a4f9f67a9e323d8098d53764

4 files changed, 34 insertions(+), 20 deletions(-)

jump to
M build.shbuild.sh

@@ -1,6 +1,20 @@

#!/bin/sh +# check we have all dependencies + +echo "Checking dependencies..." + +if ! which uxnasm || ! which uxnemu || ! which crystal || ! which mseq ; then + echo "dependencies are not met - we need:" + echo "- uxnasm" + echo "- uxnemu" + echo "- crystal" + echo "- mblaze" + exit 1 +fi + # build config into crystal constants + echo "Generating config.cr" . ./config

@@ -15,12 +29,8 @@ READER_PROG = "${READER_PROG}"

COMPOSE_PROG = "${COMPOSE_PROG}" END -if ! which ${UXN_EMU}; then - echo "${UXN_EMU} is not in PATH! Beware..." - sleep 1 -fi +# build -# build echo "Building taro-ls" uxnasm taro-ls.tal taro-ls echo "Building taro-ctl"

@@ -28,16 +38,21 @@ crystal build --release --no-debug -s taro-ctl.cr

# setup TARO_LIB -if [ ${TARO_LIB} != ${PWD} ]; then - mkdir -p ${TARO_LIB} - for x in "taro-ls taro-reader lesskey .theme font.icn taro-ctl taro.svg"; do +if [ "${TARO_LIB}" != "${PWD}" ]; then + mkdir -p "${TARO_LIB}" + for x in taro-ls taro-reader lesskey .theme font.icn taro-ctl taro.svg; do if [ -e ${x} ]; then - cp ${x} ${TARO_LIB} + cp ${x} "${TARO_LIB}" fi done - echo "TARO_LIB is in ${TARO_LIB}; add it to your PATH or you can just copy taro-ctl there." + echo "TARO_LIB is in ${TARO_LIB}; you can either" + echo "- add it to your PATH" + echo "- or copy taro-ctl into your PATH" fi +cp "$(which uxnemu)" "${TARO_LIB}/${UXN_EMU}" + +# optionally, fill out desktopfile with proper variables and install it if [ "$1" = "desktopfile" ]; then sed -e "s#TARO_LIB#${TARO_LIB}#g" -e "s#UXN_EMU#${UXN_EMU}#g" taro.desktop > ~/.local/share/applications/taro.desktop -fi+fi
M configconfig

@@ -1,16 +1,16 @@

# where your maildir folders live MBOX_ROOT=${HOME}/lib/mail/zoho -# where runtime files live (probably this git repo for simplicity) -TARO_LIB=${PWD} +# where runtime files live +TARO_LIB=${HOME}/lib/taro # where attachments are saved to TARO_DOWNLOADS=${HOME}/tmp -# name of your uxnemu executable; it must be in PATH; i copy mine to "taro" so it gets the _NET_WM_CLASS=taro - there may be a better way to do this in the future +# uxnemu will be copied to TARO_LIB/UXN_EMU to give it the right _NET_WM_CLASS UXN_EMU=taro # any custom env you want to set for reader/compose wins TARO_ENV="PINENTRY_USER_DATA=taro" # reader and compose progs - I use st, you may use your own terminal although the command line options may differ so read the manual -READER_PROG="${TARO_ENV} TARO_DOWNLOADS=${TARO_DOWNLOADS} LESSKEYIN=${TARO_LIB}/lesskey st -c taro -n taro -t taro-reader -e ${TARO_LIB}/taro-reader" -COMPOSE_PROG="${TARO_ENV} st -c taro -n taro -t taro-compose -e mcom" +READER_PROG="${TARO_ENV} TARO_DOWNLOADS=\\\"${TARO_DOWNLOADS}\\\" LESSKEYIN=\\\"${TARO_LIB}/lesskey\\\" st -c ${UXN_EMU} -n ${UXN_EMU} -t taro-reader -e \\\"${TARO_LIB}/taro-reader\\\"" +COMPOSE_PROG="${TARO_ENV} st -c ${UXN_EMU} -n ${UXN_EMU} -t taro-compose -e mcom"
M taro-ctl.crtaro-ctl.cr

@@ -81,14 +81,11 @@ @stdout_r, @stdout_w = IO.pipe

@stdin_r, @stdin_w = IO.pipe @lifetime = Channel(UInt8).new - uxnrom : String = "" - - uxnargs = ["-s", "1", "#{TARO_LIB}/#{uxnrom}.rom"] case w when WinType::LIST then spawn do Process.run( - command: UXN_EMU, + command: "#{TARO_LIB}/#{UXN_EMU}", args: [ "-s", "1", "taro-ls" ], chdir: TARO_LIB, input: @stdin_r,
M taro-ls.taltaro-ls.tal

@@ -438,6 +438,8 @@

&back STHk LB_SELECT_IDX LDZ2 #0000 NEQ2 ,&can_go_back JCN STHkr LB_LEN LDZ2 #0001 SUB2 STHkr LB_SELECT_IDX STZ2 + ( if number of entries is less than height, don't scroll to bottom ) + STHkr LB_LEN LDZ2 #0001 SUB2 #00 STHkr LB_HEIGHT LDZ LTH2 ,&end JCN STHkr LB_LEN LDZ2 #00 STHkr LB_HEIGHT LDZ SUB2 STHkr LB_TOP STZ2 ,&end JMP &can_go_back