Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry pi compatibility #227

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
12 changes: 11 additions & 1 deletion bin/omakub-sub/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#source the utils if not sourced already
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi

CHOICES=(
"Dev Language Install programming language environment"
"Dev Database Install development database in Docker"
Expand Down Expand Up @@ -40,7 +45,12 @@ else
*) INSTALLER_FILE="$OMAKUB_PATH/install/desktop/optional/app-$INSTALLER.sh" ;;
esac

source $INSTALLER_FILE && gum spin --spinner globe --title "Install completed!" -- sleep 3
if source $INSTALLER_FILE; then
gum spin --spinner globe --title "Install completed!" -- sleep 3
handle_omakub_source_success "$INSTALLER_FILE"
else
handle_omakub_source_error "$INSTALLER_FILE"
fi
fi

clear
Expand Down
12 changes: 11 additions & 1 deletion bin/omakub-sub/update.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#source the utils if not sourced already
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi

CHOICES=(
"Omakub Update Omakub itself and run any migrations"
"Ollama Run LLMs, like Meta's Llama3, locally"
Expand All @@ -23,7 +28,12 @@ else
*) INSTALLER_FILE="$OMAKUB_PATH/install/terminal/app-$INSTALLER.sh" ;;
esac

source $INSTALLER_FILE && gum spin --spinner globe --title "Update completed!" -- sleep 3
if source $INSTALLER_FILE; then
gum spin --spinner globe --title "Update completed!" -- sleep 3
handle_omakub_source_success "$INSTALLER_FILE"
else
handle_omakub_source_error "$INSTALLER_FILE"
fi
fi

clear
Expand Down
7 changes: 6 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
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)
RUNNING_GNOME=$([[ "${XDG_CURRENT_DESKTOP##*:}" =~ [Gg][Nn][Oo][Mm][Ee] ]] && echo true || echo false)

# Check the distribution name and version and abort if incompatible
source ~/.local/share/omakub/install/check-version.sh

#source the util functions
source ~/.local/share/omakub/utils.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
Expand All @@ -32,3 +35,5 @@ if $RUNNING_GNOME; then
gsettings set org.gnome.desktop.screensaver lock-enabled true
gsettings set org.gnome.desktop.session idle-delay 300
fi

print_omakub_report | tee ~/.local/share/omakub/omakub_report.log
13 changes: 12 additions & 1 deletion install/desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.session idle-delay 0

#source the utils if not sourced already
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi

# Run desktop installers
for installer in ~/.local/share/omakub/install/desktop/*.sh; do source $installer; done
for installer in ~/.local/share/omakub/install/desktop/*.sh; do
if source "$installer"; then
handle_omakub_source_success "$installer"
else
handle_omakub_source_error "$installer"
fi
done

# Revert to normal idle and lock settings
gsettings set org.gnome.desktop.screensaver lock-enabled true
Expand Down
19 changes: 14 additions & 5 deletions install/desktop/app-chrome.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# Browse the web with the most popular browser. See https://www.google.com/chrome/
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
xdg-settings set default-web-browser google-chrome.desktop
cd -
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "chrome")
if wget "https://dl.google.com/linux/direct/google-chrome-stable_current_$ARCH.deb"; then
sudo apt install -y "./google-chrome-stable_current_$ARCH.deb"
rm "google-chrome-stable_current_$ARCH.deb"
xdg-settings set default-web-browser google-chrome.desktop
cd -
else
cd -
false
fi

16 changes: 12 additions & 4 deletions install/desktop/app-localsend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cd /tmp
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "localsend")
LOCALSEND_VERSION=$(curl -s "https://api.github.com/repos/localsend/localsend/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-x86-64.deb"
sudo apt install -y ./localsend.deb
rm localsend.deb
cd -
if wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-${ARCH}.deb"; then
sudo apt install -y ./localsend.deb
rm localsend.deb
cd -
else
cd -
false
fi
6 changes: 5 additions & 1 deletion install/desktop/app-signal.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "signal")
wget -qO- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor >signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg >/dev/null
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |
echo "deb [arch=${ARCH} signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main" |
sudo tee /etc/apt/sources.list.d/signal-xenial.list
rm signal-desktop-keyring.gpg
sudo apt update
Expand Down
43 changes: 32 additions & 11 deletions install/desktop/app-vscode.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
cd /tmp
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list >/dev/null
rm -f packages.microsoft.gpg
cd -

sudo apt update -y
sudo apt install -y code
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "vscode")

mkdir -p ~/.config/Code/User
cp ~/.local/share/omakub/configs/vscode.json ~/.config/Code/User/settings.json
if wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg; then
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list >/dev/null
rm -f packages.microsoft.gpg
cd -

# Install default supported themes
code --install-extension enkia.tokyo-night
sudo apt update -y
sudo apt install -y code

mkdir -p ~/.config/Code/User
cp ~/.local/share/omakub/configs/vscode.json ~/.config/Code/User/settings.json

# Install default supported themes
code --install-extension enkia.tokyo-night
cd -
elif wget -O code.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-${ARCH}"; then
sudo apt install -y ./code.deb
rm code.deb

mkdir -p ~/.config/Code/User
cp ~/.local/share/omakub/configs/vscode.json ~/.config/Code/User/settings.json

# Install default supported themes
code --install-extension enkia.tokyo-night
cd -
else
cd -
false
fi
55 changes: 40 additions & 15 deletions install/desktop/optional/app-1password.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
# Install 1password and 1password-cli single script
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch)
case "$ARCH" in
aarch64)
cd /tmp
curl -sSO https://downloads.1password.com/linux/tar/stable/aarch64/1password-latest.tar.gz
curl -sSO https://downloads.1password.com/linux/tar/stable/aarch64/1password-latest.tar.gz.sig
gpg --keyserver keyserver.ubuntu.com --recv-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22
gpg --verify 1password-latest.tar.gz.sig 1password-latest.tar.gz
if [[ $? -eq 0 ]]; then
sudo tar -xf 1password-latest.tar.gz
sudo mkdir -p /opt/1Password
sudo mv 1password-*/* /opt/1Password
sudo /opt/1Password/after-install.sh
cd -
else
cd -
false
fi
;;
*)
# Install 1password and 1password-cli single script
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg

# Add apt repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" |
sudo tee /etc/apt/sources.list.d/1password.list
# Add apt repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" |
sudo tee /etc/apt/sources.list.d/1password.list

# Add the debsig-verify policy
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \
sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
# Add the debsig-verify policy
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | \
sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg

# Install 1Password & 1password-cli
sudo apt update && sudo apt install -y 1password 1password-cli
# Install 1Password & 1password-cli
sudo apt update && sudo apt install -y 1password 1password-cli
;;
esac
16 changes: 12 additions & 4 deletions install/desktop/optional/app-zoom.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Make video calls using https://zoom.us/
cd /tmp
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./zoom_amd64.deb
rm zoom_amd64.deb
cd -
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "zoom")
if wget "https://zoom.us/client/latest/zoom_${ARCH}.deb"; then
sudo apt install -y "./zoom_${ARCH}.deb"
rm "zoom_${ARCH}.deb"
cd -
else
cd -
false
fi
11 changes: 10 additions & 1 deletion install/desktop/select-optional-apps.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#source the utils if not sourced already
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi

if [[ -v OMAKUB_FIRST_RUN_OPTIONAL_APPS ]]; then
apps=$OMAKUB_FIRST_RUN_OPTIONAL_APPS

if [[ -n "$apps" ]]; then
for app in $apps; do
source "$OMAKUB_PATH/install/desktop/optional/app-${app,,}.sh"
if source "$OMAKUB_PATH/install/desktop/optional/app-${app,,}.sh"; then
handle_omakub_source_success "$app"
else
handle_omakub_source_error "$app"
fi
done
fi
fi
2 changes: 1 addition & 1 deletion install/first-run-choices.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OPTIONAL_APPS=("1password" "Spotify" "Zoom" "Dropbox")
OPTIONAL_APPS=("1password" "Spotify" "Zoom" "Dropbox" "Brave")
DEFAULT_OPTIONAL_APPS='1password,Spotify,Zoom'
export OMAKUB_FIRST_RUN_OPTIONAL_APPS=$(gum choose "${OPTIONAL_APPS[@]}" --no-limit --selected $DEFAULT_OPTIONAL_APPS --height 7 --header "Select optional apps" | tr ' ' '-')

Expand Down
13 changes: 12 additions & 1 deletion install/terminal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ sudo apt update -y
sudo apt upgrade -y
sudo apt install -y curl git unzip

#source the utils if not sourced already
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi

# Run terminal installers
for installer in ~/.local/share/omakub/install/terminal/*.sh; do source $installer; done
for installer in ~/.local/share/omakub/install/terminal/*.sh; do
if source "$installer"; then
handle_omakub_source_success "$installer"
else
handle_omakub_source_error "$installer"
fi
done
19 changes: 14 additions & 5 deletions install/terminal/app-lazydocker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
cd /tmp
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "lazydocker")
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm lazydocker.tar.gz lazydocker
cd -
if curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_${ARCH}.tar.gz"; then
tar -xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm lazydocker.tar.gz lazydocker
cd -
else
cd -
false
fi

18 changes: 13 additions & 5 deletions install/terminal/app-lazygit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
cd /tmp
if [[ -z $UTILS_SOURCED ]]; then
source ~/.local/share/omakub/utils.sh
fi
ARCH=$(get_arch "lazygit")
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
cd -
if curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_${ARCH}.tar.gz"; then
tar -xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
cd -
else
cd -
false
fi
Loading