From 276ab2a723d11b662b063d743a85a56f93c5b0f7 Mon Sep 17 00:00:00 2001 From: sc74 Date: Tue, 2 Jun 2026 17:39:15 +0200 Subject: [PATCH 1/5] Add tk and python-qr to the astroarch-bridge PKGBUILD and remove fakeroot since base-devel is already included in astroarch_build.sh --- astroarch_build.sh | 52 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/astroarch_build.sh b/astroarch_build.sh index b78c125..c5be564 100644 --- a/astroarch_build.sh +++ b/astroarch_build.sh @@ -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 @@ -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/ @@ -194,8 +191,8 @@ 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 @@ -203,7 +200,7 @@ 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 @@ -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" @@ -346,6 +348,42 @@ bash -c "echo \"options brcmfmac feature_disable=0x282000\" > /etc/modprobe.d/br chmod 755 /home/astronaut/.astroarch chmod 755 /home/astronaut/.oh-my-zsh +# Install astroarch-bridge for the astronaut and astronaut-kiosk users +USERS=("astronaut" "astronaut-kiosk") +PORTS=("8765" "8766") +configure_user() { + local USERNAME=$1 + local PORT=$2 + if ! id "$USERNAME" &>/dev/null; then + return + fi + # 1. Folders + sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/.config/astroarch-bridge" + sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/Pictures/Ekos" + # 2. Linger + mkdir -p /var/lib/systemd/linger && \ + touch /var/lib/systemd/linger/${USERNAME} + # 3. Network port + DROPIN_DIR="/home/$USERNAME/.config/systemd/user/astroarch-bridge.service.d" + sudo -u "$USERNAME" mkdir -p "$DROPIN_DIR" + cat < /dev/null +[Service] +Environment=ASTROARCH_PORT=$PORT +EOF + # 4. Desktop shortcut + ln -sf /usr/share/astroarch-bridge/desktop_dashboard/AstroarchBridge.desktop \ + "/home/$USERNAME/Desktop/AstroarchBridge.desktop" + # 5. Services + UNIT_DIR="/home/${USERNAME}/.config/systemd/user" + WANTS_DIR="${UNIT_DIR}/default.target.wants" + mkdir -p "$WANTS_DIR" + ln -sf "${UNIT_DIR}/astroarch-bridge.service" \ + "${WANTS_DIR}/astroarch-bridge.service" +} +for i in "${!USERS[@]}"; do + configure_user "${USERS[$i]}" "${PORTS[$i]}" +done + # Override cmdline.txt echo "root=UUID=$(blkid -s UUID -o value /dev/vda2) rw rootwait console=tty1 fsck.repair=yes video=HDMI-A-1:1920x1080M@60D" > /boot/cmdline.txt From e6c26d80759a52aa7612452d3cdc7d47e463edfc Mon Sep 17 00:00:00 2001 From: sc74 Date: Tue, 2 Jun 2026 17:53:16 +0200 Subject: [PATCH 2/5] Add astroarch-bridge --- scripts/2.0.10.sh | 72 ++++++++++++++++++++++++++++ scripts/prelaunch-kiosk-session.sh | 7 +++ systemd/xrdp-autostart-kiosk.service | 14 ++++++ 3 files changed, 93 insertions(+) create mode 100644 scripts/2.0.10.sh create mode 100755 scripts/prelaunch-kiosk-session.sh create mode 100644 systemd/xrdp-autostart-kiosk.service diff --git a/scripts/2.0.10.sh b/scripts/2.0.10.sh new file mode 100644 index 0000000..7815670 --- /dev/null +++ b/scripts/2.0.10.sh @@ -0,0 +1,72 @@ +#!/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 + +USERS=("astronaut" "astronaut-kiosk") +PORTS=("8765" "8766") + +configure_user() { + local USERNAME=$1 + local PORT=$2 + + if ! id "$USERNAME" &>/dev/null; then + return + fi + + # 1. Folders + sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/.config/astroarch-bridge" + sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/Pictures/Ekos" + + # 2. Linger + loginctl enable-linger "$USERNAME" + + # 3. Network port + DROPIN_DIR="/home/$USERNAME/.config/systemd/user/astroarch-bridge.service.d" + sudo -u "$USERNAME" mkdir -p "$DROPIN_DIR" + cat < /dev/null +[Service] +Environment=ASTROARCH_PORT=$PORT +EOF + + # 4. Desktop shortcut + ln -sf /usr/share/astroarch-bridge/desktop_dashboard/AstroarchBridge.desktop \ + "/home/$USERNAME/Desktop/AstroarchBridge.desktop" + + # 5. Enable via symlink (works without active session / chroot) + local UID_NUM + UID_NUM=$(id -u "$USERNAME") + local WANTS_DIR="/home/$USERNAME/.config/systemd/user/default.target.wants" + sudo -u "$USERNAME" mkdir -p "$WANTS_DIR" + sudo -u "$USERNAME" ln -sf \ + /usr/lib/systemd/user/astroarch-bridge.service \ + "$WANTS_DIR/astroarch-bridge.service" + + # 6. Reload & start only if the user D-Bus socket is reachable + local BUS_SOCKET="/run/user/${UID_NUM}/bus" + if [ -S "$BUS_SOCKET" ]; then + sudo -u "$USERNAME" \ + XDG_RUNTIME_DIR="/run/user/${UID_NUM}" \ + DBUS_SESSION_BUS_ADDRESS="unix:path=${BUS_SOCKET}" \ + systemctl --user daemon-reload + sudo -u "$USERNAME" \ + XDG_RUNTIME_DIR="/run/user/${UID_NUM}" \ + DBUS_SESSION_BUS_ADDRESS="unix:path=${BUS_SOCKET}" \ + systemctl --user start astroarch-bridge.service + else + echo "[INFO] Session D-Bus not available for $USERNAME — service will start at next login (linger enabled)" + fi +} + +for i in "${!USERS[@]}"; do + configure_user "${USERS[$i]}" "${PORTS[$i]}" +done + +# 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 diff --git a/scripts/prelaunch-kiosk-session.sh b/scripts/prelaunch-kiosk-session.sh new file mode 100755 index 0000000..12cf560 --- /dev/null +++ b/scripts/prelaunch-kiosk-session.sh @@ -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 diff --git a/systemd/xrdp-autostart-kiosk.service b/systemd/xrdp-autostart-kiosk.service new file mode 100644 index 0000000..5910a1e --- /dev/null +++ b/systemd/xrdp-autostart-kiosk.service @@ -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 From 2d600ca061a88735921a99b0c5acc9d4382250ed Mon Sep 17 00:00:00 2001 From: sc74 Date: Tue, 2 Jun 2026 18:45:51 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Deleting=20=E2=80=98Install=20astroarch-bri?= =?UTF-8?q?dge=E2=80=99=20from=20astroarch=5Fbuild.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astroarch_build.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/astroarch_build.sh b/astroarch_build.sh index c5be564..fed9bbc 100644 --- a/astroarch_build.sh +++ b/astroarch_build.sh @@ -348,42 +348,6 @@ bash -c "echo \"options brcmfmac feature_disable=0x282000\" > /etc/modprobe.d/br chmod 755 /home/astronaut/.astroarch chmod 755 /home/astronaut/.oh-my-zsh -# Install astroarch-bridge for the astronaut and astronaut-kiosk users -USERS=("astronaut" "astronaut-kiosk") -PORTS=("8765" "8766") -configure_user() { - local USERNAME=$1 - local PORT=$2 - if ! id "$USERNAME" &>/dev/null; then - return - fi - # 1. Folders - sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/.config/astroarch-bridge" - sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/Pictures/Ekos" - # 2. Linger - mkdir -p /var/lib/systemd/linger && \ - touch /var/lib/systemd/linger/${USERNAME} - # 3. Network port - DROPIN_DIR="/home/$USERNAME/.config/systemd/user/astroarch-bridge.service.d" - sudo -u "$USERNAME" mkdir -p "$DROPIN_DIR" - cat < /dev/null -[Service] -Environment=ASTROARCH_PORT=$PORT -EOF - # 4. Desktop shortcut - ln -sf /usr/share/astroarch-bridge/desktop_dashboard/AstroarchBridge.desktop \ - "/home/$USERNAME/Desktop/AstroarchBridge.desktop" - # 5. Services - UNIT_DIR="/home/${USERNAME}/.config/systemd/user" - WANTS_DIR="${UNIT_DIR}/default.target.wants" - mkdir -p "$WANTS_DIR" - ln -sf "${UNIT_DIR}/astroarch-bridge.service" \ - "${WANTS_DIR}/astroarch-bridge.service" -} -for i in "${!USERS[@]}"; do - configure_user "${USERS[$i]}" "${PORTS[$i]}" -done - # Override cmdline.txt echo "root=UUID=$(blkid -s UUID -o value /dev/vda2) rw rootwait console=tty1 fsck.repair=yes video=HDMI-A-1:1920x1080M@60D" > /boot/cmdline.txt From cae4667d7a169625ee8f77b8b62daa1ea99dd4ce Mon Sep 17 00:00:00 2001 From: sc74 Date: Tue, 2 Jun 2026 18:52:02 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Deleting=20=E2=80=98Install=20astroarch-bri?= =?UTF-8?q?dge=E2=80=99=20from=20script=202.0.10.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/2.0.10.sh | 59 ----------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/scripts/2.0.10.sh b/scripts/2.0.10.sh index 7815670..f02cd63 100644 --- a/scripts/2.0.10.sh +++ b/scripts/2.0.10.sh @@ -6,65 +6,6 @@ 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 -USERS=("astronaut" "astronaut-kiosk") -PORTS=("8765" "8766") - -configure_user() { - local USERNAME=$1 - local PORT=$2 - - if ! id "$USERNAME" &>/dev/null; then - return - fi - - # 1. Folders - sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/.config/astroarch-bridge" - sudo -u "$USERNAME" mkdir -p "/home/$USERNAME/Pictures/Ekos" - - # 2. Linger - loginctl enable-linger "$USERNAME" - - # 3. Network port - DROPIN_DIR="/home/$USERNAME/.config/systemd/user/astroarch-bridge.service.d" - sudo -u "$USERNAME" mkdir -p "$DROPIN_DIR" - cat < /dev/null -[Service] -Environment=ASTROARCH_PORT=$PORT -EOF - - # 4. Desktop shortcut - ln -sf /usr/share/astroarch-bridge/desktop_dashboard/AstroarchBridge.desktop \ - "/home/$USERNAME/Desktop/AstroarchBridge.desktop" - - # 5. Enable via symlink (works without active session / chroot) - local UID_NUM - UID_NUM=$(id -u "$USERNAME") - local WANTS_DIR="/home/$USERNAME/.config/systemd/user/default.target.wants" - sudo -u "$USERNAME" mkdir -p "$WANTS_DIR" - sudo -u "$USERNAME" ln -sf \ - /usr/lib/systemd/user/astroarch-bridge.service \ - "$WANTS_DIR/astroarch-bridge.service" - - # 6. Reload & start only if the user D-Bus socket is reachable - local BUS_SOCKET="/run/user/${UID_NUM}/bus" - if [ -S "$BUS_SOCKET" ]; then - sudo -u "$USERNAME" \ - XDG_RUNTIME_DIR="/run/user/${UID_NUM}" \ - DBUS_SESSION_BUS_ADDRESS="unix:path=${BUS_SOCKET}" \ - systemctl --user daemon-reload - sudo -u "$USERNAME" \ - XDG_RUNTIME_DIR="/run/user/${UID_NUM}" \ - DBUS_SESSION_BUS_ADDRESS="unix:path=${BUS_SOCKET}" \ - systemctl --user start astroarch-bridge.service - else - echo "[INFO] Session D-Bus not available for $USERNAME — service will start at next login (linger enabled)" - fi -} - -for i in "${!USERS[@]}"; do - configure_user "${USERS[$i]}" "${PORTS[$i]}" -done - # 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 From 69f639446a923b6674775b5f96409c9b7a18d95e Mon Sep 17 00:00:00 2001 From: sc74 Date: Wed, 10 Jun 2026 20:38:20 +0200 Subject: [PATCH 5/5] New zsh plugin for astroarch-bridge --- .../astroarch-bridge.plugin.zsh | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/astroarch-bridge/astroarch-bridge.plugin.zsh diff --git a/plugins/astroarch-bridge/astroarch-bridge.plugin.zsh b/plugins/astroarch-bridge/astroarch-bridge.plugin.zsh new file mode 100644 index 0000000..cc998b4 --- /dev/null +++ b/plugins/astroarch-bridge/astroarch-bridge.plugin.zsh @@ -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" +}