Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
computer:raspberry_pi_browser_v2 [2019/01/05 15:34]
tdobes created
computer:raspberry_pi_browser_v2 [2019/01/05 19:07]
tdobes
Line 74: Line 74:
 aptitude install xserver-xorg-video-fbturbo xserver-xorg-input-evdev # using evdev instead of libinput because it pulls in a ton more deps aptitude install xserver-xorg-video-fbturbo xserver-xorg-input-evdev # using evdev instead of libinput because it pulls in a ton more deps
 aptitude install xinit evilwm xdotool x11vnc unclutter x11-xserver-utils aptitude install xinit evilwm xdotool x11vnc unclutter x11-xserver-utils
-aptitude install ​python-pyside.qtwebkit+aptitude install --without-recommends chromium-browser
 aptitude install fonts-symbola # takes care of emoji aptitude install fonts-symbola # takes care of emoji
  
Line 158: Line 158:
  
 systemctl enable browser.service systemctl enable browser.service
 +
 +# rpi-briefing:​ NETWORK_CHECK=music.mcp.lcl,​ URL=http://​music.mcp.lcl/​morning_briefing/​cycler.html,​ 1920x1080 (1918 1078)
 +# rpi-statusdisplay (old): NETWORK_CHECK=rpi-relaycontrol.mcp.lcl,​ URL=http://​rpi-relaycontrol.mcp.lcl/,​ 1920x1200 (1918 1198)
 +# rpi-statusdisplay (new): NETWORK_CHECK=music.mcp.lcl,​ URL=http://​music.mcp.lcl/​statusdisplay/,​ 1920x1200 (1918 1198)
 +# rpi-timeclockdisplay:​ NETWORK_CHECK=database.mcp.lcl,​ URL=http://​database.mcp.lcl/​timeclock/​right.php,​ 1920x1080 (1918 1078)
 +
 +echo '#​!/​bin/​sh'​ > /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '​NETWORK_CHECK=music.mcp.lcl'​ >> /​usr/​local/​bin/​browser.sh
 +echo '​URL=http://​music.mcp.lcl/​statusdisplay/'​ >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '# get rid of cache and settings'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'rm -r ~/​.cache/​chromium 2> /​dev/​null'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'rm -r ~/​.config/​chromium 2> /​dev/​null'​ >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '# to get --disable-web-security to work (which allows cross-origin requests), you have to specify a user-data-dir'​ >> /​usr/​local/​bin/​browser.sh
 +echo "# also, chrome segfaults if it's not an abolute path" >> /​usr/​local/​bin/​browser.sh
 +echo '​chrome_data_dir=`realpath ~/​.chromedata`'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'rm -r $chrome_data_dir 2> /​dev/​null'​ >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo 'echo -n waiting for network'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'while ! ping -c 1 $NETWORK_CHECK > /dev/null 2> /dev/null ; do' >> /​usr/​local/​bin/​browser.sh
 +echo ' ​ echo -n .' >> /​usr/​local/​bin/​browser.sh
 +echo ' ​ sleep 1' >> /​usr/​local/​bin/​browser.sh
 +echo '​done'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'echo done!' >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '# move the window to appropriate location (not needed for chromium)'​ >> /​usr/​local/​bin/​browser.sh
 +echo '#sh -c '"'"'​sleep 1 ; echo -n attempting to move simplebrowser ; while ! xdotool search --onlyvisible --name simplebrowser.py windowmove 0 0 windowsize 1918 1078; do echo -n . ; sleep 1 ; done ; echo done!'"'"'​ &' >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '# start simplebrowser'​ >> /​usr/​local/​bin/​browser.sh
 +echo '#exec nice -n 1 simplebrowser.py $URL' >> /​usr/​local/​bin/​browser.sh
 +echo >> /​usr/​local/​bin/​browser.sh
 +echo '# start chromium'​ >> /​usr/​local/​bin/​browser.sh
 +echo 'exec nice -n 1 /​usr/​lib/​chromium-browser/​chromium-browser --disable-preconnect --disable-breakpad --disable-sync --no-sandbox --disable-plugins --disable-translate --dns-prefetch-disable --data-reduction-proxy-server-experiments-disabled --disable-bundled-ppapi-flash --no-pings --no-first-run --chrome-frame --disable-session-crashed-bubble --disable-web-security --user-data-dir=$chrome_data_dir --disable-gpu --start-fullscreen --kiosk --app=$URL'​ >> /​usr/​local/​bin/​browser.sh
 +chmod +x /​usr/​local/​bin/​browser.sh
 +
 +# HDMI mode, 1920x1080@60 Hz with audio - see https://​www.raspberrypi.org/​documentation/​configuration/​config-txt/​video.md
 +sed -i '​s/#​hdmi_group=1/​hdmi_group=2/​g;​ s/#​hdmi_drive=2/​hdmi_drive=2/​g;​ s/#​hdmi_mode=1/​hdmi_mode=82\n\nhdmi_force_mode=1/​g;​ s/#​disable_overscan=1/​disable_overscan=1/​g;​ s/#​hdmi_force_hotplug=1/​hdmi_force_hotplug=1/​g'​ /​boot/​config.txt
 +# HDMI mode, 1920x1200@60 Hz without audio - see https://​www.raspberrypi.org/​documentation/​configuration/​config-txt/​video.md
 +sed -i '​s/#​hdmi_group=1/​hdmi_group=2/​g;​ s/#​hdmi_drive=2/​hdmi_drive=1/​g;​ s/#​hdmi_mode=1/​hdmi_mode=69\n\nhdmi_force_mode=1/​g;​ s/#​disable_overscan=1/​disable_overscan=1/​g;​ s/#​hdmi_force_hotplug=1/​hdmi_force_hotplug=1/​g'​ /​boot/​config.txt
 +
 +# quiet boot
 +sed -i -e '​s/​.*/&​ quiet/'​ /​boot/​cmdline.txt
 +
 +systemctl stop rsyslog.service && systemctl disable rsyslog.service
 +rm /​var/​log/​auth.log* /​var/​log/​daemon.log* /​var/​log/​debug* /​var/​log/​kern.log* /​var/​log/​messages* /​var/​log/​user.log* /​var/​log/​syslog*
 +
 +systemctl disable rsync.service
 +systemctl disable sshswitch.service
 +</​code>​
 +
 +old (qtwebkit-based):​
 +<​code>​
 +aptitude install python-pyside.qtwebkit
  
 echo '#​!/​usr/​bin/​env python'​ > /​usr/​local/​bin/​simplebrowser.py echo '#​!/​usr/​bin/​env python'​ > /​usr/​local/​bin/​simplebrowser.py
Line 179: Line 234:
 echo '​sys.exit(app.exec_())'​ >> /​usr/​local/​bin/​simplebrowser.py echo '​sys.exit(app.exec_())'​ >> /​usr/​local/​bin/​simplebrowser.py
 chmod +x /​usr/​local/​bin/​simplebrowser.py chmod +x /​usr/​local/​bin/​simplebrowser.py
- 
-# rpi-briefing:​ NETWORK_CHECK=music.mcp.lcl,​ URL=http://​music.mcp.lcl/​morning_briefing/​cycler.html,​ 1920x1080 (1918 1078) 
-# rpi-statusdisplay (old): NETWORK_CHECK=rpi-relaycontrol.mcp.lcl,​ URL=http://​rpi-relaycontrol.mcp.lcl/,​ 1920x1200 (1918 1198) 
-# rpi-statusdisplay (new): NETWORK_CHECK=music.mcp.lcl,​ URL=http://​music.mcp.lcl/​statusdisplay/,​ 1920x1200 (1918 1198) 
-# rpi-timeclockdisplay:​ NETWORK_CHECK=database.mcp.lcl,​ URL=http://​database.mcp.lcl/​timeclock/​right.php,​ 1920x1080 (1918 1078) 
  
 echo '#​!/​bin/​sh'​ > /​usr/​local/​bin/​browser.sh echo '#​!/​bin/​sh'​ > /​usr/​local/​bin/​browser.sh
Line 203: Line 253:
 echo 'exec nice -n 1 simplebrowser.py $URL' >> /​usr/​local/​bin/​browser.sh echo 'exec nice -n 1 simplebrowser.py $URL' >> /​usr/​local/​bin/​browser.sh
 chmod +x /​usr/​local/​bin/​browser.sh chmod +x /​usr/​local/​bin/​browser.sh
- 
-# HDMI mode, 1920x1080@60 Hz with audio - see https://​www.raspberrypi.org/​documentation/​configuration/​config-txt/​video.md 
-sed -i '​s/#​hdmi_group=1/​hdmi_group=2/​g;​ s/#​hdmi_drive=2/​hdmi_drive=2/​g;​ s/#​hdmi_mode=1/​hdmi_mode=82\n\nhdmi_force_mode=1/​g;​ s/#​disable_overscan=1/​disable_overscan=1/​g;​ s/#​hdmi_force_hotplug=1/​hdmi_force_hotplug=1/​g'​ /​boot/​config.txt 
-# HDMI mode, 1920x1200@60 Hz without audio - see https://​www.raspberrypi.org/​documentation/​configuration/​config-txt/​video.md 
-sed -i '​s/#​hdmi_group=1/​hdmi_group=2/​g;​ s/#​hdmi_drive=2/​hdmi_drive=1/​g;​ s/#​hdmi_mode=1/​hdmi_mode=69\n\nhdmi_force_mode=1/​g;​ s/#​disable_overscan=1/​disable_overscan=1/​g;​ s/#​hdmi_force_hotplug=1/​hdmi_force_hotplug=1/​g'​ /​boot/​config.txt 
- 
-# quiet boot 
-sed -i -e '​s/​.*/&​ quiet/'​ /​boot/​cmdline.txt 
- 
-systemctl stop rsyslog.service && systemctl disable rsyslog.service 
-rm /​var/​log/​auth.log* /​var/​log/​daemon.log* /​var/​log/​debug* /​var/​log/​kern.log* /​var/​log/​messages* /​var/​log/​user.log* /​var/​log/​syslog* 
- 
-systemctl disable rsync.service 
-systemctl disable sshswitch.service 
 </​code>​ </​code>​
computer/raspberry_pi_browser_v2.txt · Last modified: 2019/02/23 13:07 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS