From 0b07a33d3b8f7481631a84b3e04d949cc8904bd1 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio Date: Wed, 29 Oct 2025 15:11:03 +0100 Subject: [PATCH 1/3] Added Starship --- bin/omakub-sub/install.sh | 4 +++- configs/starship.toml | 32 ++++++++++++++++++++++++++++++++ defaults/bash/init | 4 ++++ install/terminal/app-starship.sh | 5 +++++ migrations/1761747063.sh | 6 ++++++ uninstall/app-starship.sh | 4 ++++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 configs/starship.toml create mode 100644 install/terminal/app-starship.sh create mode 100644 migrations/1761747063.sh create mode 100644 uninstall/app-starship.sh diff --git a/bin/omakub-sub/install.sh b/bin/omakub-sub/install.sh index 18676ea5d..801d22260 100644 --- a/bin/omakub-sub/install.sh +++ b/bin/omakub-sub/install.sh @@ -18,6 +18,7 @@ CHOICES=( "Ollama Run LLMs, like Meta's Llama3, locally" "Retroarch Play retro games" "Spotify Stream music from the world's most popular service" + "Starship Command line prompt for astronauts" "Steam Play games from Valve's store" "Tailscale Mesh VPN based on WireGuard and with Magic DNS" "VirtualBox Virtual machines to run Windows/Linux" @@ -27,7 +28,7 @@ CHOICES=( "<< Back " ) -CHOICE=$(gum choose "${CHOICES[@]}" --height 26 --header "Install application") +CHOICE=$(gum choose "${CHOICES[@]}" --height 27 --header "Install application") if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then # Don't install anything @@ -50,6 +51,7 @@ else "ollama") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-ollama.sh" ;; "tailscale") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-tailscale.sh" ;; "geekbench") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-geekbench.sh" ;; + "starship") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/app-starship.sh" ;; *) INSTALLER_FILE="$OMAKUB_PATH/install/desktop/optional/app-$INSTALLER.sh" ;; esac diff --git a/configs/starship.toml b/configs/starship.toml new file mode 100644 index 000000000..d5c6f08f0 --- /dev/null +++ b/configs/starship.toml @@ -0,0 +1,32 @@ +add_newline = true +command_timeout = 200 +format = "[$directory$git_branch$git_status]($style)$character" + +[character] +error_symbol = "[✗](bold cyan)" +success_symbol = "[❯](bold cyan)" + +[directory] +truncation_length = 2 +truncation_symbol = "…/" +repo_root_style = "bold cyan" +repo_root_format = "[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style) " + +[git_branch] +format = "[$branch]($style) " +style = "italic cyan" + +[git_status] +format = '[$all_status]($style)' +style = "cyan" +ahead = "⇡${count} " +diverged = "⇕⇡${ahead_count}⇣${behind_count} " +behind = "⇣${count} " +conflicted = " " +up_to_date = " " +untracked = "? " +modified = " " +stashed = "" +staged = "" +renamed = "" +deleted = "" \ No newline at end of file diff --git a/defaults/bash/init b/defaults/bash/init index 8f4d84cab..196284699 100644 --- a/defaults/bash/init +++ b/defaults/bash/init @@ -2,6 +2,10 @@ if command -v mise &> /dev/null; then eval "$(mise activate bash)" fi +if command -v starship &> /dev/null; then + eval "$(starship init bash)" +fi + if command -v zoxide &> /dev/null; then eval "$(zoxide init bash)" fi diff --git a/install/terminal/app-starship.sh b/install/terminal/app-starship.sh new file mode 100644 index 000000000..bc413c358 --- /dev/null +++ b/install/terminal/app-starship.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +curl -sS https://starship.rs/install.sh | sh -s -- -y + +cp ~/.local/share/omakub/configs/starship.toml ~/.config/starship.toml \ No newline at end of file diff --git a/migrations/1761747063.sh b/migrations/1761747063.sh new file mode 100644 index 000000000..792b796b5 --- /dev/null +++ b/migrations/1761747063.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +gum confirm "Do you want to install Starship?" && { + source $OMAKUB_PATH/install/terminal/app-starship.sh + cp "$OMAKUB_PATH/configs/starship.toml" ~/.config/starship.toml +} || true diff --git a/uninstall/app-starship.sh b/uninstall/app-starship.sh new file mode 100644 index 000000000..14537bdd4 --- /dev/null +++ b/uninstall/app-starship.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +sudo rm -rf /usr/local/bin/starship +sudo rm -rf ~/.cache/starship \ No newline at end of file From f45a94b575e3da89575eadc636d62c57689036f5 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio Date: Wed, 26 Nov 2025 15:17:15 +0100 Subject: [PATCH 2/3] Change Starship installation method to GitHub release Co-Authored by @ImmortalSom --- install/terminal/app-starship.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install/terminal/app-starship.sh b/install/terminal/app-starship.sh index bc413c358..d5d4d4b76 100644 --- a/install/terminal/app-starship.sh +++ b/install/terminal/app-starship.sh @@ -1,5 +1,10 @@ #!/bin/bash -curl -sS https://starship.rs/install.sh | sh -s -- -y +cd /tmp +curl -sLo starship.tar.gz "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-musl.tar.gz" +tar -xf starship.tar.gz starship +install starship ~/.local/bin +rm starship.tar.gz starship +cd - -cp ~/.local/share/omakub/configs/starship.toml ~/.config/starship.toml \ No newline at end of file +cp ~/.local/share/omakub/configs/starship.toml ~/.config/starship.toml From dd32a6843d37fcb3f8fd53fa7271e554918a00a8 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio Date: Wed, 26 Nov 2025 15:18:16 +0100 Subject: [PATCH 3/3] Change starship uninstall path to user local bin --- uninstall/app-starship.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uninstall/app-starship.sh b/uninstall/app-starship.sh index 14537bdd4..966619fbd 100644 --- a/uninstall/app-starship.sh +++ b/uninstall/app-starship.sh @@ -1,4 +1,4 @@ #!/bin/bash -sudo rm -rf /usr/local/bin/starship -sudo rm -rf ~/.cache/starship \ No newline at end of file +sudo rm -rf ~/.local/bin/starship +sudo rm -rf ~/.cache/starship