Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielleevandenbosch/676fd908299c14449faf35143460c338 to your computer and use it in GitHub Desktop.
Save danielleevandenbosch/676fd908299c14449faf35143460c338 to your computer and use it in GitHub Desktop.
raspi_webpage_viewer

OS: RaspberryPI Lite (But I think something like Ubuntu server would work as well) users dvandenbosch (sudoer) gui (non sudoer)

install dotfiles (This is for Dan Van Den Bosch own sanity) (Not required) https://github.com/danielleevandenbosch/dotfiles

Setup Autologin

create this file as root /etc/systemd/system/getty@tty1.service.d/autologin.conf with the following content:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin gui --noclear %I $TERM

then run this sudo systemctl daemon-reload sudo apt-get update

sudo apt-get install xorg

sudo su - gui

Initial startx

create this file under the gui account ~/.bash_profile With the following content: (I have not tested this using bash)

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
    startx
fi

if you are using zsh, create this file under the gui account ~/.zlogin With the following content

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
    startx
fi

run startx run xrandr --output HDMI-1 --mode 1920x1080 --output HDMI-2 --mode 1920x1080 --same-as HDMI-1

apt install chromium-browser

set up .xinitrc

create this file under the gui account ~/.xinitrc This seemed to work from me after playing around with the settings.

xset s off -dpms & 
unclutter -idle 300 & 
xrandr --output "HDMI-1" --auto --output "HDMI-2" --same-as "HDMI-1" &
sleep 5
chromium-browser --start-fullscreen --disable-session-crashed-bubble --disable-infobars --incognito http://10.20.0.219/

troubleshooting

You might need to delete the ~/.config/chromium settings if it is not full screening.

Duplicate the screens (Optional)

xrandr xrandr --output "HDMI-1" --auto --output "HDMI-2" --same-as "HDMI-1" seems to work too

I have had some luck with this method, but honestly the xrandr seems to work better... idk. feel free to try. sudo vim /etc/X11/xorg.conf.d/10-monitor.conf

If the path does not exist, create it.

Section "Monitor"
    Identifier "Monitor0"
EndSection

Section "Monitor"
    Identifier "Monitor1"
    Option "RightOf" "Monitor0"
EndSection

Section "Device"
    Identifier "Device0"
    Driver "modesetting"
    Option "Monitor-HDMI-1" "Monitor0"
    Option "Monitor-HDMI-2" "Monitor1"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080"
        Virtual 3840 1080
    EndSubSection
EndSection

Screens turning off issue

you might need to edit the following in boot: sudo vim /boot/firmware/config.txt or sudo vim /boot/config.txt

disable_overscan=1
hdmi_force_hotplug=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment