I'm a big fan of LibreELEC, a fork of OpenELEC both of which are intended to be Just Enough OS (JEOS) for Kodi, the media center formerly known as XBMC. I'm also a fan of games, retro emulated and new and current ones from Steam. I've been trying to find the magic bullet that will bring those three things together into one interface, as much as possible.
To that end I've messed about with GamerOS (but there is no automounting so no network drives are seen and no USB drives can be mounted) and its version of Kodi is launchable within Steam but it doesn't meet my needs since everything I wish to watch is stored on an external drive. Also the operating system does not play well with anything else. I've also looked into extending LibreELEC to see if I can get games from within their JEOS Kodi. Also not something that seems to be exactly what I need due to the lack of a good way of getting Steam to install.
I was on the LibreELEC forums when one of the users posted an installer script that they said would use a base install from the mini.iso to add RetroPie for emulation, install Kodi for media, add Steam, and use Pegasus-Frontend to manage everything in one interface. What I saw looked good to me so I hunted down the mini.iso for 20.04 LTS and saved the script. I installed the mini.iso base command line system without issue.
I chmod +x the script and ran it. It seemed to be working, a lost of stuff installed and I spent a long while as it downloaded and compiled RetroPie and installed it. Then an error hit. I tried again because the error at first appeared to be a network issue and it died at the same place again.
I asked in the unofficial Discord and got some tips and fixed the first thing only to have it hit a second thing. At this point I'd really like to make this work but I think it's above my knowledge level and I need someone to take a look at the script and see what can be fixed, because I am not a programmer and I literally don't know what is wrong.
#! /bin/bash
#this setup script is brought to you by Northbane (c) 2020
#it is known to be very crude and simple
#IMPORTANT: only run it once! or it will most likely fubar your os
#need to install deps for RetroPie and PegasusFE
sudo apt install menu python-xdg at-spi2-core pulseaudio alsa-utils libglib2.0-bin dbus-x11 triggerhappy git dialog unzip xmlstarlet x11-xserver-utils gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-plugins-good jq policykit-1 curl xdg-utils -y
#manually install basic package in RetroPie or it wont work
cd ~
git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
cd RetroPie-Setup
sudo ./retropie_setup.sh
#installing drivers if needed + openbox & lightdm
sudo apt install ubuntu-drivers-common software-properties-common curl lightdm openbox
sudo ubuntu-drivers autoinstall
#disabling power saving mode
#echo "#turn off screen saver and power saving" >> ~/.profile
#echo "xset s off && xset -dpms" >> ~/.profile
sed -i '1 i\xset s off && xset -dpms' ~/.xsession
#add USB automount
#git clone https://github.com/rbrito/usbmount
#sudo apt install debhelper build-essential lockfile-progs
#cd usbmount
#dpkg-buildpackage -us -uc -b
#cd ~ && sudo dpkg -i usbmount*.deb
#create autologin for current user / deprecated?
#if [ ! -e "/etc/lightdm/lightdm.conf" ]; then
#echo "[SeatDefaults]" >> ~/lightdm.conf
#echo "autologin-user=$USER" >> ~/lightdm.conf
#echo "autologin-user-timeout=0" >> ~/lightdm.conf
#echo "user-session=openbox" >> ~/lightdm.conf
#sudo mv ~/lightdm.conf /etc/lightdm/
#fi
#install pegasus fe / do this again from within retropie setup / experimental packages if scraped videos aren't working
curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.bintray.com/mmatyas/deb testing main'
sudo apt update
sudo apt install pegasus-frontend
# Start X as soon as autologin is complete
function enable_autostart_xwindows() {
echo "--------------------------------------------------------------------------------"
echo "| Enabling autostart of X Windows"
echo "--------------------------------------------------------------------------------"
# Create a .xsession file to launch OpenBox when startx is called
echo 'exec openbox-session' >> ~/.xsession
chown $USER:$USER ~/.xsession
# Add startx to .bash_profile
cat << EOF >> ~/.bash_profile
if [[ -z \$DISPLAY ]] && [[ \$(tty) = /dev/tty1 ]]; then
exec startx -- >/dev/null 2>&1
fi
EOF
chown $USER:$USER ~/.bash_profile
echo -e "FINISHED enable_autostart_xwindows \n\n"
sleep 2
}
#remove password from user sudoers.
#if grep -q "$USER ALL=(ALL) NOPASSWD:ALL" "/etc/sudoers"; then
sudo sed -i -e '$a\$USER ALL=(ALL) NOPASSWD:ALL' /etc/sudoers
#remove user from sudo
sudo gpasswd -d $USER sudo
#set up custom plymouth:
cd ~
sudo apt-get install plymouth plymouth-themes plymouth-x11 -y
git clone --depth=1 https://github.com/HerbFargus/plymouth-themes.git tempthemes
sudo cp -r ~/tempthemes/. /usr/share/plymouth/themes/
rm -r -f tempthemes
sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/retropie-pacman/retropie-pacman.plymouth 10
sudo update-alternatives --set default.plymouth /usr/share/plymouth/themes/retropie-pacman/retropie-pacman.plymouth
sudo update-initramfs -u
sudo cp /etc/default/grub /etc/default/grub.backup
sudo sed -i -e 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=2/g' /etc/default/grub
sudo sed -i -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="quiet splash"/g' /etc/default/grub
sudo update-grub
# Hide Openbox Windows and reduce visibility of terminal
function hide_openbox_windows() {
echo "--------------------------------------------------------------------------------"
echo "| Hiding window decorations in OpenBox"
echo "--------------------------------------------------------------------------------"
# Reduce the visibility of the gnome terminal by prepending these settings in the bash profile
GNOME_TERMINAL_SETTINGS='dbus-launch gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/'
cat << EOF >> ~/.bash_profile
$GNOME_TERMINAL_SETTINGS use-theme-colors false
$GNOME_TERMINAL_SETTINGS use-theme-transparency false
$GNOME_TERMINAL_SETTINGS foreground-color '#FFFFFF'
$GNOME_TERMINAL_SETTINGS background-color '#000000'
$GNOME_TERMINAL_SETTINGS cursor-blink-mode 'off'
$GNOME_TERMINAL_SETTINGS scrollbar-policy 'never'
$GNOME_TERMINAL_SETTINGS audible-bell 'false'
gsettings set org.gnome.Terminal.Legacy.Settings default-show-menubar false
EOF
chown $USER:$USER ~/.bash_profile
# Further reduce the visibility of windows (terminal) by modifying the OpenBox config
mkdir -p ~/.config/openbox
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml
cat << EOF > /tmp/rc.xml.applications
<application class="*">
<fullscreen>yes</fullscreen>
<iconic>no</iconic>
<layer>below</layer>
<decor>no</decor>
<maximized>true</maximized>
</application>
EOF
sed -i '/<applications>/r /tmp/rc.xml.applications' ~/.config/openbox/rc.xml
rm /tmp/rc.xml.applications
sed -e 's/<keepBorder>yes<\/keepBorder>/<keepBorder>no<\/keepBorder>/g' -i ~/.config/openbox/rc.xml
chown -R $USER:$USER ~/.config
echo -e "FINISHED hide_openbox_xwindows \n\n"
sleep 2
}
# OpenBox autostarts unclutter, then passes off to the RetroPie autostart
mkdir -p ~/.config/openbox
echo 'unclutter -idle 0.01 -root' >> ~/.config/openbox/autostart
echo '/opt/retropie/configs/all/autostart.sh' >> ~/.config/openbox/autostart
chown -R $USER:$USER ~/.config
# Create RetroPie autostart
mkdir -p /opt/retropie/configs/all
touch /opt/retropie/configs/all/autostart.sh
chmod +x /opt/retropie/configs/all/autostart.sh
chown -R $USER:$USER /opt/retropie/configs
#create openbox autostart script for pegasus, which will start again if exited
echo "#!/bin/bash" >> ~/pegasus.sh
echo "while true; do" >> ~/pegasus.sh
echo "pegasus-fe" >> ~/pegasus.sh
echo "done" >> ~/pegasus.sh
chmod +x ~/pegasus.sh
echo 'gnome-terminal --full-screen --hide-menubar -- ~/pegasus.sh' >> /opt/retropie/configs/all/autostart.sh
#install kodi with rar support, user interaction required
echo Installing Kodi (with RAR support), please wait
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install kodi kodi-vfs-rar
mkdir ~/RetroPie/roms/ports
echo "kodi-standalone" >> ~/RetroPie/roms/ports/Kodi.sh
chmod +x ~/RetroPie/roms/ports/Kodi.sh
#install Steam
echo Installing Steam, please wait
sudo apt-get install steam
echo "steam" >> ~/RetroPie/roms/ports/Steam.sh
chmod +x ~/RetroPie/roms/ports/Steam.sh
#installing requirements for Overcooked2
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade libstdc++6
#change audio to hdmi pulseaudio
sudo sed -i -e 's/set-default-sink output/set-default-sink output alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1/g' /etc/pulse/default.pa
#tips for retroarch
echo "dont forget to edit retroarch with start pressed for 2 secs to enter menu"
echo ""
#tips on getting audio to work check https://wiki.archlinux.org/index.php/PulseAudio/Examples for more info
echo "do pacmd list-sinks | grep -e 'name:' -e 'index:'"
echo "and ucomment the last line and set something like set-default-sink output alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1"
echo ""
echo ALL DONE!
I sourced the script from here. That poster said they preferred the Ubuntu 18.04 LTS mini.iso over the one from 20.04 LTS. Could that be my issue I am encountering?
I typed out the error messages from the second install as:
E: Failed to fetch https://dl.bintray.com/mmatyas/deb/dists/testing/InRelease 403 Forbidden [IP: 43.213.218.48 443]
E: The repository 'https://dl.bintray.com/mmatyas/deb testing InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pegasus-frontend
retropie_installer.sh: 49: Syntax error: "(" unexpected
I discovered in the last attempt that there was a brownout for the server i question and is apparently fixed but when I removed the "()" in the script and was able to get further other issues came up that I did not capture last night being incredibly tired. What i noticed also is that this installer seems to get dependencies that somehow pulls in the Gnome Desktop. Is there any way to avoid this or prefer Mate where it currently grabs Gnome? I really don't even know why it's pulling Gnome at all because the eventual goal is to use openbox for what minimal desktop is needed.
Also an unfortunate side effect of the script results in my working WiFi stopping to work and no longer seeing any hotspots when prior to the install, the base command line system was working just fine with the WiFI. Not really sure why or how that is.
Thank you for reading this small book I've posted. I dearly hope that someone can help me accomplish what I'm trying to do here. Any assistance is appreciated!
EDIT: Just completed a try with the script as listed above and using the mini.iso for Ubuntu 18.04 LTS and can confirm that it makes no difference at all. It's something in the way the script is written that keeps tripping me up. Would dearly appreciate it if someone could read over and post an edit which will work. Seems to be a lot of syntax errors... Thanks in advance.