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
This commit is contained in:
parent
f3a781e42b
commit
62a4845edd
4 changed files with 34 additions and 20 deletions
37
build.sh
37
build.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
|
||||
|
||||
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
|
||||
|
|
10
config
10
config
|
@ -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"
|
||||
|
|
|
@ -81,14 +81,11 @@ module Taro
|
|||
@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,
|
||||
|
|
|
@ -438,6 +438,8 @@ JMP2r
|
|||
&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
|
||||
|
|
Loading…
Reference in a new issue