Skip to content

Commit

Permalink
feat: add scripts to autolaunch from xubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
unRARed committed Dec 1, 2024
1 parent f941e58 commit f2b4d4d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .xubuntu/lightdm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Seat:*]
autologin-session=xubuntu
autologin-user=unrared
autologin-user-timeout=0
8 changes: 8 additions & 0 deletions .xubuntu/mpf.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Version=1.0
Name=MPF
Comment=Mission Pinball
Exec=/home/unrared/grand-prix/bin/run
Path=/home/unrared/grand-prix
Terminal=false
Type=Application
20 changes: 20 additions & 0 deletions .xubuntu/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

sudo groupadd -r autologin
sudo gpasswd -a $USER autologin

# To autologin to the Xubuntu Desktop X Server
sudo ln -s $USER/grand-prix/.xubuntu/lightdm.conf \
/etc/lightdm/lightdm.conf

# To launch MPF after starting the X Server
mkdir -p $HOME/.config/autostart
ln -s $HOME/grand-prix/.xubuntu/mpf.desktop \
$HOME/.config/autostart/mpf.desktop

# Prevents a serial error with some hardware
sudo usermod -a -G dialout $USER
# Probably prevents full minute delay when not
# connected to the internet (unconfirmed)
sudo sed -i -e 's/NM_ONLINE_TIMEOUT=60/NM_ONLINE_TIMEOUT=5/g' \
/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service
10 changes: 8 additions & 2 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash

mpf both -c production
# TODO: production config once machine is ready for it
#xterm -e "sleep 5 && cd /home/unrared/grand-prix && mpf both -c production"

# temporary solution to use dev config
# and smart vitual platform
CMD="mpf both -Xtav -c development"
xterm -hold -e "source ~/.bash_profile && cd ~/grand-prix && bash -c '$CMD'"

0 comments on commit f2b4d4d

Please sign in to comment.