#!/bin/bash # This script configures the machines to auto-launch Moonlight streaming on startup. function configureMachine() { # Update everything. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D5AFC5E2A4987676 241FE6973B765FAE apt-get -y update apt-get -y upgrade apt-get -y dist-upgrade apt-get -y autoremove # Tools for us. apt-get -y install mc joe openssh-server # Disable screensaver and blanking. sed -i 's/mode:[[:space:]]*blank/mode: off/' /home/${SUDO_USER}/.xscreensaver cat <<- SCREEN > /home/${SUDO_USER}/.xsessionrc xset -dpms xset s off xset s noblank SCREEN chown ${SUDO_USER}:${SUDO_USER} /home/${SUDO_USER}/.xsessionrc # Set clock to 12 hour format. # Install Moonlight. apt-get -y install flatpak flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak install -y flathub com.moonlight_stream.Moonlight flatpak run com.moonlight_stream.Moonlight quit # This generates the ~/.var/ structure for the config. # Configure Moonlight keys. # Make Moonlight run on startup. :<<-BLARGH if [ -z "$SSH_CLIENT" ] ; then ... fi BLARGH # Reboot! reboot } # All the config is in a function so we can stream this script from forge.duensing.digital. sudo configureMachine