Allow terminal-only installation and use upfront choices

This commit is contained in:
David Heinemeier Hansson
2024-07-03 14:17:19 +02:00
parent 9dee5f0538
commit a01ef804d6

View File

@@ -1,23 +1,31 @@
# Exit immediately if a command exits with a non-zero status
set -e
# set -e
# Needed for all installers
sudo apt update -y
sudo apt install -y curl git unzip
# Desktop software and tweaks will only be installed if we're running Gnome
RUNNING_GNOME=$([[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]] && echo true || echo false)
if $RUNNING_GNOME; then
# Ensure computer doesn't go to sleep or lock while installing
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.session idle-delay 0
# Run installers
for script in ~/.local/share/omakub/install/*.sh; do source $script; done
echo "Get ready to make a few choices..."
source ~/.local/share/omakub/install/terminal/required/app-gum.sh >/dev/null
source ~/.local/share/omakub/first_run_choices.sh
# Upgrade everything that might ask for a reboot last
sudo apt upgrade -y
echo "Installing terminal and desktop tools.."
else
echo "Only installing terminal tools..."
fi
# Install terminal tools
source ~/.local/share/omakub/install/terminal.sh
if $RUNNING_GNOME; then
# Install desktop tools and tweaks
source ~/.local/share/omakub/install/desktop.sh
# Revert to normal idle and lock settings
gsettings set org.gnome.desktop.screensaver lock-enabled true
gsettings set org.gnome.desktop.session idle-delay 300
# Logout to pickup changes
gum confirm "Ready to logout for all settings to take effect?" && gnome-session-quit --logout --no-prompt
fi