feat(dotfiles: install refactoring

This commit is contained in:
Anael Ginder
2026-09-18 11:14:56 +02:00
parent 23e06197e6
commit 1ba23c477f
3 changed files with 108 additions and 46 deletions
+17
View File
@@ -4,6 +4,7 @@ keybinds {
// uncomment this and adjust key if using copy_on_select=false // uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; } // bind "Alt c" { Copy; }
} }
locked { locked {
bind "Ctrl g" { SwitchToMode "Normal"; } bind "Ctrl g" { SwitchToMode "Normal"; }
} }
@@ -141,6 +142,22 @@ keybinds {
bind "Alt k" "Alt Up" { MoveFocus "Up"; } bind "Alt k" "Alt Up" { MoveFocus "Up"; }
bind "Alt =" "Alt +" { Resize "Increase"; } bind "Alt =" "Alt +" { Resize "Increase"; }
bind "Alt -" { Resize "Decrease"; } bind "Alt -" { Resize "Decrease"; }
bind "Alt m" {
LaunchPlugin "file:~/.config/zellij/plugins/monocle.wasm" {
in_place true;
kiosk true;
};
SwitchToMode "Normal";
}
bind "Alt f" {
LaunchPlugin "filepicker" {
// floating true // uncomment this to have the filepicker opened in a floating window
// close_on_selection true // comment this out to have the filepicker remain open even after selecting a file
};
}
} }
shared_except "normal" "locked" { shared_except "normal" "locked" {
bind "Enter" "Esc" { SwitchToMode "Normal"; } bind "Enter" "Esc" { SwitchToMode "Normal"; }
+10 -3
View File
@@ -9,14 +9,21 @@ layout {
} }
} }
tab name="keeper" { tab name="ssh" {
pane split_direction="vertical" { pane split_direction="vertical" {
pane borderless=false command="keeper" { pane borderless=false command="keeper" {
args "ssh-agent start" args "ssh-agent start"
} }
} }
} }
tab name="IDE" {
pane split_direction="vertical" {
pane size="20%" {
plugin location="zellij:strider"
}
pane
}
}
tab name="Main" { tab name="Main" {
pane split_direction="vertical" { pane split_direction="vertical" {
pane pane
+80 -42
View File
@@ -1,59 +1,97 @@
#!/bin/bash #!/bin/bash
set -eu set -euo pipefail
#Install dep SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo '[*] Install apt requierements ...' DOTFILES_DIR="$SCRIPT_DIR/../dotfiles"
log() { echo "[*] $*"; }
err() { echo "Erreur: $*" >&2; }
# usage: stow_config <nom_package_dotfiles> <répertoire_cible>
# Si le répertoire cible existe déjà, on ne touche à rien (idempotence
# non-destructive) : on suppose que la config est déjà en place.
stow_config() {
local package="$1"
local target="$2"
if [ -e "$target" ]; then
log "Config déjà présente ($target), on ne touche à rien. Skip."
return
fi
mkdir -p "$target"
log "Stow du package '$package' vers $target ..."
(cd "$DOTFILES_DIR" && stow -vSt "$target" "$package")
}
# --- 1. Dépendances système ---
log "Mise à jour des paquets apt ..."
sudo apt update
log "Installation des dépendances apt ..."
sudo apt -y install apt-transport-https curl gnupg stow zsh sudo apt -y install apt-transport-https curl gnupg stow zsh
# test if rust is installed # --- 2. Rust / cargo ---
if ! [ -x "$(command -v cargo)" ]; then if ! command -v cargo >/dev/null 2>&1; then
echo 'Error: cargo is not installed.' log "cargo introuvable, installation de rustup ..."
echo '[*] Install rust ...' curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi fi
#Install Zellij if [ -f "$HOME/.cargo/env" ]; then
echo '[*] Install zellij' # shellcheck disable=SC1091
cargo install zellij source "$HOME/.cargo/env"
fi
echo '[*] Removing default configurations ...' if ! command -v cargo >/dev/null 2>&1; then
rm -rf ~/.config/zellij err "cargo toujours introuvable après installation, abandon."
exit 1
fi
echo '[*] Creating plugin directory' # --- 3. Zellij + sa config ---
mkdir ~/.config/zellij log "Installation de zellij ..."
cargo install --locked zellij
echo '[*] Stowing/Creating simlinks for zellij' stow_config "zellij" "$HOME/.config/zellij"
cd ../dotfiles && stow -vSt ~/.config/zellij zellij && cd ../install
# --- 4. Zsh perso ---
# Le fichier reste nommé "zshrc.perso" (sans point) dans le dépôt dotfiles,
# mais on veut un symlink caché ~/.zshrc.perso. stow ne permet pas ce
# renommage nativement (sauf convention "dot-" qu'on ne veut pas imposer
# au dépôt), donc on crée le symlink manuellement.
ZSHRC_PERSO_SRC="$DOTFILES_DIR/zsh/zshrc.perso"
ZSHRC_PERSO_DEST="$HOME/.zshrc.perso"
#Zsh Perso if [ -e "$ZSHRC_PERSO_DEST" ] || [ -L "$ZSHRC_PERSO_DEST" ]; then
echo '[*] Stowing/Creating simlinks for zellij' log "$ZSHRC_PERSO_DEST existe déjà, on ne touche à rien. Skip."
cd ../dotfiles && stow -vSt ~/.zshrc.perso zshrc.perso && cd ../install else
if [ ! -f "$ZSHRC_PERSO_SRC" ]; then
err "Fichier source introuvable : $ZSHRC_PERSO_SRC"
exit 1
fi
log "Création du symlink $ZSHRC_PERSO_DEST -> $ZSHRC_PERSO_SRC ..."
ln -s "$ZSHRC_PERSO_SRC" "$ZSHRC_PERSO_DEST"
fi
#Install Spaceship a zsh module # --- 5. Spaceship (prompt zsh) ---
mkdir -p "$HOME/.zsh" SPACESHIP_DIR="$HOME/.zsh/spaceship-prompt"
rm -rf "$HOME/.zsh/spaceship"
git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git "$HOME/.zsh/spaceship"
echo '[*] Removing default configurations ...' if [ -d "$SPACESHIP_DIR/.git" ]; then
rm -rf ~/.config/spaceship log "Spaceship (upstream) déjà présent, mise à jour ..."
git -C "$SPACESHIP_DIR" pull --ff-only
elif [ -e "$SPACESHIP_DIR" ]; then
log "$SPACESHIP_DIR existe mais n'est pas un dépôt git, on ne touche à rien. Skip."
else
log "Installation de spaceship (clone upstream) ..."
mkdir -p "$HOME/.zsh"
git clone --depth=1 https://github.com/spaceship-prompt/spaceship-prompt.git "$SPACESHIP_DIR"
fi
echo '[*] Creating plugin directory' stow_config "spaceship" "$HOME/.config/spaceship"
mkdir ~/.config/spaceship
echo '[*] Stowing/Creating simlinks for spaceship' # --- 6. Outils Rust additionnels ---
cd ../dotfiles && stow -vSt ~/.config/spaceship spaceship && cd ../install log "Installation des outils Rust (bat, bottom, diskus, procs, cargo-update) ..."
cargo install --locked bat bottom diskus procs cargo-update
##Installation de programme rust log "Installation terminée avec succès."
# Rust cool stuff
echo '[*] Install bat'
cargo install bat
echo '[*] Install bottom'
cargo install bottom
echo '[*] Install diskus'
cargo install diskus
echo '[*] Install procs'
cargo install procs
echo '[*] Install cargo-update'
cargo install cargo-update