Skip to content

Commit

Permalink
Fix Chromium not starting if spamkey is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Jun 26, 2018
1 parent 0b58406 commit 5c130b0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/modules/minimalkioskos/filesystem/home/pi/scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
export DISPLAY=:0

# Get our location
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand All @@ -25,13 +27,12 @@ chromium-browser --kiosk --touch-events=enabled --disable-pinch --noerrdialogs -
# Keep sending an user-defined key to Chromium.
# This defaults to f, for SimplePresenter to pick up and fullscreen videos for increased performance
SPAMKEY="$(head -n 1 /boot/spamkey.txt)"
if [ ! -z "$SPAMKEY" ]
then
while true
do
export DISPLAY=:0
while true
do
if [ ! -z "$SPAMKEY" ]
then
WID=$(xdotool search --onlyvisible --class chromium|head -1)
xdotool windowactivate "${WID}"
xdotool key "$SPAMKEY"
done
fi
fi
done

0 comments on commit 5c130b0

Please sign in to comment.