piu_kiosk 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2021 Clementine Computing LLC.
  4. #
  5. # This file is part of PopuFare.
  6. #
  7. # PopuFare is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # PopuFare is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. # This is the front end interface to the PIU that will run chromium
  21. # browser (on startup) and ultimately connect to a local web
  22. # server serving up the passenger facing interface
  23. #
  24. # This assumes it will be run by xinit without another window manager running. For example:
  25. #
  26. # xinit ./start-kiosk.sh
  27. #
  28. export BASEDIR=/home/pi
  29. export DISPLAY=:0
  30. export fqADDRESS="http://127.0.0.1:8001"
  31. /usr/bin/matchbox-window-manager \
  32. -use_cursor no \
  33. -use_titlebar no &
  34. # clear out warning bar on chromium
  35. #
  36. tmpfn=`mktemp`
  37. jq '.profile.exited_cleanly = true' $BASEDIR/.config/chromium/Preferences | jq '.profile.exit_type = "Normal"' > $tmpfn
  38. mv $tmpfn $BASEDIR/.config/chromium/Preferences
  39. # turn off screensave/screen blanking
  40. #
  41. xset s noblank
  42. xset s off
  43. xset -dpms
  44. # hide mouse after 0.5 seconds of idle time
  45. #
  46. unclutter -idle 0.05 -root &
  47. # hide mouse completely
  48. #
  49. #unclutter -root &
  50. rm -f /tmp/kiosk.info
  51. touch /tmp/kiosk.info
  52. echo "DISPLAY=$DISPLAY" >> /tmp/kiosk.info
  53. echo "XAUTHORITY=$XAUTHORITY" >> /tmp/kiosk.info
  54. # start chromium in kiosk mode
  55. #
  56. #/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk ./html/index.html
  57. #
  58. # --disable-application-cache \
  59. /usr/bin/chromium-browser \
  60. --simulate-outdated-no-au='Tue, 31 Dec 2999 23:59:59 GMT' \
  61. --no-sandbox \
  62. --test-type \
  63. --noerrdialogs \
  64. --disable-infobars \
  65. --aggressive-cache-discard \
  66. --incognito \
  67. --disable-pinch \
  68. --overscroll-history-navigation=0 \
  69. --disable-component-update \
  70. --disable-gpu \
  71. --kiosk \
  72. $fqADDRESS
  73. # refresh
  74. #
  75. #xdotool keydown ctrl+r; xdotool keyup ctrl+r;