Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions astroarch_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ else
qt6-serialport qt6ct udisks2 xorg-fonts-misc fuse2 \
fortune-mod cowsay pacman-contrib arandr neofetch \
astromonitor kscreen sddm-kcm flatpak plasma-x11-session \
kdialog jq astroarch-onboarding dhcpcd iw rsync xrdp xorgxrdp fakeroot --noconfirm --ask 4
kdialog jq astroarch-onboarding dhcpcd iw rsync xrdp xorgxrdp astroarch-bridge --noconfirm --ask 4
fi


Expand Down Expand Up @@ -153,9 +153,6 @@ cp /home/astronaut/.astroarch/configs/81-wifi-powersave.rules /etc/udev/rules.d/
# Udev rule to force the brcmfmac driver to keep the name “wlan0” for Wi-Fi
cp /home/astronaut/.astroarch/configs/99-brcmfmac.rules /etc/udev/rules.d/99-brcmfmac.rules

# Copy the GPIO ownership rule to get access to the GPIO as any user
cp /home/astronaut/.astroarch/configs/99-arch-gpio.rules /etc/udev/rules.d/99-arch-gpio.rules

# Polkit rules go here
cp /home/astronaut/.astroarch/configs/99-polkit-power.rules /etc/polkit-1/rules.d/
cp /home/astronaut/.astroarch/configs/50-udiskie.rules /etc/polkit-1/rules.d/
Expand Down Expand Up @@ -194,16 +191,16 @@ chmod 755 /etc/xrdp/key.pem
sed -i 's|#tcp_send_buffer_bytes=32768|tcp_send_buffer_bytes= 4194304|g' /etc/xrdp/xrdp.ini

# Prevents XRDP from creating a second virtual desktop for the same user
sudo sed -i 's/^Policy=.*/Policy=UHQ/' /etc/xrdp/sesman.ini
sudo sed -i '/^\[Xorg\]/a fork=true' /etc/xrdp/xrdp.ini
sed -i 's/^Policy=.*/Policy=UHQ/' /etc/xrdp/sesman.ini
sed -i '/^\[Xorg\]/a fork=true' /etc/xrdp/xrdp.ini

# Disables the display's power management features
sed -i 's/Option "DPMS"/& "false"/' /etc/X11/xrdp/xorg.conf

# Disabling compression can speed up local connections on low-power devices
sed -i 's|bitmap_compression=true|bitmap_compression=false|g' /etc/xrdp/xrdp.ini
sed -i 's|bulk_compression=true|bulk_compression=false|g' /etc/xrdp/xrdp.ini
sudo awk '1; /^tcp_keepalive=true$/ {print "\n; Turn off compression\nrfx_codec=false\njpeg_codec=false"}' /etc/xrdp/xrdp.ini > /tmp/xrdp.ini.tmp && sudo mv /tmp/xrdp.ini.tmp /etc/xrdp/xrdp.ini
awk '1; /^tcp_keepalive=true$/ {print "\n; Turn off compression\nrfx_codec=false\njpeg_codec=false"}' /etc/xrdp/xrdp.ini > /tmp/xrdp.ini.tmp && sudo mv /tmp/xrdp.ini.tmp /etc/xrdp/xrdp.ini

# Improve xrdp & network
cp /home/astronaut/.astroarch/configs/99-sysctl.conf /etc/sysctl.d
Expand Down Expand Up @@ -336,6 +333,11 @@ chmod -R 770 /home/astronaut
# Copy the screensaver config, by default it is off
su astronaut-kiosk -c "cp /home/astronaut/.astroarch/configs/kscreenlockerrc /home/astronaut-kiosk/.config/kscreenlockerrc"

# Pre-launch of the Kiosk session
sed -i '1s/^/auth sufficient pam_succeed_if.so user = astronaut-kiosk\n/' /etc/pam.d/xrdp-sesman
cp /home/astronaut/.astroarch/systemd/xrdp-autostart-kiosk.service /etc/systemd/system/xrdp-autostart-kiosk.service
ln -s /etc/systemd/system/xrdp-autostart-kiosk.service /etc/systemd/system/multi-user.target.wants/xrdp-autostart-kiosk.service

# Disable Kwallet by default
su astronaut -c "echo $'[Wallet]\nEnabled=false' > /home/astronaut/.config/kwalletrc"

Expand Down
55 changes: 55 additions & 0 deletions plugins/astroarch-bridge/astroarch-bridge.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
function _check_astroarch-bridge_installed()
{
if pacman -Qs 'astroarch-bridge' > /dev/null ; then
echo "✅ astroarch-bridge packages are already installed"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "✅ astroarch-bridge packages are already installed"
else
echo "📦 astroarch-brige packages not installed, installing them now..."
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "📦 astroarch-bridge packages not installed, installing them now..."
yes | LC_ALL=en_US.UTF-8 sudo pacman -S astroarch-bridge
echo "✅ astroarch-bridge packages installed!"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "✅ astroarch-bridge packages installed!"
fi
}

function astroarch-bridge_astronaut_on()
{
_check_astroarch-bridge_installed
mkdir -p /home/astronaut/.config/systemd/user/default.target.wants
ln -sf /usr/lib/systemd/user/astroarch-bridge.service \
"/home/astronaut/.config/systemd/user/default.target.wants/astroarch-bridge.service"
echo "🎉 astroarch-bridge will be active after the next reboot"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "🎉 astroarch-bridge will be active after the next reboot"
}

function astroarch-bridge_astronaut_off()
{
rm -f /home/astronaut/.config/systemd/user/default.target.wants/astroarch-bridge.service
echo "🛑 astroarch-bridge disabled. Remember to re-enable it if you want it to start automatically at boot"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "🛑 astroarch-bridge disabled. Remember to re-enable it if you want it to start automatically at boot"
}

function astroarch-bridge_astronaut-kiosk_on()
{
_check_astroarch-bridge_installed
su astronaut-kiosk -c "mkdir -p /home/astronaut-kiosk/.config/systemd/user/default.target.wants && \
ln -sf /usr/lib/systemd/user/astroarch-bridge.service /home/astronaut-kiosk/.config/systemd/user/default.target.wants/astroarch-bridge.service"
echo "🎉 astroarch-bridge will be active after the next reboot"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "🎉 astroarch-bridge will be active after the next reboot"
}

function astroarch-bridge_astronaut-kiosk_off()
{
su astronaut-kiosk -c "rm -f /home/astronaut-kiosk/.config/systemd/user/default.target.wants/astroarch-bridge.service"
echo "🛑 astroarch-bridge disabled. Remember to re-enable it if you want it to start automatically at boot"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "🛑 astroarch-bridge disabled. Remember to re-enable it if you want it to start automatically at boot"
}

function astroarch-bridge_remove()
{
rm -f /home/astronaut/.config/systemd/user/default.target.wants/astroarch-bridge.service
su astronaut-kiosk -c "rm -f /home/astronaut-kiosk/.config/systemd/user/default.target.wants/astroarch-bridge.service"
yes | LC_ALL=en_US.UTF-8 sudo pacman -Rcs astroarch-bridge
echo "🗑️ astroarch-bridge remove"
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'astroarch-bridge' "🗑️ astroarch-bridge remove"
}
13 changes: 13 additions & 0 deletions scripts/2.0.10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Invoke 2.0.9
bash /home/astronaut/.astroarch/scripts/2.0.9.sh

# Install astroarch-bridge for the astronaut and astronaut-kiosk users
sudo pacman -Sy astroarch-bridge --noconfirm

# Pre-launch of the Kiosk session
sudo sed -i '1s/^/auth sufficient pam_succeed_if.so user = astronaut-kiosk\n/' /etc/pam.d/xrdp-sesman
sudo cp -f /home/astronaut/.astroarch/systemd/xrdp-autostart-kiosk.service /etc/systemd/system/xrdp-autostart-kiosk.service
sudo ln -sf /etc/systemd/system/xrdp-autostart-kiosk.service /etc/systemd/system/multi-user.target.wants/xrdp-autostart-kiosk.service
sudo systemctl enable xrdp-autostart-kiosk.service
7 changes: 7 additions & 0 deletions scripts/prelaunch-kiosk-session.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# /usr/local/bin/prelaunch-kiosk-session.sh
#!/usr/bin/expect -f

spawn /usr/bin/xrdp-sesrun astronaut-kiosk
expect "Password:"
send "\r"
expect eof
14 changes: 14 additions & 0 deletions systemd/xrdp-autostart-kiosk.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# /etc/systemd/system/prelaunch-kiosk-session.service
[Unit]
Description=Pre-launch xrdp session for astronaut-kiosk
After=xrdp-sesman.service xrdp.service
Wants=xrdp-sesman.service xrdp.service

[Service]
Type=oneshot
ExecStart=/home/astronaut/.astroarch/scripts/prelaunch-kiosk-session.sh
RemainAfterExit=yes
User=root

[Install]
WantedBy=multi-user.target