diff --git a/applications/About.sh b/applications/About.sh index 1b149bb..4995709 100644 --- a/applications/About.sh +++ b/applications/About.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/About.desktop Version=1.0 Name=About Comment=System information from Fastfetch -Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml -e bash -c 'fastfetch; read -n 1 -s' +Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=About --title=About -e bash -c 'fastfetch; read -n 1 -s' Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/Ubuntu.png diff --git a/applications/Activity.sh b/applications/Activity.sh index 87d88cb..b4300bd 100644 --- a/applications/Activity.sh +++ b/applications/Activity.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/Activity.desktop Version=1.0 Name=Activity Comment=System activity from btop -Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/btop.toml -e btop +Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/btop.toml --class=Activity --title=Activity -e btop Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/Activity.png diff --git a/applications/Basecamp.sh b/applications/Basecamp.sh index ab4d2ab..1f3a908 100644 --- a/applications/Basecamp.sh +++ b/applications/Basecamp.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/Basecamp.desktop Version=1.0 Name=Basecamp Comment=Basecamp Project Management -Exec=google-chrome --app="https://launchpad.37signals.com" --name=Basecamp +Exec=google-chrome --app="https://launchpad.37signals.com" --name=Basecamp --class=Basecamp Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/Basecamp.png diff --git a/applications/Docker.sh b/applications/Docker.sh index 82aa4ee..90d4e52 100644 --- a/applications/Docker.sh +++ b/applications/Docker.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/Docker.desktop Version=1.0 Name=Docker Comment=Manage Docker containers with LazyDocker -Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml -e lazydocker +Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Docker --title=Docker -e lazydocker Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/Docker.png diff --git a/applications/HEY.sh b/applications/HEY.sh index 769260c..c23c374 100644 --- a/applications/HEY.sh +++ b/applications/HEY.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/HEY.desktop Version=1.0 Name=HEY Comment=HEY Email + Calendar -Exec=google-chrome --app="https://app.hey.com/" --name=HEY +Exec=google-chrome --app="https://app.hey.com/" --name=HEY --class=HEY Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/HEY.png diff --git a/applications/Neovim.sh b/applications/Neovim.sh index 2a479ff..9989020 100644 --- a/applications/Neovim.sh +++ b/applications/Neovim.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/Neovim.desktop Version=1.0 Name=Neovim Comment=Edit text files -Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml -e nvim %F +Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Neovim --title=Neovim -e nvim %F Terminal=false Type=Application Icon=nvim diff --git a/applications/Omakub.sh b/applications/Omakub.sh index f6475bd..4ebe048 100644 --- a/applications/Omakub.sh +++ b/applications/Omakub.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/Omakub.desktop Version=1.0 Name=Omakub Comment=Omakub Controls -Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml -e omakub +Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Omakub --title=Omakub -e omakub Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/Omakub.png diff --git a/applications/WhatsApp.sh b/applications/WhatsApp.sh index c744d92..c5ec532 100644 --- a/applications/WhatsApp.sh +++ b/applications/WhatsApp.sh @@ -3,7 +3,7 @@ cat <~/.local/share/applications/WhatsApp.desktop Version=1.0 Name=WhatsApp Comment=WhatsApp Messenger -Exec=google-chrome --app="https://web.whatsapp.com" --name=WhatsApp +Exec=google-chrome --app="https://web.whatsapp.com" --name=WhatsApp --class=Whatsapp Terminal=false Type=Application Icon=/home/$USER/.local/share/omakub/applications/icons/WhatsApp.png diff --git a/boot-dev.sh b/boot-dev.sh deleted file mode 100644 index b848178..0000000 --- a/boot-dev.sh +++ /dev/null @@ -1,23 +0,0 @@ -set -e - -ascii_art='________ __ ___. -\_____ \ _____ _____ | | ____ _\_ |__ - / | \ / \\__ \ | |/ / | \ __ \ -/ | \ Y Y \/ __ \| <| | / \_\ \ -\_______ /__|_| (____ /__|_ \____/|___ / - \/ \/ \/ \/ \/ -' - -echo -e "$ascii_art" -echo "=> Omakub is for fresh Ubuntu 24.04 installations only!" -echo -e "\nBegin installation (or abort with ctrl+c)..." - -sudo apt-get update >/dev/null -sudo apt-get install -y git >/dev/null - -echo "Cloning Omakub..." -rm -rf ~/.local/share/omakub -git clone https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null - -echo "Installation starting..." -source ~/.local/share/omakub/install.sh diff --git a/boot.sh b/boot.sh old mode 100644 new mode 100755 index 7ba7fe8..97f0884 --- a/boot.sh +++ b/boot.sh @@ -15,9 +15,14 @@ echo -e "\nBegin installation (or abort with ctrl+c)..." sudo apt-get update >/dev/null sudo apt-get install -y git >/dev/null -echo "Cloning stable Omakub..." +echo "Cloning Omakub..." rm -rf ~/.local/share/omakub -git clone -b stable https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null +git clone https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null +if [[ $OMAKUB_REF != "master" ]]; then + cd ~/.local/share/omakub + git fetch origin "${OMAKUB_REF:-stable}" && git checkout FETCH_HEAD + cd - +fi echo "Installation starting..." source ~/.local/share/omakub/install.sh diff --git a/install.sh b/install.sh index 4ee2111..2d551e3 100644 --- a/install.sh +++ b/install.sh @@ -4,28 +4,31 @@ set -e # Desktop software and tweaks will only be installed if we're running Gnome RUNNING_GNOME=$([[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]] && echo true || echo false) +# Check the distribution name and version and abort if incompatible +source ~/.local/share/omakub/install/check-version.sh + 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 + # 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 - 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 + echo "Get ready to make a few choices..." + source ~/.local/share/omakub/install/terminal/required/app-gum.sh >/dev/null + source ~/.local/share/omakub/install/first-run-choices.sh - echo "Installing terminal and desktop tools.." + echo "Installing terminal and desktop tools.." else - echo "Only installing terminal tools..." + 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 + # 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 + # 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 fi diff --git a/install/check-version.sh b/install/check-version.sh new file mode 100644 index 0000000..f5389e2 --- /dev/null +++ b/install/check-version.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Function to check if running on Ubuntu 24.04 or higher +check_ubuntu_version() { + if [ -f /etc/os-release ]; then + . /etc/os-release + if [ "$ID" = "ubuntu" ]; then + if awk -v ver="$VERSION_ID" 'BEGIN {exit !(ver >= 24.04)}'; then + return 0 + else + echo "Error: Ubuntu version must be 24.04 or higher. Current version: $VERSION_ID" >&2 + return 1 + fi + else + echo "Error: This script must be run on Ubuntu. Current OS: $ID" >&2 + return 1 + fi + else + echo "Error: Unable to determine OS. /etc/os-release file not found." >&2 + return 1 + fi +} + +if ! check_ubuntu_version; then + echo "Script execution failed due to system requirements not being met." >&2 + exit 1 +fi diff --git a/first_run_choices.sh b/install/first-run-choices.sh similarity index 100% rename from first_run_choices.sh rename to install/first-run-choices.sh diff --git a/install/terminal/apps-terminal.sh b/install/terminal/apps-terminal.sh index 9ca622f..7bf63a5 100644 --- a/install/terminal/apps-terminal.sh +++ b/install/terminal/apps-terminal.sh @@ -1 +1 @@ -sudo apt install -y fzf ripgrep bat eza zoxide plocate btop apache2-utils fd-find +sudo apt install -y fzf ripgrep bat eza zoxide plocate btop apache2-utils fd-find tldr diff --git a/install/terminal/libraries.sh b/install/terminal/libraries.sh index bbed439..3cc1a44 100644 --- a/install/terminal/libraries.sh +++ b/install/terminal/libraries.sh @@ -1,5 +1,5 @@ sudo apt install -y \ - build-essential pkg-config autoconf bison clang \ - libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ - libvips imagemagick libmagickwand-dev mupdf mupdf-tools \ - redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev + build-essential pkg-config autoconf bison clang rustc \ + libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ + libvips imagemagick libmagickwand-dev mupdf mupdf-tools \ + redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev libpq-dev postgresql-client postgresql-client-common diff --git a/install/terminal/required/app-gum.sh b/install/terminal/required/app-gum.sh index 2f10639..4fc1e32 100644 --- a/install/terminal/required/app-gum.sh +++ b/install/terminal/required/app-gum.sh @@ -1,7 +1,7 @@ # Gum is used for the Omakub commands for tailoring Omakub after the initial install cd /tmp GUM_VERSION="0.14.3" # Use known good version -wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/latest/download/gum_${GUM_VERSION}_amd64.deb" +wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_amd64.deb" sudo apt-get install -y ./gum.deb rm gum.deb cd - diff --git a/migrations/1722091912.sh b/migrations/1722091912.sh new file mode 100644 index 0000000..a80c9a0 --- /dev/null +++ b/migrations/1722091912.sh @@ -0,0 +1,14 @@ +sudo echo "Running upgrade migration..." + +# Add rustc and pgsql client libs +source $OMAKUB_PATH/install/terminal/libraries.sh + +# Set name and class for desktop files +source $OMAKUB_PATH/applications/About.sh +source $OMAKUB_PATH/applications/Activity.sh +source $OMAKUB_PATH/applications/Basecamp.sh +source $OMAKUB_PATH/applications/HEY.sh +source $OMAKUB_PATH/applications/Docker.sh +source $OMAKUB_PATH/applications/Neovim.sh +source $OMAKUB_PATH/applications/Omakub.sh +source $OMAKUB_PATH/applications/WhatsApp.sh