将脚本移至 scripts/ 目录,保持仓库根目录整洁

This commit is contained in:
2026-03-25 14:37:00 +08:00
parent 74c1175264
commit bfb4d5b3d0
3 changed files with 3 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -euo pipefail
REPO_URL="https://git.furtherverse.com/imbytecat/archlinux-config.git"
CONFIG_DIR="$HOME/.config/arch-config"
echo "==> 更新系统..."
sudo pacman -Syu --noconfirm
echo "==> 安装基础工具..."
sudo pacman -S --needed --noconfirm base-devel git
echo "==> 安装 yay..."
if ! command -v yay &> /dev/null; then
rm -rf /tmp/yay
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay
makepkg -si --noconfirm
fi
echo "==> 安装 dcli..."
yay -S --needed --noconfirm dcli-arch-git
echo "==> 克隆配置仓库..."
rm -rf "$CONFIG_DIR"
git clone "$REPO_URL" "$CONFIG_DIR"
echo ""
echo "✓ 安装完成!"
echo ""
echo "下一步:运行 dcli sync 应用配置"
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo "请以 root 身份运行此脚本"
exit 1
fi
USERNAME="${1:-}"
if [ -z "$USERNAME" ]; then
echo "用法: ./root-setup.sh <用户名>"
echo "示例: ./root-setup.sh imbytecat"
exit 1
fi
echo "==> 安装 sudo..."
pacman -Syu --noconfirm sudo
echo "==> 创建用户 $USERNAME..."
if id "$USERNAME" &> /dev/null; then
echo "用户 $USERNAME 已存在,跳过创建"
else
useradd -m -G wheel -s /bin/bash "$USERNAME"
echo "请设置 $USERNAME 的密码:"
passwd "$USERNAME" < /dev/tty
fi
echo "==> 配置 WSL 默认用户..."
cat > /etc/wsl.conf << EOF
[user]
default = $USERNAME
EOF
echo ""
echo "✓ 初始化完成!"
echo ""
echo "下一步:"
echo " 1. 在 PowerShell 中执行: wsl --terminate archlinux"
echo " 2. 重新打开 Arch WSL(将以 $USERNAME 身份登录)"
echo " 3. 运行: curl -fsSL https://git.furtherverse.com/imbytecat/archlinux-config/raw/branch/main/scripts/install.sh | bash"