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
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ Please find below some (hopefully) useful instructions, if you are here instead
- [What are the passwords for the user and the hotspot?](#passwords)
- [Protect VNC with a password](#how-to-protect-vnc-with-password)
- [Useful commands](#useful-commands)
- [System Backup and Restore](#Backup-and-Restore)
- [List of available software](#software-available)
- [How can I add a RTC to AstroArch?](#how-to-add-a-rtc)
- [How to make a GPS dongle working?](#using-a-gps-dongle)
- [How to enable bluetooth?](#how-to-enable-bluetooth)
- [How to enable an FTP server?](#how-to-enable-ftp)
- [Where can I find more packages?](#where-to-find-more-pacakges)
- [How can I install Python packages?](#how-to-install-python-packages)
- [Use the kiosk session](#kiosk-session)
- [reporting problems](#reporting-issues)
- [For PC/mini PC running an ArchLinux derived distro (Manjaro, ArcoLinux, etc.)](#use-only-the-astro-packages-mantained-for-astroarch-on-pc-and-mini-pc)
- [Tips](#tips)
Expand Down Expand Up @@ -143,6 +145,26 @@ The following are some useful commands that you can run from the terminal so you
- `astro-rollback-full` => rollback automatically indi and kstars to the previous version
- `use-astro-bleeding-edge` => install bleeding edge packages for Kstars and INDI
- `use-astro-stable` => install stable packages for Kstars and INDI
- `backup-astroarch` => perform a full system backup
- `restore-astroarch` => Full recovery of the system

# Backup and Restore
You can back up the entire system using the `backup-astroarch` command or the `astroarch-tweak-tool` utility. You can perform a backup before updating with `update-astroarch`.

Use a disk with at least 64 GB of storage if the backup location is on your AstroArch disk.

You can choose from several options stored in the /home/astronaut/.backup_dest file for your future backups:
- Yes (perform a backup)
- Yes, do not ask again (perform the backup without prompting)
- No (do not perform the backup)
- No, do not ask again (do not perform this backup again)

If you selected “Do not ask again” and change your mind, open the .backup_dest file and change the value to AUTO_CHOICE="Ask"

To restore your files, use the `restore-astroarch` command or the `astroarch-tweak-tool` utility.

If you no longer have access to your system, back up your folder to another disk if it is on your AstroArch disk.
Perform a fresh, updated installation, run the restore command, and specify the location of your backup folder.

# Connecting via browser (noVNC)
By default `AstroArch` will start a hostpot called `AstroArch`, to connect to that WiFi network use the password `astronomy`
Expand Down Expand Up @@ -419,6 +441,54 @@ Sometimes vietual envs are not simply possible, so there are 3 ways to achieve t
2) open an issue here on github and let me know what python packages you would like to see available to be installed via `pacman`, it will take few days to few weeks depending on availability but it is doable - RECOMMENDED WAY if 1 is not possible
3) bypass the pip check and force a global install running `sudo pip install --break-system-packages PACKAGE_NAME` - NOT RECOMMENDED and likely to break other dependencies in the long run, if you do so, we do not offer any support, sorry!

# Kiosk session
You can use a lighter KDE Plasma session by logging out of the astronaut session and logging in with the astronaut-kiosk user via your LAN or RDP/VNC software

<img width="348" height="357" alt="image" src="https://github.com/user-attachments/assets/d832341b-f2e5-4a8f-92d0-1d32ac57ae05" />


This session is designed to run only a few programs. During our astro outings, we only use one or two imaging programs. To do this, simply configure the session with the AstroArch-config-kiosk tool

- You can request to have the software icon on the desktop and/or in the menu
- You can request to launch the software directly when the session starts. You can also set the software to reopen if it is closed. The images folder is accessible from the astroarch user
- You can request your software to save to a folder in the astroarch session or to a removable disk
- You can also retrieve your Kstars configuration with astromonitor

<img width="272" height="301" alt="image" src="https://github.com/user-attachments/assets/61291a8a-ef06-4d95-8d22-d2e39083e013" />

After selecting the software to install, the following window shows you the configuration status. Either the status is disabled and the line is not highlighted. Click on it to select and enable or disable it

<img width="272" height="301" alt="image" src="https://github.com/user-attachments/assets/29702eaa-a2fe-44d9-8f0e-350640b87ddb" />

- Example: the window shows you the status for Kstars

<img width="272" height="301" alt="image" src="https://github.com/user-attachments/assets/dbd79c40-e618-4a10-a14c-adb67b872107" />

- Select the options and then click OK

<img width="272" height="301" alt="image" src="https://github.com/user-attachments/assets/a997f694-767e-4b72-a855-4f85a2ca25c8" />

- Reopen the window. Now the choices you made previously are active and automatically highlighted. To deactivate them, perform the reverse operation
- Following the selection, you must log out and/or restart the pi

You can see the status of all software with the status of the current configuration


<img width="691" height="487" alt="image" src="https://github.com/user-attachments/assets/c591cb47-ce97-43a1-850a-8ffc6df9f148" />


- Restore your Kstars configuration with your astromonitor key


<img width="268" height="293" alt="image" src="https://github.com/user-attachments/assets/79c0b11f-d726-4e5a-ae53-97e3125559e4" />



<img width="200" height="126" alt="image" src="https://github.com/user-attachments/assets/2ff1f30d-4519-4598-827a-4f42e7f6068d" />




# Reporting issues
AstroArch is actually in a stable state, however, should you find any issue please report them here https://github.com/MattBlack85/astroarch/issues this will help me tracking them and ship a fix for them

Expand Down
50 changes: 47 additions & 3 deletions astroarch_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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 --noconfirm --ask 4
kdialog jq astroarch-onboarding dhcpcd iw rsync --noconfirm --ask 4
fi


Expand Down Expand Up @@ -101,7 +101,7 @@ systemctl stop smb
ln -s /home/astronaut/.astroarch/configs/.zshrc /home/astronaut/.zshrc

# NetworkManager WiFi Power Saving
ln -s /home/astronaut/.astroarch/configs/default-wifi-powersave-on.conf /etc/NetworkManager/conf.d
ln -s /home/astronaut/.astroarch/configs/default-wifi-powersave-off.conf /etc/NetworkManager/conf.d

# Start NetworkManager and sleep to create the hotspot
systemctl start NetworkManager
Expand Down Expand Up @@ -255,11 +255,55 @@ install -o root -g root -m 644 /home/astronaut/.astroarch/configs/kdeglobals /et
cp -r /home/astronaut/.astroarch/configs/look-and-feel/astroarch /usr/share/plasma/look-and-feel/
cp -r /home/astronaut/.astroarch/configs/layout-templates/astroarchPanel /usr/share/plasma/layout-templates/

# Add user astronaut-kiosk
useradd -G wheel -m astronaut-kiosk
echo "astronaut-kiosk:astro" | chpasswd
usermod -aG uucp,sys,network,power,audio,input,lp,storage,video,users,astronaut astronaut-kiosk
usermod -aG astronaut-kiosk astronaut
chmod -R 777 /home/astronaut-kiosk
su astronaut-kiosk -c "LC_ALL=C.UTF-8 xdg-user-dirs-update --force"
mkdir -p /home/astronaut-kiosk/.local/{bin,share,state}

## Add the kiosk session ##
# New Xrdp launcher for astronaut and astronaut-kiosk sessions
cp /home/astronaut/.astroarch/configs/kiosk/45-allow-shutdown-xrdp.rules /etc/polkit-1/rules.d/
cp /home/astronaut/.astroarch/configs/startwm.sh /home/astronaut-kiosk/
cp /home/astronaut/.astroarch/configs/kiosk/.xinitrc /home/astronaut-kiosk/

# Copy wallpapers
su astronaut-kiosk -c "mkdir -p /home/astronaut-kiosk/Pictures/wallpapers"
cp /home/astronaut/.astroarch/configs/kiosk/astroarch-kiosk.png /home/astronaut-kiosk/Pictures/wallpapers/

# Add menu
cp -r /home/astronaut/.astroarch/configs/kiosk/menus /home/astronaut-kiosk/.config/

# Copy kstars folders
cp -R /home/astronaut/.local/share/kstars /home/astronaut-kiosk/.local/share/

su astronaut-kiosk -c "cat <<EOF >/home/astronaut-kiosk/.config/plasmanotifyrc
[DoNotDisturb]
WhenFullscreen=false
WhenScreensMirrored=false
EOF"

# Copy the screensaver config, by default it is off
su astronaut-kiosk -c "cp /home/astronaut/.astroarch/configs/kscreenlockerrc /home/astronaut-kiosk/.config/kscreenlockerrc"

# Adjustment of user rights
chmod -R 777 /home/astronaut-kiosk
chown -R astronaut-kiosk:astronaut-kiosk /home/astronaut-kiosk

# Minimal desktop
ln -snf /home/astronaut/.astroarch/desktop/astroarch-config-kiosk.desktop /home/astronaut-kiosk/Desktop/Astroarch-config-Kiosk

# Allows access to the astronaut group
chmod -R 770 /home/astronaut

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

# Increases the xrdp buffer
sudo sed -i 's|#tcp_send_buffer_bytes=32768|tcp_send_buffer_bytes= 4194304|g' /etc/xrdp/xrdp.ini
sed -i 's|#tcp_send_buffer_bytes=32768|tcp_send_buffer_bytes= 4194304|g' /etc/xrdp/xrdp.ini

# Modprobe brcmfmac
bash -c "echo \"options brcmfmac feature_disable=0x282000\" > /etc/modprobe.d/brcmfmac.conf"
Expand Down
62 changes: 54 additions & 8 deletions configs/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,21 @@ function astro-rollback-kstars()
rm -rf ~/.rollback/*
}

function restore-astroarch() {
bash "$HOME/.astroarch/scripts/restore-astroarch.sh"
}

function backup-astroarch() {
bash "$HOME/.astroarch/scripts/backup-astroarch.sh"
}

function update-astroarch()
{
backup-astroarch &
wait $!

# Store actual version
OLD_VER=$(cat /home/$USER/.astroarch.version)
OLD_VER=$(cat "/home/$USER/.astroarch/configs/.astroarch.version" | tr -d '[:space:]')

# Store the current commit hash before the pull
cd /home/$USER/.astroarch
Expand All @@ -89,18 +100,50 @@ function update-astroarch()
git pull origin main
cd - > /dev/null 2>&1

NEW_VER=$(cat /home/$USER/.astroarch/configs/.astroarch.version)
# Store new version
NEW_VER=$(cat "/home/$USER/.astroarch/configs/.astroarch.version" | tr -d '[:space:]')

# Function convert to integer for comparison
function ver_to_int() {
local parts=(${(s:.:)1})
echo $(( ${parts[1]:-0} * 10000 + ${parts[2]:-0} * 100 + ${parts[3]:-0} ))
}

old_int=$(ver_to_int "$OLD_VER")
new_int=$(ver_to_int "$NEW_VER")

if [[ $old_int -lt $new_int ]]; then
local scripts_to_run=($(ls "/home/$USER/.astroarch/scripts/"*.sh | sort -V))
success=true

if [[ "$OLD_VER" != "$NEW_VER" ]]; then
zsh /home/$USER/.astroarch/scripts/$NEW_VER.sh
if [[ $? -ne 0 ]]; then
for script_path in "${scripts_to_run[@]}"; do
local script_name="${${script_path:t}:r}"

if [[ "$script_name" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
local script_int=$(ver_to_int "$script_name")

if (( script_int > old_int && script_int <= new_int )); then

# Apply scripts less than or equal to new astroarch.version
zsh "$script_path"

if [[ $? -ne 0 ]]; then
success=false
break
fi
fi
fi
done

if [[ "$success" = false ]]; then
# Revert to the commit stored before the pull
cd /home/$USER/.astroarch
git reset --hard "$CURRENT_COMMIT"
cd - > /dev/null 2>&1
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'Update AstroArch' "Script '$SCRIPT_VER' failed. Reverted to previous state."
else
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'Update AstroArch' 'All scripts applied successfully'
fi
notify-send --app-name 'AstroArch' --icon="/home/astronaut/.astroarch/assets/icons/novnc-icon.svg" -t 10000 'Update AstroArch' 'All scripts applied successfully'
fi;

# Temporary fix for kde-portal duplicated conf
Expand Down Expand Up @@ -199,8 +242,11 @@ function update-astroarch()
local PROCEED_UPDATE=1
# Test : GUI ?
if [[ -n "$DISPLAY" && -z "$SSH_CLIENT" && -z "$SSH_TTY" ]]; then
kdialog --title "AstroArch Update - Risk of Addiction" \
--warningyesno "Warning! The following critical packages will have their dependencies changed:\n\n- $list_str\n\nDo you want to proceed the update anyway?"
kdialog --title "AstroArch Update - Risk of Addiction" \
--warningyesno "Warning! The following critical packages will have their dependencies changed.\nClick “Yes” if you've made a backup.\n \
Click “No” to perform another update with a backup.\nFor more information, see the README on GitHub: \n\n \
- $list_str\n\nDo you want to proceed the update anyway?"

[[ $? -ne 0 ]] && PROCEED_UPDATE=0
else
# Terminal mode no GUI
Expand Down
2 changes: 2 additions & 0 deletions configs/default-wifi-powersave-off.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[connection]
wifi.powersave = 2
50 changes: 50 additions & 0 deletions configs/kiosk/.xinitrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

export DESKTOP_SESSION=plasma
export XDG_MENU_PREFIX=plasma-
export KWIN_X11_NO_QUIRKS=1
export KWIN_X11_FORCE_SOFTWARE_OPENGL=1
export KWIN_COMPOSE=N
export KWIN_X11_NO_QUIRKS=1

rm -f $HOME/.cache/menus/*
rm -f $HOME/.cache/ksycoca6*

# Set preference for X
xset s off -dpms s noblank

# Start KDE plasma minimal X window Manager + plasmashell
kwin_x11 &
KWIN_PID=$!
plasmashell &
SHELL_PID=$!

FLAG_FILE="$HOME/.config/kiosk_setup_done"

if [ ! -f "$FLAG_FILE" ]; then
/home/astronaut-kiosk/.local/bin/00-init-layout.sh &
fi

# App monitoring
watch_apps() {
while true; do
#pgrep -x kstars > /dev/null || kstars &
#pgrep -x "phd2.bin" > /dev/null || phd2 &
#pgrep -x xgps > /dev/null || xgps &
#pgrep -f AstroDMx-Capture > /dev/null || /opt/AstroDMx-Capture/bin/AstroDMx-Capture &
sleep 10
done
}

# Launch and/or restart the apps
#kstars &
#phd2 &
#/opt/AstroDMx-Capture/bin/AstroDMx-Capture &
#xgps &

watch_apps &

wait $KWIN_PID
kill $WATCH_PID
kill $SHELL_PID
exit 0
50 changes: 50 additions & 0 deletions configs/kiosk/00-init-layout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh

FLAG_FILE="$HOME/.config/kiosk_setup_done"

if [ -f "$FLAG_FILE" ]; then
exit 0
fi

while ! qdbus6 org.kde.plasmashell /PlasmaShell >/dev/null 2>&1; do
sleep 0.5
done

qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript '
// Apply wallpapers
var allDesktops = desktops();
for (var i in allDesktops) {
allDesktops[i].wallpaperPlugin = "org.kde.image";
allDesktops[i].currentConfigGroup = ["Wallpaper", "org.kde.image", "General"];
allDesktops[i].writeConfig("Image", "file:///home/astronaut-kiosk/Pictures/wallpapers/astroarch-kiosk.png");
allDesktops[i].writeConfig("FillMode", "0");
}

// Clean panels
var panels = panels();
for (var i in panels) {
var widgets = panels[i].widgets();
for (var j in widgets) {

// Kickoff favorites
if (widgets[j].type === "org.kde.plasma.kickoff") {
widgets[j].currentConfigGroup = ["Configuration", "General"];
widgets[j].writeConfig("favorites", []);
widgets[j].writeConfig("systemFavorites", false);
widgets[j].reloadConfig();
}

// Clear task manager launchers
if (widgets[j].type === "org.kde.plasma.icontasks") {
widgets[j].currentConfigGroup = ["Configuration", "General"];
widgets[j].writeConfig("launchers", "");
widgets[j].reloadConfig();
}
}
}'

kwriteconfig6 --file kscreenlockerrc --group Daemon --key Autolock false
kwriteconfig6 --file kscreenlockerrc --group Daemon --key Timeout 0
qdbus6 org.freedesktop.ScreenSaver /ScreenSaver configure

touch "$FLAG_FILE"
9 changes: 9 additions & 0 deletions configs/kiosk/45-allow-shutdown-xrdp.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions") &&
(subject.user == "astronaut" || subject.user == "astronaut-kiosk")) {
return polkit.Result.YES;
}
});
Binary file added configs/kiosk/astroarch-kiosk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading