sfx: option to remove mouse cursor

This commit is contained in:
ed 2021-07-20 01:00:28 +02:00
parent 4a3bb35a95
commit 027e8c18f1

View file

@ -23,6 +23,8 @@ echo
# #
# `no-fnt` saves ~9k by removing the source-code-pro font # `no-fnt` saves ~9k by removing the source-code-pro font
# (mainly used my the markdown viewer/editor) # (mainly used my the markdown viewer/editor)
#
# `no-dd` saves ~2k by removing the mouse cursor
# port install gnutar findutils gsed coreutils # port install gnutar findutils gsed coreutils
@ -60,15 +62,18 @@ use_gz=
do_sh=1 do_sh=1
do_py=1 do_py=1
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
[ "$1" = clean ] && clean=1 && shift && continue case $1 in
[ "$1" = re ] && repack=1 && shift && continue clean) clean=1 ; ;;
[ "$1" = gz ] && use_gz=1 && shift && continue re) repack=1 ; ;;
[ "$1" = no-ogv ] && no_ogv=1 && shift && continue gz) use_gz=1 ; ;;
[ "$1" = no-fnt ] && no_fnt=1 && shift && continue no-ogv) no_ogv=1 ; ;;
[ "$1" = no-cm ] && no_cm=1 && shift && continue no-fnt) no_fnt=1 ; ;;
[ "$1" = no-sh ] && do_sh= && shift && continue no-dd) no_dd=1 ; ;;
[ "$1" = no-py ] && do_py= && shift && continue no-cm) no_cm=1 ; ;;
break no-sh) do_sh= ; ;;
no-py) do_py= ; ;;
esac
shift
done done
tmv() { tmv() {
@ -200,6 +205,12 @@ done
sed -r '/scp\.woff2/d' <$f >t && tmv "$f" sed -r '/scp\.woff2/d' <$f >t && tmv "$f"
} }
[ $no_dd ] && {
rm -rf copyparty/web/dd
f=copyparty/web/browser.css
sed -r 's/(cursor: )url\([^)]+\), (pointer)/\1\2/; /[0-9]+% \{cursor:/d; /animation: cursor/d' <$f >t && tmv "$f"
}
[ $repack ] || [ $repack ] ||
find | grep -E '\.py$' | find | grep -E '\.py$' |
grep -vE '__version__' | grep -vE '__version__' |