diff --git a/bin/omakub-sub/install.sh b/bin/omakub-sub/install.sh index 48f49fc..3ddc16d 100644 --- a/bin/omakub-sub/install.sh +++ b/bin/omakub-sub/install.sh @@ -1,47 +1,49 @@ CHOICES=( - "Dev Language Install programming language environment" - "Dev Database Install development database in Docker" - "1password Manage your passwords securely across devices" - "Audacity Record and edit audio" - "Brave Chrome-based browser with built-in ad blocking" - "Cursor The AI Code Editor" - "Doom Emacs Emacs framework with curated list of packages" - "Dropbox Sync files across computers with ease" - "OBS Studio Record screencasts with inputs from both display + webcam" - "Ollama Run LLMs, like Meta's Llama3, locally" - "RubyMine IntelliJ's commercial Ruby editor" - "Spotify Stream music from the world's most popular service" - "Steam Play games from Valve's store" - "VirtualBox Virtual machines to run Windows/Linux" - "Zed Fast all-purpose editor" - "Zoom Attend and host video chat meetings" - "> All Re-run any of the default installers" - "<< Back " + "Dev Language Install programming language environment" + "Dev Database Install development database in Docker" + "1password Manage your passwords securely across devices" + "Audacity Record and edit audio" + "ASDControl Set brightness on Apple Studio and XDR displays via cli" + "Brave Chrome-based browser with built-in ad blocking" + "Cursor The AI Code Editor" + "Doom Emacs Emacs framework with curated list of packages" + "Dropbox Sync files across computers with ease" + "Mainline Kernels Install newer Linux kernels than Ubuntu defaults" + "OBS Studio Record screencasts with inputs from both display + webcam" + "Ollama Run LLMs, like Meta's Llama3, locally" + "RubyMine IntelliJ's commercial Ruby editor" + "Spotify Stream music from the world's most popular service" + "Steam Play games from Valve's store" + "VirtualBox Virtual machines to run Windows/Linux" + "Zed Fast all-purpose editor" + "Zoom Attend and host video chat meetings" + "> All Re-run any of the default installers" + "<< Back " ) -CHOICE=$(gum choose "${CHOICES[@]}" --height 19 --header "Install application") +CHOICE=$(gum choose "${CHOICES[@]}" --height 22 --header "Install application") if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then - # Don't install anything - echo "" + # Don't install anything + echo "" elif [[ "$CHOICE" == "> All"* ]]; then - INSTALLER_FILE=$(gum file $OMAKUB_PATH/install) + INSTALLER_FILE=$(gum file $OMAKUB_PATH/install) - [[ -n "$INSTALLER_FILE" ]] && - gum confirm "Run installer?" && - source $INSTALLER_FILE && - gum spin --spinner globe --title "Install completed!" -- sleep 3 + [[ -n "$INSTALLER_FILE" ]] && + gum confirm "Run installer?" && + source $INSTALLER_FILE && + gum spin --spinner globe --title "Install completed!" -- sleep 3 else - INSTALLER=$(echo "$CHOICE" | awk -F ' {2,}' '{print $1}' | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g') + INSTALLER=$(echo "$CHOICE" | awk -F ' {2,}' '{print $1}' | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g') - case "$INSTALLER" in - "dev-language") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-language.sh" ;; - "dev-database") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-storage.sh" ;; - "ollama") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-ollama.sh" ;; - *) INSTALLER_FILE="$OMAKUB_PATH/install/desktop/optional/app-$INSTALLER.sh" ;; - esac + case "$INSTALLER" in + "dev-language") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-language.sh" ;; + "dev-database") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-storage.sh" ;; + "ollama") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-ollama.sh" ;; + *) INSTALLER_FILE="$OMAKUB_PATH/install/desktop/optional/app-$INSTALLER.sh" ;; + esac - source $INSTALLER_FILE && gum spin --spinner globe --title "Install completed!" -- sleep 3 + source $INSTALLER_FILE && gum spin --spinner globe --title "Install completed!" -- sleep 3 fi clear diff --git a/install.sh b/install.sh index 8a535f4..6d51d7b 100644 --- a/install.sh +++ b/install.sh @@ -1,34 +1,32 @@ # Exit immediately if a command exits with a non-zero status 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 +# Ask for app choices +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 + +# Desktop software and tweaks will only be installed if we're running Gnome +if [[ "$XDG_CURRENT_DESKTOP" == *"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 - 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..." -else - echo "Only installing terminal tools..." -fi -# Install terminal tools -source ~/.local/share/omakub/install/terminal.sh + # 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 +else + echo "Only installing terminal tools..." + source ~/.local/share/omakub/install/terminal.sh fi diff --git a/install/check-version.sh b/install/check-version.sh index 1784327..304c538 100644 --- a/install/check-version.sh +++ b/install/check-version.sh @@ -1,18 +1,18 @@ #!/bin/bash if [ ! -f /etc/os-release ]; then - echo "$(tput setaf 1)Error: Unable to determine OS. /etc/os-release file not found." - echo "Installation stopped." - exit 1 + echo "$(tput setaf 1)Error: Unable to determine OS. /etc/os-release file not found." + echo "Installation stopped." + exit 1 fi . /etc/os-release # Check if running on Ubuntu 24.04 or higher if [ "$ID" != "ubuntu" ] || [ $(echo "$VERSION_ID >= 24.04" | bc) != 1 ]; then - echo "$(tput setaf 1)Error: OS requirement not met" - echo "You are currently running: $ID $VERSION_ID" - echo "OS required: Ubuntu 24.04 or higher" - echo "Installation stopped." - exit 1 + echo "$(tput setaf 1)Error: OS requirement not met" + echo "You are currently running: $ID $VERSION_ID" + echo "OS required: Ubuntu 24.04 or higher" + echo "Installation stopped." + exit 1 fi diff --git a/install/desktop.sh b/install/desktop.sh index 85c2006..a7ed1c4 100644 --- a/install/desktop.sh +++ b/install/desktop.sh @@ -1,13 +1,5 @@ -# 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 desktop installers for installer in ~/.local/share/omakub/install/desktop/*.sh; do source $installer; done -# 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 reboot for all settings to take effect?" && sudo reboot diff --git a/install/desktop/app-alacritty.sh b/install/desktop/app-alacritty.sh index 4957733..c6e3a31 100644 --- a/install/desktop/app-alacritty.sh +++ b/install/desktop/app-alacritty.sh @@ -5,3 +5,75 @@ cp ~/.local/share/omakub/configs/alacritty.toml ~/.config/alacritty/alacritty.to cp ~/.local/share/omakub/themes/tokyo-night/alacritty.toml ~/.config/alacritty/theme.toml cp ~/.local/share/omakub/configs/alacritty/fonts/CaskaydiaMono.toml ~/.config/alacritty/font.toml cp ~/.local/share/omakub/configs/alacritty/font-size.toml ~/.config/alacritty/font-size.toml + +# Make alacritty default terminal emulator +sudo update-alternatives --set x-terminal-emulator /usr/bin/alacritty + +# Adding alacritty to nautilus contextual menu requires the python wrapper for the libraries +sudo apt install -y python3-nautilus +mkdir -p ~/.local/share/nautilus-python/extensions/ + +cat > ~/.local/share/nautilus-python/extensions/open-alacritty.py < None: + filename = unquote(file.get_uri()[7:]) + + os.chdir(filename) + os.system("alacritty") + + def menu_activate_cb( + self, + menu: Nautilus.MenuItem, + file: Nautilus.FileInfo, + ) -> None: + self._open_terminal(file) + + def menu_background_activate_cb( + self, + menu: Nautilus.MenuItem, + file: Nautilus.FileInfo, + ) -> None: + self._open_terminal(file) + + def get_file_items( + self, + files: List[Nautilus.FileInfo], + ) -> List[Nautilus.MenuItem]: + if len(files) != 1: + return [] + + file = files[0] + if not file.is_directory() or file.get_uri_scheme() != "file": + return [] + + item = Nautilus.MenuItem( + name="NautilusPython::openterminal_file_item", + label="Open in Alacritty", + tip="Open Alacritty In %s" % file.get_name(), + ) + item.connect("activate", self.menu_activate_cb, file) + + return [ + item, + ] + + def get_background_items( + self, + current_folder: Nautilus.FileInfo, + ) -> List[Nautilus.MenuItem]: + item = Nautilus.MenuItem( + name="NautilusPython::openterminal_file_item2", + label="Open in Alacritty", + tip="Open Alacritty In %s" % current_folder.get_name(), + ) + item.connect("activate", self.menu_background_activate_cb, current_folder) + + return [ + item, + ] +TECHNICALLYNOTACONFIGSOHEREDOCCEDITIS diff --git a/install/desktop/app-obsidian.sh b/install/desktop/app-obsidian.sh index fef1d90..7cf47b7 100644 --- a/install/desktop/app-obsidian.sh +++ b/install/desktop/app-obsidian.sh @@ -1,2 +1,3 @@ # Obsidian is a multi-platform note taking application. See https://obsidian.md +gum spin --spinner meter --title "Obsidian installation about to start. It may take up to 20 minutes on some systems!" -- sleep 3 flatpak install -y flathub md.obsidian.Obsidian diff --git a/install/desktop/optional/app-asdcontrol.sh b/install/desktop/optional/app-asdcontrol.sh new file mode 100644 index 0000000..13d19d8 --- /dev/null +++ b/install/desktop/optional/app-asdcontrol.sh @@ -0,0 +1,15 @@ +# Install asdcontrol +git clone https://github.com/nikosdion/asdcontrol.git /tmp/asdcontrol +cd /tmp/asdcontrol +make +sudo make install +cd - +rm -rf /tmp/asdcontrol + +# Setup sudo-less controls +echo 'KERNEL=="hiddev*", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="9243", GROUP="users", OWNER="root", MODE="0660"' | sudo tee /etc/udev/rules.d/50-apple-xdr.rules >/dev/null +echo 'KERNEL=="hiddev*", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="1114", GROUP="users", OWNER="root", MODE="0660"' | sudo tee /etc/udev/rules.d/50-apple-studio.rules >/dev/null +sudo udevadm control --reload-rules + +# Reboot to pickup changes +gum confirm "Ready to reboot for brightness controls to be available?" && sudo reboot diff --git a/install/desktop/set-gnome-hotkeys.sh b/install/desktop/set-gnome-hotkeys.sh index 02e3569..50d89c5 100644 --- a/install/desktop/set-gnome-hotkeys.sh +++ b/install/desktop/set-gnome-hotkeys.sh @@ -37,11 +37,11 @@ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['5 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['6']" # Reserve slots for custom keybindings -gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/']" +gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/']" # Set ulauncher to Super+Space gsettings set org.gnome.desktop.wm.keybindings switch-input-source "@as []" -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'ulauncher-toggle' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Ulauncher' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'ulauncher-toggle' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'space' @@ -51,11 +51,21 @@ gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/or gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'Print' # Start a new alacritty window (rather than just switch to the already open one) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'alacritty' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'New Alacritty Window' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'alacritty' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '2' # Start a new Chrome window (rather than just switch to the already open one) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ name 'new chrome' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ name 'New Chrome Window' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ command 'google-chrome' gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ binding '1' + +# Turn bightness down on Apple monitor (requires ASDControl installed) +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ name 'Apple Brightness Down (ASDControl)' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ binding 'F1' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ command "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | sed -n \"s|^\(/dev/usb/hiddev[0-9]*\):.*|\1|p\") -- -5000'" + +# Turn bightness up on Apple monitor (requires ADSControl installed) +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ name 'Apple Brightness Up (ASDControl)' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ binding 'F2' +gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ command "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | sed -n \"s|^\(/dev/usb/hiddev[0-9]*\):.*|\1|p\") -- +5000'" diff --git a/install/first-run-choices.sh b/install/first-run-choices.sh index dc6964c..b10e0da 100644 --- a/install/first-run-choices.sh +++ b/install/first-run-choices.sh @@ -1,6 +1,9 @@ -OPTIONAL_APPS=("1password" "Spotify" "Zoom" "Dropbox") -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 ' ' '-') +# Only ask for default desktop app choices when running Gnome +if [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]]; then + OPTIONAL_APPS=("1password" "Spotify" "Zoom" "Dropbox") + 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 ' ' '-') +fi AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java") SELECTED_LANGUAGES="Ruby on Rails","Node.js" diff --git a/install/terminal/app-neovim.sh b/install/terminal/app-neovim.sh index b61e9a9..569e8f7 100644 --- a/install/terminal/app-neovim.sh +++ b/install/terminal/app-neovim.sh @@ -7,26 +7,26 @@ sudo cp -R nvim-linux-x86_64/share /usr/local/ rm -rf nvim-linux-x86_64 nvim.tar.gz cd - -# Install luarocks and tree-sitter-cli to resolve lazyvim :checkheatlh warnings +# Install luarocks and tree-sitter-cli to resolve lazyvim :checkhealth warnings sudo apt install -y luarocks tree-sitter-cli # Only attempt to set configuration if Neovim has never been run if [ ! -d "$HOME/.config/nvim" ]; then - # Use LazyVim - git clone https://github.com/LazyVim/starter ~/.config/nvim - # Remove the .git folder, so you can add it to your own repo later - rm -rf ~/.config/nvim/.git + # Use LazyVim + git clone https://github.com/LazyVim/starter ~/.config/nvim + # Remove the .git folder, so you can add it to your own repo later + rm -rf ~/.config/nvim/.git - # Make everything match the terminal transparency - mkdir -p ~/.config/nvim/plugin/after - cp ~/.local/share/omakub/configs/neovim/transparency.lua ~/.config/nvim/plugin/after/ + # Make everything match the terminal transparency + mkdir -p ~/.config/nvim/plugin/after + cp ~/.local/share/omakub/configs/neovim/transparency.lua ~/.config/nvim/plugin/after/ - # Default to Tokyo Night theme - cp ~/.local/share/omakub/themes/tokyo-night/neovim.lua ~/.config/nvim/lua/plugins/theme.lua + # Default to Tokyo Night theme + cp ~/.local/share/omakub/themes/tokyo-night/neovim.lua ~/.config/nvim/lua/plugins/theme.lua fi # Replace desktop launcher with one running inside Alacritty if [[ -d ~/.local/share/applications ]]; then - sudo rm -rf /usr/share/applications/nvim.desktop - source ~/.local/share/omakub/applications/Neovim.sh + sudo rm -rf /usr/share/applications/nvim.desktop + source ~/.local/share/omakub/applications/Neovim.sh fi diff --git a/install/terminal/optional/app-mainline-kernels.sh b/install/terminal/optional/app-mainline-kernels.sh new file mode 100644 index 0000000..bb924c9 --- /dev/null +++ b/install/terminal/optional/app-mainline-kernels.sh @@ -0,0 +1,3 @@ +sudo add-apt-repository ppa:cappelikan/ppa +sudo apt update -y +sudo apt install -y mainline diff --git a/install/terminal/select-dev-language.sh b/install/terminal/select-dev-language.sh index b325d8a..fe84952 100644 --- a/install/terminal/select-dev-language.sh +++ b/install/terminal/select-dev-language.sh @@ -1,45 +1,45 @@ # Install default programming languages if [[ -v OMAKUB_FIRST_RUN_LANGUAGES ]]; then - languages=$OMAKUB_FIRST_RUN_LANGUAGES + languages=$OMAKUB_FIRST_RUN_LANGUAGES else - AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java") - languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages") + AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java") + languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages") fi if [[ -n "$languages" ]]; then - for language in $languages; do - case $language in - Ruby) - mise use --global ruby@3.4 - mise x ruby -- gem install rails --no-document - ;; - Node.js) - mise use --global node@lts - ;; - Go) - mise use --global go@latest - ;; - PHP) - sudo add-apt-repository -y ppa:ondrej/php - sudo apt -y install php8.4 php8.4-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip} - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer - rm composer-setup.php - ;; - Python) - mise use --global python@latest - ;; - Elixir) - mise use --global erlang@latest - mise use --global elixir@latest - mise x elixir -- mix local.hex --force - ;; - Rust) - bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y - ;; - Java) - mise use --global java@latest - ;; - esac - done + for language in $languages; do + case $language in + Ruby) + mise use --global ruby@latest + mise x ruby -- gem install rails --no-document + ;; + Node.js) + mise use --global node@lts + ;; + Go) + mise use --global go@latest + ;; + PHP) + sudo add-apt-repository -y ppa:ondrej/php + sudo apt -y install php8.4 php8.4-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip} + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + php composer-setup.php --quiet && sudo mv composer.phar /usr/local/bin/composer + rm composer-setup.php + ;; + Python) + mise use --global python@latest + ;; + Elixir) + mise use --global erlang@latest + mise use --global elixir@latest + mise x elixir -- mix local.hex --force + ;; + Rust) + bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y + ;; + Java) + mise use --global java@latest + ;; + esac + done fi diff --git a/uninstall/app-mainline-kernels.sh b/uninstall/app-mainline-kernels.sh new file mode 100644 index 0000000..c76210a --- /dev/null +++ b/uninstall/app-mainline-kernels.sh @@ -0,0 +1 @@ +sudo apt remove -y mainline diff --git a/uninstall/dev-language.sh b/uninstall/dev-language.sh new file mode 100644 index 0000000..0ce299d --- /dev/null +++ b/uninstall/dev-language.sh @@ -0,0 +1,42 @@ +# Uninstall default programming languages +if [[ -v OMAKUB_FIRST_RUN_LANGUAGES ]]; then + languages=$OMAKUB_FIRST_RUN_LANGUAGES +else + AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java") + languages=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --height 10 --header "Select programming languages to uninstall") +fi + +if [[ -n $languages ]]; then + for language in $languages; do + case $language in + Ruby) + mise uninstall ruby@3.4 + mise x ruby -- gem uninstall rails + ;; + Node.js) + mise uninstall node@lts + ;; + Go) + mise uninstall go@latest + ;; + PHP) + sudo apt -y purge php8.4 php8.4-{curl,apcu,intl,mbstring,opcache,pgsql,mysql,sqlite3,redis,xml,zip} + sudo add-apt-repository -y --remove ppa:ondrej/php + sudo rm /usr/local/bin/composer + ;; + Python) + mise uninstall python@latest + ;; + Elixir) + mise uninstall elixir@latest + mise uninstall erlang@latest + ;; + Rust) + rustup self uninstall -y + ;; + Java) + mise uninnstall java@latest + ;; + esac + done +fi diff --git a/uninstall/php.sh b/uninstall/php.sh deleted file mode 100644 index da7db13..0000000 --- a/uninstall/php.sh +++ /dev/null @@ -1,4 +0,0 @@ -sudo apt -y purge "php8.3*" -sudo add-apt-repository -y --remove ppa:ondrej/php - -sudo rm /usr/local/bin/composer diff --git a/uninstall/rust.sh b/uninstall/rust.sh deleted file mode 100644 index 93dcd9d..0000000 --- a/uninstall/rust.sh +++ /dev/null @@ -1 +0,0 @@ -rustup self uninstall -y