Skip to content

Commit

Permalink
Make gui module use /opt/custompios/scripts #218 guysoft/FullPageOS#525
Browse files Browse the repository at this point in the history
  • Loading branch information
guysoft committed Mar 23, 2024
1 parent 0f89a3d commit b139469
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/modules/gui/end_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ install_cleanup_trap

#set up gui service
sed -i 's/#user-session=.*/user-session=guisession/g' /etc/lightdm/lightdm.conf
sed -i 's/#autologin-user=.*/autologin-user=pi/g' /etc/lightdm/lightdm.conf
# This is now down as a systemd service to handle username conf on boot
sed -i 's/#autologin-user=.*/autologin-user=UID_1000_PLACEHOLDER/g' /etc/lightdm/lightdm.conf
systemctl enable update_lightdm_conf.service

# set the gui to run the main script of the GUI session
sed -i "s@GUI_SESSION_PLACEHOLDEFR@${GUI_STARTUP_SCRIPT}@g" /home/pi/scripts/start_gui
sed -i "s@GUI_SESSION_PLACEHOLDEFR@${GUI_STARTUP_SCRIPT}@g" /opt/custompios/scripts/start_gui

rm -r /usr/sbin/policy-rc.d || true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
if [ ! -f /etc/gpu_enabled ]; then
sudo sed 's@matchbox-window-manager \&@compton -b -d :0 --backend glx --unredir-if-possible --glx-swap-method buffer-age --glx-no-stencil --paint-on-overlay --vsync opengl \nmatchbox-window-manager \&@g' -i /home/pi/scripts/start_gui
sudo sed 's@matchbox-window-manager \&@compton -b -d :0 --backend glx --unredir-if-possible --glx-swap-method buffer-age --glx-no-stencil --paint-on-overlay --vsync opengl \nmatchbox-window-manager \&@g' -i /opt/custompios/scripts/scripts/start_gui
sudo sed -i /boot/firmware/cmdline.txt -e "s/ quiet//"
sudo sed -i /boot/firmware/cmdline.txt -e "s/ splash//"
sudo sed -i /boot/firmware/cmdline.txt -e "s/ plymouth.ignore-serial-consoles//"
Expand Down
6 changes: 6 additions & 0 deletions src/modules/gui/filesystem/opt/scripts/update_lightdm_conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ ! -f /etc/updated_lightdm_conf ]; then
sed -i 's/UID_1000_PLACEHOLDER/'$(id -nu 1000)'/g' /etc/lightdm/lightdm.conf
touch /etc/updated_lightdm_conf
# sudo shutdown -r now
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Unit]
Description=on first boot set up GPU acceleration
[Service]
ExecStart=/home/pi/scripts/enable_gpu
ExecStart=/opt/custompios/scripts/enable_gpu
ExecStop=
[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=on first boot set up GPU acceleration
[Service]
ExecStart=/opt/custompios/scripts/update_lightdm_conf
ExecStop=
[Install]
# WantedBy=multi-user.target
RequiredBy=graphical.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Version=1.0
Name=GUISession
Exec=/home/pi/scripts/start_gui
Exec=/opt/custompios/scripts/start_gui
Comment=Startup of the minimal CustomPiOS GUI
Type=Application
4 changes: 3 additions & 1 deletion src/modules/gui/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ set -e

source /common.sh

unpack /filesystem/home/pi /home/pi pi
unpack /filesystem/opt /opt/custompios pi
unpack /filesystem/root_init /

ln -s /opt/custompios/scripts /home/pi/scripts

echo exit 101 > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d

Expand Down

0 comments on commit b139469

Please sign in to comment.