Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a4c931785 | |||
| d015c0c0eb | |||
| 770df26b19 | |||
| 2117c2bae5 | |||
| 6706bd974e | |||
| 555339b834 | |||
| 97863ed6d8 | |||
| 9f0ee5d5b5 | |||
| 9158c094d3 | |||
| 74f2dcb808 | |||
| d8db10b05f | |||
| b2ca223d9a | |||
| addeec3360 | |||
| 742e8d1ed3 | |||
| 0660a50071 | |||
| c187b8d32c | |||
| 241e3f4e39 | |||
| 17cb26ff04 | |||
| 9008788a7d | |||
| cc91998a06 | |||
| 3e48abf598 | |||
| 7fc6dd25e4 | |||
| 985d8bc7b9 | |||
| 856c794637 | |||
| 1257eb31ab | |||
| adfc259d0f | |||
| 4c8de812ba |
@@ -12,54 +12,101 @@ dialog --backtitle "Configure Stormux" \
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudoFlags=("${sudoFlags[@]}")
|
||||
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--yesno "This will make catastrophic changes to your system. If you are not sure you want to do this, select no by pressing the letter n on your keyboard. Afterwards, you will only be able to login with an ssh key and there will be no screen reader.\nNote, configure-stormux will no longer be available." -1 -1 --stdout || exit 0
|
||||
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "Now let's upload your ssh key. It is a good idea to go ahead and connect via ssh now, in case something goes wrong you will have a chance to fix it manually. This will be used to login to your server, so whatever you do, don't lose it. If you have not yet created an ssh key, you can do so with the ssh-keygen command. Magic-wormhole will be used to upload the key. if you are doing this from a Windows based ssh session, you can install magic-wormhole with scoop: https://github.com/ScoopInstaller/Scoop" -1 -1 --stdout
|
||||
mkdir -p ~/.ssh
|
||||
if [[ -e ~/.ssh/known_hosts ]]; then
|
||||
if [[ -e /opt/configure-server ]]; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "Key found in ~/.ssh/known_hosts. If you are sure this is the correct key, press enter, otherwise press control+c to close this application and fix your key." -1 -1 --stdout
|
||||
fi
|
||||
if ! [[ -e ~/.ssh/authorized_keys ]]; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "No public ssh key found. Please upload your ssh key to ~/.ssh/known_hosts before continuing.\nIf you do not have a key, you can create it with ssh-keygen.\nYou can use wormhole ssh invite or ssh-copy-id to upload the key." -1 -1 --stdout
|
||||
--msgbox "/opt/configure-server already exists. Conversion has been cancelled because the system is no longer in a clean enough state for this process." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
sudo sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/ssh/sshd_config
|
||||
|
||||
for i in \
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "Now let's upload your ssh key. It is a good idea to go ahead and connect via ssh now, in case something goes wrong you will have a chance to fix it manually. This will be used to login to your server, so whatever you do, don't lose it. If you have not yet created an ssh key, you can do so with the ssh-keygen command. Magic-wormhole can be used to upload the key. If you are doing this from a Windows based ssh session, you can install magic-wormhole with scoop: https://github.com/ScoopInstaller/Scoop" -1 -1 --stdout
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
if ! [[ -s ~/.ssh/authorized_keys ]]; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "No public ssh key found. Please upload your public key to ~/.ssh/authorized_keys before continuing.\nIf you do not have a key, you can create it with ssh-keygen.\nYou can use wormhole ssh invite or ssh-copy-id to upload the key." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
# Validate the authorized_keys file actually contains a valid SSH public key
|
||||
if ! grep -qE "^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521)|sk-(ssh-ed25519|ecdsa-sha2-nistp256))" ~/.ssh/authorized_keys; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "The file ~/.ssh/authorized_keys does not appear to contain a valid SSH public key.
|
||||
|
||||
Please make sure you uploaded your public key (not your private key). A public key typically starts with something like ssh-ed25519 or ssh-rsa.
|
||||
|
||||
Upload the correct key and try again." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
sshPort="22"
|
||||
sshPortInput="$(dialog --backtitle "Configure Stormux" \
|
||||
--inputbox "Enter a custom SSH port (1-65535) or leave blank to keep 22." -1 -1 --stdout || true)"
|
||||
if [[ -n "$sshPortInput" && "$sshPortInput" =~ ^[0-9]+$ ]]; then
|
||||
if [[ "$sshPortInput" -ge 1 && "$sshPortInput" -le 65535 ]]; then
|
||||
sshPort="$sshPortInput"
|
||||
fi
|
||||
fi
|
||||
sudo "${sudoFlags[@]}" mkdir -p /etc/ssh/sshd_config.d
|
||||
sudo "${sudoFlags[@]}" tee /etc/ssh/sshd_config.d/99-stormux-server.conf > /dev/null << EOF
|
||||
Port ${sshPort}
|
||||
PermitRootLogin no
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
EOF
|
||||
|
||||
# Check for stale pacman database lock before removal
|
||||
if [[ -f /var/lib/pacman/db.lck ]]; then
|
||||
if dialog --backtitle "Configure Stormux" \
|
||||
--yesno "A pacman database lock was found at /var/lib/pacman/db.lck.
|
||||
|
||||
This usually means a previous package operation did not finish cleanly. Removing it is generally safe if no other package manager is currently running.
|
||||
|
||||
Would you like to remove the lock and continue?" -1 -1 --stdout; then
|
||||
sudo "${sudoFlags[@]}" rm -f /var/lib/pacman/db.lck
|
||||
else
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "Cannot safely remove packages while the pacman database is locked. Exiting." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
for packageName in \
|
||||
alsa-firmware \
|
||||
alsa-utils \
|
||||
bluez \
|
||||
bluez-utils \
|
||||
brltty \
|
||||
cloud-utils \
|
||||
espeak-ng \
|
||||
fenrir \
|
||||
fenrir-git \
|
||||
growpartfs \
|
||||
go \
|
||||
nodm-dgw \
|
||||
gstreamer \
|
||||
gst-plugins-base \
|
||||
gst-plugins-good \
|
||||
ii \
|
||||
pipewire \
|
||||
pipewire-alsa \
|
||||
pipewire-jack \
|
||||
pipewire-pulse \
|
||||
poppler \
|
||||
python-pyudev \
|
||||
python-daemonize \
|
||||
python-evdev \
|
||||
python-dbus \
|
||||
python-pyte \
|
||||
python-pyenchant \
|
||||
python-pyperclip \
|
||||
rhvoice-voice-bdl \
|
||||
screen \
|
||||
socat \
|
||||
sox \
|
||||
speech-dispatcher \
|
||||
wireplumber \
|
||||
xdg-user-dirs \
|
||||
xdg-utils ; do
|
||||
yay -Runcds --noconfirm $i
|
||||
yay -Runcds --noconfirm "$packageName" &> /dev/null
|
||||
done
|
||||
|
||||
rm -rfv ~/.config
|
||||
@@ -68,12 +115,33 @@ rm -rfv ~/Desktop
|
||||
rm -rfv ~/Downloads
|
||||
rm -rfv ~/Music
|
||||
rm -rfv ~/Pictures
|
||||
rm -rfv ~/Public
|
||||
rm -rfv ~/Templates
|
||||
rm -rfv ~/Videos
|
||||
sudo rm -rf /opt/configure-stormux
|
||||
sudo rm -fv /local/bin/configure-stormux
|
||||
sudo "${sudoFlags[@]}" rm -rf /opt/configure-stormux
|
||||
sudo "${sudoFlags[@]}" rm -fv /usr/local/bin/configure-stormux
|
||||
|
||||
if ! sudo "${sudoFlags[@]}" git clone https://git.stormux.org/storm/configure-server /opt/configure-server; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "The system conversion completed, but cloning configure-server into /opt failed. Please fix that before rebooting." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! sudo "${sudoFlags[@]}" tee /usr/local/bin/configure-server > /dev/null << 'EOF'
|
||||
#!/usr/bin/env bash
|
||||
exec /opt/configure-server/configure-server.sh "$@"
|
||||
EOF
|
||||
then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "configure-server was cloned, but creating /usr/local/bin/configure-server failed. Please fix that before rebooting." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/configure-server; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "configure-server was cloned, but setting executable permissions on /usr/local/bin/configure-server failed. Please fix that before rebooting." -1 -1 --stdout
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--msgbox "Hopefully everything went well and your server is ready to go, if not, see you on the other side of the reimage. Reboot for changes to ssh to be applied." -1 -1 --stdout
|
||||
--msgbox "Hopefully everything went well and your server is ready to go. Reboot for the SSH changes to be applied. Afterwards, you can run configure-server with /usr/local/bin/configure-server." -1 -1 --stdout
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
#!/usr/bin/env bash
|
||||
# EEPROM Update for Raspberry Pi 4/400/5/500
|
||||
# Checks for and applies firmware updates to the Pi's EEPROM
|
||||
|
||||
# sudoFlags is defined in the main configure-stormux.sh script
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
getRaspberryPiModel() {
|
||||
LC_ALL=C tr -d '\000' < /sys/firmware/devicetree/base/model 2>/dev/null
|
||||
}
|
||||
|
||||
getEepromPackage() {
|
||||
local piModel="$1"
|
||||
|
||||
if [[ "$piModel" == *"Raspberry Pi 5"* ]] || [[ "$piModel" == *"Raspberry Pi 500"* ]]; then
|
||||
echo "rpi5-eeprom"
|
||||
elif [[ "$piModel" == *"Raspberry Pi 4"* ]] || [[ "$piModel" == *"Raspberry Pi 400"* ]]; then
|
||||
echo "rpi4-eeprom"
|
||||
else
|
||||
echo "rpi4-eeprom"
|
||||
fi
|
||||
}
|
||||
|
||||
ensureEepromPackage() {
|
||||
local eepromPackage="$1"
|
||||
|
||||
if pacman -Q "$eepromPackage" &> /dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
infobox "Installing ${eepromPackage}..."
|
||||
if ! install_package "$eepromPackage"; then
|
||||
msgbox "Failed to install ${eepromPackage}. Please check your internet connection and try again."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
requireCurrentEepromForPi5Kernel() {
|
||||
local checkOutput
|
||||
local checkResult
|
||||
|
||||
if ! command -v rpi-eeprom-update &> /dev/null; then
|
||||
if ! ensureEepromPackage "rpi5-eeprom"; then
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
infobox "Checking EEPROM status before switching kernels..."
|
||||
checkOutput=$(sudo "${sudoFlags[@]}" rpi-eeprom-update 2>&1)
|
||||
checkResult=$?
|
||||
|
||||
case $checkResult in
|
||||
0)
|
||||
return 0
|
||||
;;
|
||||
1)
|
||||
msgbox "The Raspberry Pi 5 kernel switch is blocked because an EEPROM update is available.\n\n${checkOutput}\n\nRun Update EEPROM, reboot if an update is applied, then try the kernel switch again."
|
||||
;;
|
||||
2)
|
||||
msgbox "The Raspberry Pi 5 kernel switch is blocked because the EEPROM status check failed.\n\n${checkOutput}"
|
||||
;;
|
||||
3)
|
||||
msgbox "The Raspberry Pi 5 kernel switch is blocked because the EEPROM is currently frozen and cannot be verified as up to date.\n\n${checkOutput}\n\nThis may require a reboot to resolve."
|
||||
;;
|
||||
*)
|
||||
msgbox "The Raspberry Pi 5 kernel switch is blocked because EEPROM status could not be verified (exit code: ${checkResult}).\n\n${checkOutput}"
|
||||
;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
updateEeprom() {
|
||||
local piModel
|
||||
local eepromPackage
|
||||
|
||||
piModel=$(getRaspberryPiModel)
|
||||
|
||||
# Guard against non-Pi hardware
|
||||
if [[ -z "$piModel" ]] || [[ "$piModel" != *"Raspberry Pi"* ]]; then
|
||||
msgbox "This option is intended for Raspberry Pi hardware only.
|
||||
|
||||
Detected model: ${piModel:-unknown}
|
||||
|
||||
If you are not running on a Raspberry Pi, this option will not work correctly."
|
||||
return 1
|
||||
fi
|
||||
eepromPackage=$(getEepromPackage "$piModel")
|
||||
|
||||
# Install EEPROM package if not present
|
||||
if ! ensureEepromPackage "$eepromPackage"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check for EEPROM updates
|
||||
infobox "Checking for EEPROM updates..."
|
||||
local checkOutput
|
||||
local checkResult
|
||||
checkOutput=$(sudo "${sudoFlags[@]}" rpi-eeprom-update 2>&1)
|
||||
checkResult=$?
|
||||
|
||||
case $checkResult in
|
||||
0)
|
||||
# Up to date
|
||||
msgbox "EEPROM is up to date.\n\n${checkOutput}"
|
||||
;;
|
||||
1)
|
||||
# Update available
|
||||
if [[ "$(yesno "An EEPROM update is available.\n\n${checkOutput}\n\nWould you like to apply this update?")" == "Yes" ]]; then
|
||||
infobox "Applying EEPROM update..."
|
||||
if sudo "${sudoFlags[@]}" rpi-eeprom-update -a; then
|
||||
msgbox "EEPROM update applied successfully. A reboot is required to complete the update."
|
||||
restart
|
||||
else
|
||||
msgbox "Failed to apply EEPROM update. Please try again or check the log file for details."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
# Failed
|
||||
msgbox "EEPROM update check failed.\n\n${checkOutput}"
|
||||
return 1
|
||||
;;
|
||||
3)
|
||||
# EEPROM frozen
|
||||
msgbox "EEPROM is currently frozen and cannot be updated.\n\n${checkOutput}\n\nThis may require a reboot to resolve."
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
# Unknown error
|
||||
msgbox "Unexpected error checking EEPROM status (exit code: ${checkResult}).\n\n${checkOutput}"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Execute the update function when sourced
|
||||
if [[ "${eepromUpdateAutoRun:-true}" == "true" ]]; then
|
||||
updateEeprom
|
||||
fi
|
||||
+25
-58
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
install_package() {
|
||||
# If for some reason we have to change AUR helpers, this function should make it easy to update everything all at once.
|
||||
# make sure system is up to date
|
||||
@@ -29,47 +31,52 @@ attention() {
|
||||
|
||||
add_stormux_repo() {
|
||||
# Check if StormUX repository is already configured
|
||||
if grep -q "aarch64.stormux.org" /etc/pacman.conf; then
|
||||
if grep -q "\[stormux\]" /etc/pacman.conf; then
|
||||
msgbox "StormUX repository is already configured."
|
||||
return 0
|
||||
fi
|
||||
|
||||
infobox "Adding StormUX repository and importing signing key..."
|
||||
|
||||
# Import the repository signing key
|
||||
if ! curl -s https://aarch64.stormux.org/stormux-repo.pub | sudo "${sudoFlags[@]}" pacman-key --add -; then
|
||||
if ! curl -s https://packages.stormux.org/stormux_repo.pub | sudo "${sudoFlags[@]}" pacman-key --add -; then
|
||||
msgbox "Failed to download StormUX repository key."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Locally sign the key
|
||||
if ! sudo "${sudoFlags[@]}" pacman-key --lsign-key storm_dragon@stormux.org; then
|
||||
if ! sudo "${sudoFlags[@]}" pacman-key --lsign-key 52ADA49000F1FF0456F8AEEFB4CDE1CD56EF8E82; then
|
||||
msgbox "Failed to sign StormUX repository key."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Add repository to pacman.conf before any AUR-related sections
|
||||
# Create a temporary file with the repository configuration
|
||||
local temp_conf=$(mktemp)
|
||||
# Add repository to pacman.conf before [core] to give it highest priority
|
||||
local temp_conf
|
||||
temp_conf=$(mktemp)
|
||||
local added_repo=false
|
||||
|
||||
while IFS= read -r line; do
|
||||
# Add StormUX repo before any AUR or custom repo sections
|
||||
if [[ "$line" =~ ^\[.*\]$ ]] && [[ ! "$line" =~ ^\[(core|extra|multilib|testing|multilib-testing)\]$ ]] && [[ "$added_repo" == false ]]; then
|
||||
echo "[stormux]" >> "$temp_conf"
|
||||
echo "SigLevel = Required" >> "$temp_conf"
|
||||
echo "Server = https://aarch64.stormux.org/" >> "$temp_conf"
|
||||
echo "" >> "$temp_conf"
|
||||
# Add StormUX repo before [core] section
|
||||
if [[ "$line" == "[core]" ]] && [[ "$added_repo" == false ]]; then
|
||||
{
|
||||
echo "[stormux]"
|
||||
echo "SigLevel = Required DatabaseOptional"
|
||||
echo "Server = https://packages.stormux.org/\$arch"
|
||||
echo ""
|
||||
} >> "$temp_conf"
|
||||
added_repo=true
|
||||
fi
|
||||
echo "$line" >> "$temp_conf"
|
||||
done < /etc/pacman.conf
|
||||
|
||||
# If we didn't add it yet (no custom repos found), add it at the end
|
||||
# If we didn't find [core] section, add it at the end
|
||||
if [[ "$added_repo" == false ]]; then
|
||||
echo "" >> "$temp_conf"
|
||||
echo "[stormux]" >> "$temp_conf"
|
||||
echo "SigLevel = Required" >> "$temp_conf"
|
||||
echo "Server = https://aarch64.stormux.org/" >> "$temp_conf"
|
||||
{
|
||||
echo ""
|
||||
echo "[stormux]"
|
||||
echo "SigLevel = Required DatabaseOptional"
|
||||
echo "Server = https://packages.stormux.org/\$arch"
|
||||
} >> "$temp_conf"
|
||||
fi
|
||||
|
||||
# Replace the original pacman.conf
|
||||
@@ -87,47 +94,7 @@ add_stormux_repo() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
msgbox "StormUX repository added successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
install_xlibre() {
|
||||
# Make sure system is up to date
|
||||
yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu
|
||||
|
||||
# Check if we have internet connectivity
|
||||
if ! ping -c 1 aarch64.stormux.org &>/dev/null; then
|
||||
msgbox "No internet connection detected. X11Libre installation requires internet access."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Add StormUX repository with proper key management
|
||||
if ! add_stormux_repo; then
|
||||
msgbox "Failed to add StormUX repository. Installation aborted."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Remove conflicting packages
|
||||
infobox "Removing conflicting Xorg packages..."
|
||||
sudo "${sudoFlags[@]}" pacman -R --noconfirm xorg-server xf86-input-libinput xf86-video-fbdev 2>/dev/null || true
|
||||
|
||||
# Install X11Libre packages from StormUX repository
|
||||
infobox "Installing X11Libre server and drivers..."
|
||||
if ! sudo "${sudoFlags[@]}" pacman -S --noconfirm xlibre-server-common-git xlibre-server-devel-git; then
|
||||
msgbox "Failed to install X11Libre server components."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! sudo "${sudoFlags[@]}" pacman -Sdd --noconfirm xlibre-server-git; then
|
||||
msgbox "Failed to install X11Libre server main package."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Install input and video drivers from StormUX repository
|
||||
if ! sudo "${sudoFlags[@]}" pacman -S --noconfirm stormux/xf86-input-libinput-xlibre stormux/xf86-video-dummy-with-vt stormux/xf86-video-fbdev; then
|
||||
msgbox "Failed to install X11Libre input and video drivers."
|
||||
return 1
|
||||
fi
|
||||
|
||||
infobox "X11Libre installation completed successfully!"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# URL from where wine is downloaded, must be i686
|
||||
wineURL="https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-7.11-upstream-linux-x86.tar.gz"
|
||||
|
||||
|
||||
# Install required packages
|
||||
install_package cabextract box86 dos2unix p7zip unzip xdotool
|
||||
# Download and install wine
|
||||
wineFile="$(mktemp)"
|
||||
curl --output "$wineFile" "$wineURL"
|
||||
# Create wine directory
|
||||
sudo "${sudoFlags[@]}" mkdir -p /opt/wine
|
||||
pushd /opt/wine
|
||||
sudo "${sudoFlags[@]}" tar vxf "$wineFile"
|
||||
popd
|
||||
|
||||
# Create files and links in /usr/local/bin
|
||||
sudo "${sudoFlags[@]}" mkdir -p /usr/local/bin
|
||||
echo -e '#!/bin/bash\nsetarch linux32 -L /opt/wine/bin/wine "$@"' | sudo "${sudoFlags[@]}" tee /usr/local/bin/wine > /dev/null
|
||||
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/wine
|
||||
find /opt/wine/bin/ -maxdepth 1 -type f -perm -u+x -exec bash -c '
|
||||
for i ; do
|
||||
sudo "${sudoFlags[@]}" ln -s "$i" /usr/local/bin/
|
||||
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/"${i##*/}"
|
||||
done' _ {} \;
|
||||
|
||||
# Install audiogame-manager
|
||||
if [[ -d ~/audiogame-manager ]]; then
|
||||
git -C ~/audiogame-manager pull
|
||||
else
|
||||
git clone https://git.stormux.org/storm/audiogame-manager ~/audiogame-manager
|
||||
fi
|
||||
cat << EOF | sudo "${sudoFlags[@]}" tee /usr/local/bin/audiogame-manager &> /dev/null
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pushd ~/audiogame-manager
|
||||
./audiogame-manager.sh $@
|
||||
exit 0
|
||||
EOF
|
||||
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/audiogame-manager
|
||||
restart
|
||||
+24
-68
@@ -1,30 +1,19 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
packages="$1"
|
||||
packages="${packages//lxqt/lxqt lxterminal oxygen-icons ratpoison network-manager-applet}"
|
||||
packages="${packages//mate/mate mate-extra network-manager-applet}"
|
||||
packages="${packages//i3/clipster discount jq i3-wm libnotify lxterminal xfce4-notifyd pamixer playerctl python-i3ipc python-wxpython sox transfersh yad}"
|
||||
# Remove existing nodm from /etc/pam.d so package installation goes smoothly
|
||||
if [[ -e /etc/pam.d/nodm ]]; then
|
||||
sudo rm -f /etc/pam.d/nodm
|
||||
fi
|
||||
|
||||
# I38 core dependencies
|
||||
packages="bc caja dex discount jq i3-wm libnotify mousepad pamixer pcmanfm playerctl python-gobject python-i3ipc python-pillow python-pytesseract scrot sox tesseract tesseract-data-eng udiskie xbacklight xclip xdotool xorg-setxkbmap xprintidle xterm yad"
|
||||
packages+=" libmd libbsd"
|
||||
|
||||
# Proper command for launching the desktop session.
|
||||
case "${1}" in
|
||||
"lxqt") session="startlxqt";;
|
||||
"mate") session="mate-session";;
|
||||
*) session="$1";;
|
||||
esac
|
||||
|
||||
./.includes/toggle-screen.sh -n
|
||||
|
||||
# Install X11Libre
|
||||
if ! install_xlibre; then
|
||||
msgbox "X11Libre installation failed. Installation aborted."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# X11Libre installed successfully, install remaining packages
|
||||
# Note: nodm-dgw is now available from StormUX repository (added by install_xlibre)
|
||||
install_package ${packages} firefox nodm-dgw orca speech-dispatcher xclip xorg-xinit
|
||||
# Install X11Libre and I38 packages
|
||||
install_package "${packages}" brave-bin cthulhu nodm-dgw speech-dispatcher xlibre-xserver xlibre-input-libinput xlibre-video-fbdev xlibre-video-dummy-with-vt
|
||||
|
||||
# GUI bluetooth manager
|
||||
if [[ "${architecture}" == "aarch64" ]]; then
|
||||
@@ -34,60 +23,27 @@ fi
|
||||
# Configure nodm
|
||||
sudo sed -i "s/{user}/$USER/g" /etc/nodm.conf
|
||||
|
||||
# Create ~/.xinitrc
|
||||
cat << "EOF" > ~/.xinitrc
|
||||
#!/bin/sh
|
||||
#
|
||||
# ~/.xinitrc
|
||||
#
|
||||
# Executed by startx (run your window manager from here)
|
||||
|
||||
dbus-launch
|
||||
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
|
||||
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ]; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/*; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
unset f
|
||||
fi
|
||||
#accessibility for original load
|
||||
export ACCESSIBILITY_ENABLED=1
|
||||
export GTK_MODULES=gail:atk-bridge:canberra-gtk-module
|
||||
export GNOME_ACCESSIBILITY=1
|
||||
export QT_ACCESSIBILITY=1
|
||||
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
|
||||
export DBUS_SESSION_BUS_PID
|
||||
export DBUS_SESSION_BUS_ADDRESS
|
||||
|
||||
EOF
|
||||
|
||||
echo "exec ${session}" >> ~/.xinitrc
|
||||
chmod 755 ~/.xinitrc
|
||||
|
||||
if [[ "$1" == "i3" ]]; then
|
||||
gitDir="$(mktemp -d)"
|
||||
echo "Loading I38, please wait..."
|
||||
git clone -q https://git.stormux.org/storm/I38 "$gitDir"
|
||||
cd "$gitDir"
|
||||
# Play a sound to let the user know the next part is interactive.
|
||||
attention
|
||||
./i38.sh -x
|
||||
./i38.sh
|
||||
gitDir="$(mktemp -d)"
|
||||
echo "Loading I38, please wait..."
|
||||
if ! git clone -q https://git.stormux.org/storm/I38 "$gitDir"; then
|
||||
msgbox "Failed to clone I38 from https://git.stormux.org/storm/I38. Check your internet connection and try again."
|
||||
return 1
|
||||
fi
|
||||
if ! cd "$gitDir"; then
|
||||
msgbox "Failed to enter I38 directory."
|
||||
return 1
|
||||
fi
|
||||
# Play a sound to let the user know the next part is interactive.
|
||||
attention
|
||||
./i38.sh -x
|
||||
./i38.sh
|
||||
fi
|
||||
|
||||
|
||||
# Configure speech-dispatcher
|
||||
if [[ ! -d ~/.config/speech-dispatcher ]]; then
|
||||
spd-conf -n
|
||||
fi
|
||||
|
||||
# Automatically start orca for mate.
|
||||
if [[ "$1" == "mate" ]]; then
|
||||
GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true
|
||||
GSETTINGS_BACKEND=dconf gsettings set org.mate.interface accessibility true
|
||||
GSETTINGS_BACKEND=dconf gsettings set org.mate.applications-at-visual startup true
|
||||
fi
|
||||
|
||||
# enable nodm
|
||||
sudo systemctl enable nodm --now
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2154
|
||||
# sudoFlags is set by configure-stormux.sh before this file is sourced.
|
||||
|
||||
update_rhvoice_dictionaries() {
|
||||
local targetDirectory="/etc/RHVoice/dicts/English"
|
||||
local baseUrl="https://git.stormux.org/storm/rhvoice-english/raw/branch/master/English"
|
||||
local dictionaryFiles=(
|
||||
"wordfix.txt"
|
||||
"namefix.txt"
|
||||
)
|
||||
local tempDirectory
|
||||
local dictionaryFile
|
||||
|
||||
tempDirectory="$(mktemp -d)" || {
|
||||
msgbox "Failed to create a temporary directory for RHVoice dictionary updates."
|
||||
return 1
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$tempDirectory"
|
||||
}
|
||||
trap cleanup RETURN
|
||||
|
||||
infobox "Downloading RHVoice dictionaries..."
|
||||
for dictionaryFile in "${dictionaryFiles[@]}"; do
|
||||
if ! curl -fL --retry 10 -o "${tempDirectory}/${dictionaryFile}" "${baseUrl}/${dictionaryFile}"; then
|
||||
msgbox "Failed to download ${dictionaryFile} from the RHVoice English dictionary repository."
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
if ! sudo "${sudoFlags[@]}" mkdir -p "$targetDirectory"; then
|
||||
msgbox "Failed to create ${targetDirectory}."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for dictionaryFile in "${dictionaryFiles[@]}"; do
|
||||
if ! sudo "${sudoFlags[@]}" install -m 0644 "${tempDirectory}/${dictionaryFile}" "${targetDirectory}/${dictionaryFile}"; then
|
||||
msgbox "Failed to install ${dictionaryFile} to ${targetDirectory}."
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "$(yesno "RHVoice dictionaries updated successfully.\n\nRestart speech-dispatcher?")" == "Yes" ]]; then
|
||||
if ! sudo "${sudoFlags[@]}" killall speech-dispatcher; then
|
||||
msgbox "RHVoice dictionaries were updated, but restarting speech-dispatcher failed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
spd-say "speech-dispatcher reloaded, press enter to continue."
|
||||
fi
|
||||
|
||||
msgbox "RHVoice dictionaries updated successfully."
|
||||
return 0
|
||||
}
|
||||
|
||||
update_rhvoice_dictionaries
|
||||
@@ -9,7 +9,7 @@ mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 |
|
||||
region=$(dialog --backtitle "Please select your Region" \
|
||||
--no-tags \
|
||||
--menu "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection." 0 0 0 \
|
||||
$(for i in ${regions[@]} ; do echo "$i";echo "$i";done) --stdout)
|
||||
"$(for i in "${regions[@]}" ; do echo "$i";echo "$i";done)" --stdout)
|
||||
|
||||
|
||||
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
|
||||
@@ -18,7 +18,7 @@ mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | c
|
||||
city=$(dialog --backtitle "Please select a city near you" \
|
||||
--no-tags \
|
||||
--menu "Use up and down arrow or page-up and page-down to navigate the list." 0 0 10 \
|
||||
$(for i in ${cities[@]} ; do echo "$i";echo "$i";done) --stdout)
|
||||
"$(for i in "${cities[@]}" ; do echo "$i";echo "$i";done)" --stdout)
|
||||
|
||||
# Set the timezone
|
||||
if [[ -f /etc/localtime ]]; then
|
||||
|
||||
@@ -2,17 +2,42 @@
|
||||
|
||||
# Change between dummy and fbdev driver for X session.
|
||||
|
||||
sudoFlags=()
|
||||
if [[ -n "${SUDO_ASKPASS:-}" ]]; then
|
||||
sudoFlags=("-A")
|
||||
fi
|
||||
|
||||
xorgConfDir="/etc/X11/xorg.conf.d"
|
||||
xorgConfFile="${xorgConfDir}/10-screendriver.conf"
|
||||
|
||||
ensure_xorg_conf_dir() {
|
||||
if ! sudo "${sudoFlags[@]}" mkdir -p "${xorgConfDir}"; then
|
||||
msgbox "Failed to create ${xorgConfDir}."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
active_screen() {
|
||||
cat << EOF | sudo "${sudoFlags[@]}" tee /etc/X11/xorg.conf.d/10-screendriver.conf &> /dev/null
|
||||
if ! ensure_xorg_conf_dir; then
|
||||
return 1
|
||||
fi
|
||||
if ! sudo "${sudoFlags[@]}" tee "${xorgConfFile}" > /dev/null << 'EOF'
|
||||
Section "Device"
|
||||
Identifier "FBdev"
|
||||
Driver "fbdev"
|
||||
EndSection
|
||||
EOF
|
||||
then
|
||||
msgbox "Failed to write ${xorgConfFile}."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
headless() {
|
||||
cat << EOF | sudo "${sudoFlags[@]}" tee /etc/X11/xorg.conf.d/10-screendriver.conf &> /dev/null
|
||||
if ! ensure_xorg_conf_dir; then
|
||||
return 1
|
||||
fi
|
||||
if ! sudo "${sudoFlags[@]}" tee "${xorgConfFile}" > /dev/null << 'EOF'
|
||||
Section "Monitor"
|
||||
Identifier "dummy_monitor"
|
||||
HorizSync 28.0-80.0
|
||||
@@ -42,6 +67,10 @@ Section "ServerLayout"
|
||||
Screen 0 "dummy_screen"
|
||||
EndSection
|
||||
EOF
|
||||
then
|
||||
msgbox "Failed to write ${xorgConfFile}."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -49,11 +78,17 @@ source ./.includes/functions.sh
|
||||
source ./.includes/ui.sh
|
||||
answer=$(yesno "Do you have a physical screen attached?")
|
||||
if [[ "${answer}" == "Yes" ]]; then
|
||||
active_screen
|
||||
msgbox "Settings for physical screen applied."
|
||||
if active_screen; then
|
||||
msgbox "Settings for physical screen applied."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
headless
|
||||
msgbox "Settings for no screen applied."
|
||||
if headless; then
|
||||
msgbox "Settings for no screen applied."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$1" != "-n" ]]; then
|
||||
|
||||
+3
-3
@@ -55,9 +55,9 @@ infobox() {
|
||||
# Shows the provided message on the screen with no buttons.
|
||||
local timeout=3
|
||||
dialog --infobox "$*" 0 0
|
||||
read -n1 -t $timeout continue
|
||||
read -n1 -t $timeout
|
||||
# Clear any keypresses from the buffer
|
||||
read -t 0.01 continue
|
||||
read -t 0.01
|
||||
}
|
||||
|
||||
yesno() {
|
||||
@@ -91,5 +91,5 @@ show_doc() {
|
||||
# Displays file in w3m using pager mode
|
||||
# Args: path to file.
|
||||
# Returns: none.
|
||||
fold -sw $cols "$1" | w3m -o keymap_file=~/.w3m/pager
|
||||
fold -sw "$COLUMNS" "$1" | w3m -o keymap_file=~/.w3m/pager
|
||||
}
|
||||
|
||||
+22
-18
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Configure Stormux
|
||||
# A script to configure the system for new users.
|
||||
#
|
||||
@@ -73,7 +73,7 @@ fi
|
||||
while [[ "$choice" != "Exit" ]]; do
|
||||
case "$choice" in
|
||||
"Change username")
|
||||
./.includes/chuser.sh $(inputbox "Please enter the new username, letters, dashes, and underscores only.")
|
||||
./.includes/chuser.sh "$(inputbox "Please enter the new username, letters, dashes, and underscores only.")"
|
||||
restart
|
||||
;;
|
||||
"Configure Fenrir")
|
||||
@@ -90,24 +90,21 @@ while [[ "$choice" != "Exit" ]]; do
|
||||
sudo "${sudoFlags[@]}" systemctl enable bluetooth --now
|
||||
;;
|
||||
"Install Raspberry Pi 5 kernel")
|
||||
eepromUpdateAutoRun=false
|
||||
source .includes/eeprom.sh
|
||||
unset eepromUpdateAutoRun
|
||||
if ! requireCurrentEepromForPi5Kernel; then
|
||||
continue
|
||||
fi
|
||||
yay -R --noconfirm linux-rpi
|
||||
install_package linux-rpi-16k
|
||||
;;
|
||||
"Install Lxqt Desktop")
|
||||
source .includes/gui.sh lxqt
|
||||
;;
|
||||
"Install Mate Desktop")
|
||||
source .includes/gui.sh mate
|
||||
;;
|
||||
"Install i3 Windowmanager")
|
||||
"Install I38 Desktop")
|
||||
source .includes/gui.sh i3
|
||||
;;
|
||||
"Screen reader")
|
||||
source .includes/screenreader.sh
|
||||
;;
|
||||
"Set up gaming")
|
||||
source .includes/gaming.sh
|
||||
;;
|
||||
"Set timezone")
|
||||
source .includes/timezone.sh
|
||||
;;
|
||||
@@ -118,9 +115,18 @@ while [[ "$choice" != "Exit" ]]; do
|
||||
sudo "${sudoFlags[@]}" git pull
|
||||
exit $?
|
||||
;;
|
||||
"Update RHVoice dictionaries")
|
||||
source .includes/rhvoice-dictionaries.sh
|
||||
;;
|
||||
"Convert to Server")
|
||||
source .includes/convert-to-server.sh
|
||||
;;
|
||||
"Configure StormUX Repository")
|
||||
add_stormux_repo
|
||||
;;
|
||||
"Update EEPROM")
|
||||
source .includes/eeprom.sh
|
||||
;;
|
||||
esac
|
||||
options=(
|
||||
"Change username"
|
||||
@@ -133,18 +139,16 @@ while [[ "$choice" != "Exit" ]]; do
|
||||
if [[ "${raspberryPiVersion%%0*}" == "Raspberry Pi 5" ]] && ! pacman -Q linux-rpi-16k &> /dev/null ; then
|
||||
options+=("Install Raspberry Pi 5 kernel")
|
||||
fi
|
||||
options+=("Install Lxqt Desktop"
|
||||
"Install Mate Desktop"
|
||||
"Install i3 Windowmanager"
|
||||
options+=("Install I38 Desktop"
|
||||
"Screen reader"
|
||||
)
|
||||
if [[ "${architecture}" == "armv7l" ]]; then
|
||||
options+=("Set up gaming")
|
||||
fi
|
||||
options+=("Set timezone"
|
||||
"Get help on IRC"
|
||||
"Update configure-stormux"
|
||||
"Update EEPROM"
|
||||
"Update RHVoice dictionaries"
|
||||
"Convert to Server"
|
||||
"Configure StormUX Repository"
|
||||
)
|
||||
choice="$(menulist "${options[@]}")" || break
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user