Infoscreen

From Slaskete wiki
Revision as of 21:22, 18 November 2022 by Einarjh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ting å gjøre for å få til en infoskjerm som fyrer opp X ved boot.

systemctl edit --force --full infoscreen.service
[Unit]
Description=Infoscreen autostart
After=remote-fs.target polkit.service systemd-user-sessions.service network-online.target sound.target
Requires=network-online.target
Conflicts=getty@tty1.service

[Service]
User=einar
Group=einar
PAMName=login
TTYPath=/dev/tty1
Environment=WINDOWING=x11
ExecStart=/usr/bin/xinit /usr/bin/startx -- :0
Restart=on-failure
StandardInput=tty
StandardOutput=journal

[Install]
WantedBy=graphical.target

/etc/X11/Xwrapper.config:

allowed_users = anybody

$HOME/.bash_profile:

if [ -z "$SSH_CLIENT" ] || [ -z "$SSH_TTY" ]; then
    startx -- -nocursor
fi

$HOME/.xinitrc:

exec openbox-session

x11vnc -storepasswd something .x11vnc/passwd

$HOME/.config/openbox/autostart.sh

xset s off      # don't activate screensaver
xset -dpms      # disable DPMS (Energy Star) features
xset s noblank  # don't blank the video device
setxkbmap no

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences

#chromium-browser --start-maximized --disable-translate --disable-infobars --disable-suggestions-service --allow-file-access-from-files --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT' --kiosk --app=file:///home/einar/reload.html &

x11vnc -forever -rfbauth ~/.x11vnc/passwd -ncache 0 &
unclutter --timeout 5 --fork
/home/einar/showstream.sh &
/home/einar/fullscreen.sh &

$HOME/showstream.sh

#!/bin/bash
while true; do
  gst-launch-1.0 --gst-fatal-warnings rtmpsrc location=rtmp://webfront/live/benchy ! decodebin3 ! glimagesink sync=false
  #gst-launch-1.0 --gst-fatal-warnings rtspsrc location=rtsp://mjoscam:8554/unicast ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink sync=false
  sleep 10
done

$HOME/fullscreen.sh

#!/bin/bash
while true; do
  wmctrl -r "gst-launch-1.0" -b add,fullscreen
  wmctrl -r "OpenGL renderer" -b add,fullscreen
  sleep 5
done

$HOME/reload.html

<!doctype html>
<html>
  <head>
    <title>autoreloader</title>
    <script type="text/javascript">
      window.onload = setupRefresh;

      function setupRefresh() {
          setInterval("refreshFrame();", 21600000);
      }
      function refreshFrame() {
         parent.f.location.reload();
      }
    </script>
  </head>
  <frameset>
    <frame name="f" src="frame.html" />
  </frameset>
</html>

$HOME/frame.html

<!doctype html>
<html>
  <head>
    <title>kitteh autoreloader - frame part</title>
  </head>
  <frameset>
    <frame src="https://www.nrk.no/" />
  </frameset>
</html>

crontab -e

30 22 * * * /usr/bin/xset -display :1 dpms force off >> /home/einar/cronlog 2>&1
15 8 * * * /usr/bin/xset -display :1 dpms force on >> /home/einar/cronlog 2>&1
16 8 * * * /usr/bin/xset -display :1 -dpms; /usr/bin/xset -display :1 s noblank; /usr/bin/xset -display :1 s off