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