Difference between revisions of "Lobby TV Display Computer"

From Michael's Information Zone
Jump to navigation Jump to search
Line 74: Line 74:
 
</pre>
 
</pre>
 
====Wifi====
 
====Wifi====
<ref>https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-networkmanager-to-ignore-certain-devices_configuring-and-managing-networking</ref>
+
<ref>https://wiki.archlinux.org/title/wpa_supplicant</ref>
 
<pre>
 
<pre>
nmcli d set wlp2s0 managed yes
+
cat << EOF >/etc/wpa_supplicant/wpa_supplicant.conf
 +
ctrl_interface=/run/wpa_supplicant
 +
update_config=1
 +
EOF
 +
 
 +
wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf
 +
 
 
</pre>
 
</pre>

Revision as of 09:04, 19 May 2022

Purpose

To display content on a lobby TV.

General Process

Computer connects to a website using a browser in full screen mode, the website manages the content and redirects if needed. The PC should never need to be touched.

PC Config

  • Networking : Use wired connectivity where possible. WiFi instructions per OS provided below where applicable.

CentOS 9 Stream

NOTE : This is still in testing.
NOTE : Chromium is not in the repos for CentOS Stream. The computer I am using is very slow and I don't feel like compiling. Will use Chrome instead.

  • centos-stream-release-9.0-12.el9

[1]

  • There was some new methods for getty, will need to create another post on this[2]


  • Minimal install of CentOS 9 Stream
  • Dump of commands, could be used for a script. Change the URL to match your environment.
url='https://your.site.com/location/'
dnf -y update
dnf install -y epel-release
dnf makecache
dnf install -y wget tar NetworkManager-wifi
rpm --import https://dl.google.com/linux/linux_signing_key.pub
dnf install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
dnf install -y openbox xorg-x11-drv-libinput xorg-x11-server-utils xorg-x11-xinit
wget -O unclutter.tar.zst --content-disposition --max-redirect=5 https://www.archlinux.org/packages/community/x86_64/unclutter/download/
zstd -d unclutter.tar.zst -o unclutter.tar
tar -xf unclutter.tar
mv usr/bin/unclutter /usr/bin/unclutter
useradd publicuser
mkdir -p /etc/systemd/system/getty\@tty1.service.d/
cat << EOF > /etc/systemd/system/getty\@tty1.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin publicuser - $TERM
EOF

rm -f /etc/systemd/system/getty.target.wants/getty@tty1.service
cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service
sed -i -e "s/\/sbin\/agetty/\0 --autologin publicuser/" /etc/systemd/system/getty@tty1.service
ln -s /etc/systemd/system/getty@tty1.service /etc/systemd/system/getty.target.wants/getty@tty1.service

cat << EOF >>/home/publicuser/.bash_profile
if [[ -z \$DISPLAY ]] && [[ \$(tty) = /dev/tty1 ]]; then # Check if we have a display and we're on TTY1
startx
else
echo "Please contact the help desk and provide the following"
echo "IP : "
echo "Hostname : $hostname"
fi
EOF

cat << EOF>>/home/publicuser/.xinitrc
exec openbox-session
EOF

su publicuser -c 'mkdir -p /home/publicuser/.config/openbox'

su publicuser -c 'cat << EOF > /home/publicuser/.config/openbox/autostart
/usr/bin/xset -dpms s off s noblank &
/usr/bin/google-chrome-stable --user-data-dir=/home/publicuser --noerrdialogs --kiosk https://your.site.com/location/ &
/usr/bin/unclutter &
EOF'

echo '@hourly DISPLAY=:0 /home/publicuser/restart.sh' >> /var/spool/cron/publicuser

su publicuser -c 'cat << EOF > /home/publicuser/restart.sh
#!/bin/bash
killall google-chrome-stable
sleep 1
/usr/bin/google-chrome-stable --user-data-dir=/home/publicuser --noerrdialogs --kiosk https://your.site.com/location/ &
EOF'

chmod u+x /home/publicuser/restart.sh

Wifi

[3]

cat << EOF >/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/run/wpa_supplicant
update_config=1
EOF

wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf