diff options
| author | silly <u65487754@gmail.com> | 2026-03-30 21:31:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-30 21:31:41 +0200 |
| commit | 764396c1d46edee08cc366130a7f8b850e16a06f (patch) | |
| tree | aa9dbad7e2c7538020297b0c4310c2165ac6cb88 /silly.sh | |
| parent | 1c0013e71ddb3e1cb681b7e71bf48044bd2c9bba (diff) | |
Update silly.sh
Diffstat (limited to 'silly.sh')
| -rw-r--r-- | silly.sh | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -3,7 +3,6 @@ set -euo pipefail REPO_URL="https://github.com/x2p3lnk7tq9z/dotfiles.git" -DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}" PACMAN_PKGS=( hyprland @@ -24,7 +23,7 @@ PACMAN_PKGS=( AUR_PKGS=( zed awww - pywal16 + python-pywal16 ) [[ $EUID -eq 0 ]] && { echo "do not run as root"; exit 1; } @@ -41,23 +40,28 @@ fi yay -S --needed --noconfirm "${AUR_PKGS[@]}" -if [[ -d "$DOTFILES_DIR/.git" ]]; then - git -C "$DOTFILES_DIR" pull --ff-only &>/dev/null -else - git clone --depth=1 "$REPO_URL" "$DOTFILES_DIR" &>/dev/null -fi +tmp=$(mktemp -d) +git clone --depth=1 "$REPO_URL" "$tmp/dotfiles" &>/dev/null mkdir -p "$HOME/.config" -for src in "$DOTFILES_DIR/.config"/*/; do +for src in "$tmp/dotfiles/.config"/*/; do name="$(basename "$src")" dst="$HOME/.config/$name" [[ -e "$dst" || -L "$dst" ]] && rm -rf "$dst" cp -r "$src" "$dst" done -if [[ -d "$DOTFILES_DIR/.config/scripts" ]]; then - find "$DOTFILES_DIR/.config/scripts" -type f | xargs chmod +x +if [[ -d "$tmp/dotfiles/.config/scripts" ]]; then + find "$HOME/.config/scripts" -type f | xargs chmod +x fi +mkdir -p "$HOME/.config/wallpaper" +find "$tmp/dotfiles/wallpaper" -maxdepth 1 -type f \( -iname "*.jpg" -o -iname "*.png" \) | while read -r img; do + cp "$img" "$HOME/.config/wallpaper/" +done + +rm -rf "$tmp" + +hyprctl reload &>/dev/null echo "dotfiles installed" |
