kindle-display/server/cron.sh
Dennis Reimann d1af52b967
Fix firefox hangups
Fixes #14.
2026-02-23 10:58:38 +01:00

23 lines
538 B
Bash
Executable file

#!/bin/bash
dir=$(cd `dirname $0` && pwd)
envFile=$(ls -l $dir/.env | awk '{print $NF}')
# load config
source $envFile
# generate data
cd $dir
./data.sh
# create screenshot
cd $dir/public
if ! type firefox &> /dev/null && [[ -d "/Applications/Firefox.app/Contents/MacOS/" ]]; then
PATH="$PATH:/Applications/Firefox.app/Contents/MacOS"
fi
killall firefox-esr
rm -rf ~/.mozilla ~/.cache/mozilla
firefox-esr --headless --screenshot http://localhost:$DISPLAY_SERVER_PORT --window-size=600,800
pngcrush -c 0 screenshot.png display.png