Changed tio installation

This commit is contained in:
MDietermann
2026-04-09 08:07:09 +02:00
parent fc42277ab9
commit 63b30b6953

View File

@@ -15,7 +15,10 @@ NC='\033[0m'
info() { echo -e "${GREEN}[✓]${NC} $1"; } info() { echo -e "${GREEN}[✓]${NC} $1"; }
warn() { echo -e "${YELLOW}[!]${NC} $1"; } warn() { echo -e "${YELLOW}[!]${NC} $1"; }
error() { echo -e "${RED}[✗]${NC} $1"; exit 1; } error() {
echo -e "${RED}[✗]${NC} $1"
exit 1
}
step() { echo -e "\n${GREEN}━━━ $1 ━━━${NC}"; } step() { echo -e "\n${GREEN}━━━ $1 ━━━${NC}"; }
# ── Detect environment ────────────────────────────────────────── # ── Detect environment ──────────────────────────────────────────
@@ -49,7 +52,15 @@ step "1/9 — Installing base packages"
if $IS_ARCH; then if $IS_ARCH; then
sudo pacman -Syu --noconfirm sudo pacman -Syu --noconfirm
$PKG_INSTALL base-devel git curl unzip wget ripgrep fd bat eza tree jq zsh clang tio $PKG_INSTALL base-devel git curl unzip wget ripgrep fd bat eza tree jq zsh clang
# tio is in AUR — install yay if needed, then tio
if ! command -v yay &>/dev/null; then
info "Installing yay (AUR helper)..."
git clone https://aur.archlinux.org/yay.git /tmp/yay
(cd /tmp/yay && makepkg -si --noconfirm)
rm -rf /tmp/yay
fi
yay -S --needed --noconfirm tio
else else
sudo apt update && sudo apt upgrade -y sudo apt update && sudo apt upgrade -y
$PKG_INSTALL build-essential git curl unzip wget ripgrep bat eza tree jq zsh clang-format tio $PKG_INSTALL build-essential git curl unzip wget ripgrep bat eza tree jq zsh clang-format tio
@@ -62,7 +73,7 @@ info "Base packages installed"
step "2/9 — Setting up Zsh" step "2/9 — Setting up Zsh"
if [[ ! -d "$HOME/.oh-my-zsh" ]]; then if [[ ! -d "$HOME/.oh-my-zsh" ]]; then
RUNZSH=no KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" || \ RUNZSH=no KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ||
RUNZSH=no KEEP_ZSHRC=yes sh -c "$(curl -kfsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" RUNZSH=no KEEP_ZSHRC=yes sh -c "$(curl -kfsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
info "Oh My Zsh installed" info "Oh My Zsh installed"
else else
@@ -71,10 +82,10 @@ fi
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}" ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
[[ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]] && \ [[ ! -d "$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]] &&
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions" git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
[[ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]] && \ [[ ! -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]] &&
git clone https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" git clone https://github.com/zsh-users/zsh-syntax-highlighting "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
info "Zsh plugins installed" info "Zsh plugins installed"
@@ -92,7 +103,7 @@ fi
info "Starship installed" info "Starship installed"
mkdir -p ~/.config mkdir -p ~/.config
cat > ~/.config/starship.toml << 'STARSHIP' cat >~/.config/starship.toml <<'STARSHIP'
palette = "gruvbox_dark" palette = "gruvbox_dark"
format = """$directory$git_branch$git_status$character""" format = """$directory$git_branch$git_status$character"""
@@ -137,7 +148,7 @@ info "Zellij installed"
mkdir -p ~/.config/zellij/layouts mkdir -p ~/.config/zellij/layouts
cat > ~/.config/zellij/config.kdl << 'ZELLIJ_CFG' cat >~/.config/zellij/config.kdl <<'ZELLIJ_CFG'
theme "gruvbox-dark" theme "gruvbox-dark"
default_layout "default" default_layout "default"
default_mode "normal" default_mode "normal"
@@ -175,7 +186,7 @@ themes {
} }
ZELLIJ_CFG ZELLIJ_CFG
cat > ~/.config/zellij/layouts/arduino.kdl << 'LAYOUT' cat >~/.config/zellij/layouts/arduino.kdl <<'LAYOUT'
layout { layout {
tab name="code" focus=true { tab name="code" focus=true {
pane split_direction="vertical" { pane split_direction="vertical" {
@@ -238,7 +249,7 @@ fi
mkdir -p ~/.config/nvim/lua/plugins mkdir -p ~/.config/nvim/lua/plugins
cat > ~/.config/nvim/lua/plugins/gruvbox.lua << 'LUA' cat >~/.config/nvim/lua/plugins/gruvbox.lua <<'LUA'
return { return {
{ {
"ellisonleao/gruvbox.nvim", "ellisonleao/gruvbox.nvim",
@@ -254,7 +265,7 @@ return {
} }
LUA LUA
cat > ~/.config/nvim/lua/plugins/arduino.lua << 'LUA' cat >~/.config/nvim/lua/plugins/arduino.lua <<'LUA'
return { return {
{ {
"stevearc/vim-arduino", "stevearc/vim-arduino",
@@ -281,7 +292,7 @@ return {
} }
LUA LUA
cat > ~/.config/nvim/lua/plugins/lsp.lua << 'LUA' cat >~/.config/nvim/lua/plugins/lsp.lua <<'LUA'
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
@@ -350,7 +361,7 @@ fi
info "Lazygit installed" info "Lazygit installed"
mkdir -p ~/.config/lazygit mkdir -p ~/.config/lazygit
cat > ~/.config/lazygit/config.yml << 'LAZYGIT' cat >~/.config/lazygit/config.yml <<'LAZYGIT'
gui: gui:
theme: theme:
activeBorderColor: activeBorderColor:
@@ -372,7 +383,7 @@ step "9/9 — Creating project scaffolding tool"
mkdir -p ~/.local/bin ~/.config/archduino/templates mkdir -p ~/.local/bin ~/.config/archduino/templates
cat > ~/.local/bin/arduino-new << 'SCAFFOLD' cat >~/.local/bin/arduino-new <<'SCAFFOLD'
#!/bin/bash #!/bin/bash
set -e set -e
@@ -441,7 +452,7 @@ SCAFFOLD
chmod +x ~/.local/bin/arduino-new chmod +x ~/.local/bin/arduino-new
# Templates # Templates
cat > ~/.config/archduino/templates/default.ino << 'INO' cat >~/.config/archduino/templates/default.ino <<'INO'
void setup() { void setup() {
Serial.begin(115200); Serial.begin(115200);
while (!Serial) { ; } while (!Serial) { ; }
@@ -453,7 +464,7 @@ void loop() {
} }
INO INO
cat > ~/.config/archduino/templates/esp32.ino << 'INO' cat >~/.config/archduino/templates/esp32.ino <<'INO'
#include <WiFi.h> #include <WiFi.h>
const char* ssid = "YOUR_SSID"; const char* ssid = "YOUR_SSID";
@@ -478,7 +489,7 @@ void loop() {
} }
INO INO
cat > ~/.config/archduino/templates/esp8266.ino << 'INO' cat >~/.config/archduino/templates/esp8266.ino <<'INO'
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
const char* ssid = "YOUR_SSID"; const char* ssid = "YOUR_SSID";
@@ -509,7 +520,7 @@ step "Finalizing shell config"
# Append archduino block to .zshrc if not already present # Append archduino block to .zshrc if not already present
if ! grep -q "ARCHDUINO" ~/.zshrc 2>/dev/null; then if ! grep -q "ARCHDUINO" ~/.zshrc 2>/dev/null; then
cat >> ~/.zshrc << 'ZSHRC' cat >>~/.zshrc <<'ZSHRC'
# ── ARCHDUINO CONFIG ──────────────────────────────────────────── # ── ARCHDUINO CONFIG ────────────────────────────────────────────
plugins=(git zsh-autosuggestions zsh-syntax-highlighting) plugins=(git zsh-autosuggestions zsh-syntax-highlighting)