Compare commits
12 Commits
d8db10b05f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8815129106 | |||
| 8004c888e6 | |||
| 4a4c931785 | |||
| d015c0c0eb | |||
| 770df26b19 | |||
| 2117c2bae5 | |||
| 6706bd974e | |||
| 555339b834 | |||
| 97863ed6d8 | |||
| 9f0ee5d5b5 | |||
| 9158c094d3 | |||
| 74f2dcb808 |
@@ -12,10 +12,21 @@ dialog --backtitle "Configure Stormux" \
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudoFlags=("${sudoFlags[@]}")
|
||||
yaySudoArgs=()
|
||||
if [[ ${#sudoFlags[@]} -gt 0 ]]; then
|
||||
yaySudoArgs=(--sudoflags "${sudoFlags[*]}")
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
if [[ -e /opt/configure-server ]]; then
|
||||
dialog --backtitle "Configure Stormux" \
|
||||
--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
|
||||
|
||||
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
|
||||
@@ -26,6 +37,16 @@ if ! [[ -s ~/.ssh/authorized_keys ]]; then
|
||||
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)"
|
||||
@@ -34,45 +55,79 @@ if [[ -n "$sshPortInput" && "$sshPortInput" =~ ^[0-9]+$ ]]; then
|
||||
sshPort="$sshPortInput"
|
||||
fi
|
||||
fi
|
||||
sudo mkdir -p /etc/ssh/sshd_config.d
|
||||
sudo tee /etc/ssh/sshd_config.d/99-stormux-server.conf > /dev/null << EOF
|
||||
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
|
||||
|
||||
for packageName in \
|
||||
# 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
|
||||
|
||||
serverRemovalPackages=(
|
||||
alsa-firmware \
|
||||
alsa-utils \
|
||||
bluez \
|
||||
bluez-utils \
|
||||
brltty \
|
||||
cthulhu \
|
||||
espeak-ng \
|
||||
fenrir \
|
||||
fenrir-git \
|
||||
gstreamer \
|
||||
gst-plugins-base \
|
||||
gst-plugins-good \
|
||||
i38 \
|
||||
ii \
|
||||
magic-wormhole \
|
||||
nodm-dgw \
|
||||
pipewire \
|
||||
pipewire-alsa \
|
||||
pipewire-jack \
|
||||
pipewire-pulse \
|
||||
poppler \
|
||||
python-evdev \
|
||||
python-dbus \
|
||||
python-pyte \
|
||||
python-evdev \
|
||||
python-gobject \
|
||||
python-msgpack \
|
||||
python-pyenchant \
|
||||
python-pyte \
|
||||
python-pyperclip \
|
||||
python-tornado \
|
||||
realtime-privileges \
|
||||
rhvoice-voice-bdl \
|
||||
screen \
|
||||
socat \
|
||||
sox \
|
||||
speech-dispatcher \
|
||||
w3m-git \
|
||||
wireplumber \
|
||||
xdg-user-dirs \
|
||||
xdg-utils ; do
|
||||
yay -Runcds --noconfirm "$packageName"
|
||||
xdg-utils \
|
||||
xlibre-input-libinput \
|
||||
xlibre-video-dummy-with-vt \
|
||||
xlibre-video-fbdev \
|
||||
xlibre-xserver \
|
||||
xorg-xinit
|
||||
)
|
||||
|
||||
for packageName in "${serverRemovalPackages[@]}"; do
|
||||
yay "${yaySudoArgs[@]}" -Runcds --noconfirm "$packageName" &> /dev/null
|
||||
done
|
||||
|
||||
rm -rfv ~/.config
|
||||
@@ -81,12 +136,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
|
||||
|
||||
+80
-16
@@ -5,31 +5,93 @@
|
||||
# sudoFlags is defined in the main configure-stormux.sh script
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
updateEeprom() {
|
||||
# Detect Pi version from device tree
|
||||
local piModel
|
||||
piModel=$(LC_ALL=C tr -d '\000' < /sys/firmware/devicetree/base/model 2>/dev/null)
|
||||
getRaspberryPiModel() {
|
||||
LC_ALL=C tr -d '\000' < /sys/firmware/devicetree/base/model 2>/dev/null
|
||||
}
|
||||
|
||||
getEepromPackage() {
|
||||
local piModel="$1"
|
||||
|
||||
# Determine which EEPROM package is needed
|
||||
local eepromPackage=""
|
||||
if [[ "$piModel" == *"Raspberry Pi 5"* ]] || [[ "$piModel" == *"Raspberry Pi 500"* ]]; then
|
||||
eepromPackage="rpi5-eeprom"
|
||||
echo "rpi5-eeprom"
|
||||
elif [[ "$piModel" == *"Raspberry Pi 4"* ]] || [[ "$piModel" == *"Raspberry Pi 400"* ]]; then
|
||||
eepromPackage="rpi4-eeprom"
|
||||
echo "rpi4-eeprom"
|
||||
else
|
||||
# Default to rpi4-eeprom for unknown models
|
||||
eepromPackage="rpi4-eeprom"
|
||||
echo "rpi4-eeprom"
|
||||
fi
|
||||
}
|
||||
|
||||
ensureEepromPackage() {
|
||||
local eepromPackage="$1"
|
||||
|
||||
if pacman -Q "$eepromPackage" &> /dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Install EEPROM package if not present
|
||||
if ! pacman -Q "$eepromPackage" &> /dev/null; then
|
||||
infobox "Installing ${eepromPackage}..."
|
||||
if ! install_package "$eepromPackage"; then
|
||||
msgbox "Failed to install ${eepromPackage}. Please check your internet connection and try again."
|
||||
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
|
||||
@@ -74,4 +136,6 @@ updateEeprom() {
|
||||
}
|
||||
|
||||
# Execute the update function when sourced
|
||||
updateEeprom
|
||||
if [[ "${eepromUpdateAutoRun:-true}" == "true" ]]; then
|
||||
updateEeprom
|
||||
fi
|
||||
|
||||
@@ -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
|
||||
+18
-60
@@ -6,23 +6,14 @@ if [[ -e /etc/pam.d/nodm ]]; then
|
||||
sudo rm -f /etc/pam.d/nodm
|
||||
fi
|
||||
|
||||
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 xdotool yad}"
|
||||
# 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 and GUI packages
|
||||
install_package ${packages} brave-bin nodm-dgw orca speech-dispatcher xclip xlibre-xserver xlibre-input-libinput xlibre-video-fbdev xlibre-video-dummy-with-vt
|
||||
# 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
|
||||
@@ -32,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" || return
|
||||
# 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,59 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$(whoami)" == "root" ]]; then
|
||||
msgbox "Please run configure-stormux as your user, not as root."
|
||||
return 1
|
||||
fi
|
||||
|
||||
sudoFlags=("${sudoFlags[@]}")
|
||||
yaySudoArgs=()
|
||||
if [[ ${#sudoFlags[@]} -gt 0 ]]; then
|
||||
yaySudoArgs=(--sudoflags "${sudoFlags[*]}")
|
||||
fi
|
||||
|
||||
confirmRemoval="$(yesno "This will remove the I38 desktop, disable GUI startup, remove the XLibre desktop packages installed for I38, and delete generated I38 configuration from your account. Continue?")"
|
||||
if [[ "$confirmRemoval" != "Yes" ]]; then
|
||||
msgbox "I38 removal cancelled."
|
||||
return 0
|
||||
fi
|
||||
|
||||
sudo "${sudoFlags[@]}" systemctl disable --now nodm.service 2> /dev/null || true
|
||||
|
||||
if [[ -f /var/lib/pacman/db.lck ]]; then
|
||||
removeLock="$(yesno "A pacman database lock was found at /var/lib/pacman/db.lck. If no package manager is running, it is usually safe to remove. Remove it and continue?")"
|
||||
if [[ "$removeLock" == "Yes" ]]; then
|
||||
sudo "${sudoFlags[@]}" rm -f /var/lib/pacman/db.lck
|
||||
else
|
||||
msgbox "Cannot safely remove packages while the pacman database is locked."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
packages=(
|
||||
i38
|
||||
cthulhu
|
||||
nodm-dgw
|
||||
xlibre-input-libinput
|
||||
xlibre-video-dummy-with-vt
|
||||
xlibre-video-fbdev
|
||||
xlibre-xserver
|
||||
xorg-xinit
|
||||
)
|
||||
|
||||
installedPackages=()
|
||||
for packageName in "${packages[@]}"; do
|
||||
if pacman -Q "$packageName" > /dev/null 2>&1; then
|
||||
installedPackages+=("$packageName")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#installedPackages[@]} -gt 0 ]]; then
|
||||
yay "${yaySudoArgs[@]}" --noconfirm -Rns "${installedPackages[@]}"
|
||||
fi
|
||||
|
||||
removeConfig="$(yesno "Delete generated I38 files from $HOME? This removes ~/.config/i3, ~/.xinitrc, ~/.xprofile, and ~/git/I38 if present.")"
|
||||
if [[ "$removeConfig" == "Yes" ]]; then
|
||||
rm -rf -- "$HOME/.config/i3" "$HOME/.xinitrc" "$HOME/.xprofile" "$HOME/git/I38"
|
||||
fi
|
||||
|
||||
msgbox "I38 removal is complete. Reboot before relying on the new console-only startup state."
|
||||
@@ -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
|
||||
|
||||
+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
|
||||
}
|
||||
|
||||
+13
-20
@@ -62,9 +62,6 @@ fi
|
||||
source .includes/functions.sh
|
||||
# Include the dialog based UI
|
||||
source .includes/ui.sh
|
||||
# Get architecture
|
||||
architecture="$(uname -m)"
|
||||
|
||||
# Make sure basic xdg directory structure is in place:
|
||||
if [[ ! -d ~/Desktop ]]; then
|
||||
xdg-user-dirs-update
|
||||
@@ -90,24 +87,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")
|
||||
source .includes/gui.sh i3
|
||||
"Remove I38 Desktop")
|
||||
source .includes/remove-i38.sh
|
||||
;;
|
||||
"Screen reader")
|
||||
source .includes/screenreader.sh
|
||||
;;
|
||||
"Set up gaming")
|
||||
source .includes/gaming.sh
|
||||
;;
|
||||
"Set timezone")
|
||||
source .includes/timezone.sh
|
||||
;;
|
||||
@@ -118,6 +112,9 @@ 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
|
||||
;;
|
||||
@@ -139,18 +136,14 @@ 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+=("Remove 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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user