AstroArch bridge by sc74 · Pull Request #267 · devDucks/astroarch · GitHub
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
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