My dotfiles, keep it simple.
安装 Bash 配置(适用于服务器):
curl -sSL https://s.e5n.cc/dotfiles | bash -s -- bash安装 Zsh 配置(适用于桌面/开发环境):
# sudo apt update && sudo apt install -y zsh
# chsh -s /bin/zsh
curl -sSL https://s.e5n.cc/dotfiles | bash -s -- zsh克隆仓库后运行:
# 克隆仓库
git clone https://github.com/eallion/dotfiles.git
cd dotfiles
# 安装 bash 配置
./install.sh bash
# 安装 zsh 配置
# sudo apt update && sudo apt install -y zsh
# chsh -s /bin/zsh
./install.sh zsh共同特性:
- 统一别名管理:
~/.aliases跨 Shell 共享,一致的操作体验。 - 现代化工具链:集成
eza(Better ls),bat(Better cat),btop,zoxide(Smart cd)。 - 安全防护:
mv/cp/rm增加安全提示,rm自动关联trash-cli。 - sudo 免密码配置 (可选)。
- 安装 Starship 及 Gruvbox Rainbow Preset。
- 可选安装 Git, Alacritty, Kitty 配置。
ZSH 特性 (Desktop/Dev):
- Zinit 引擎:使用最快的 Zinit 插件管理器,极速启动。
- Modern Experience:
- FZF-Tab:实时预览补全内容 (ls, ps, kill, docker 等)。
- Alias Tip:当你输入长命令时提醒你使用别名 (
zsh-you-should-use)。
- Turbo Mode:
nvm,docker,gh等重型插件延迟加载,不拖慢启动。 - Plugins:
zsh-autosuggestions,fast-syntax-highlighting,history-substring-search,extract,sudo等。
Bash 特性 (Server):
- Oh My Bash:轻量级管理。
- Lazy Load:
nvm/node/npm仅在首次使用时加载,确保秒开。 - 工具对齐:服务器环境同样配置了
eza,bat,fzf等工具,保持与 Zsh 一致的手感。
以下内容由 setup.sh 自动处理,仅供参考。
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
curl -sSL https://raw.githubusercontent.com/eallion/dotfiles/refs/heads/main/.bashrc -o "$HOME/.bashrc"curl -sS https://starship.rs/install.sh | sh
starship preset gruvbox-rainbow -o ~/.config/starship.toml
sed -i '1s/^/eval "$(starship init bash)"\n/' ~/.bashrc
source ~/.bashrcwget https://github.com/SpaceTimee/Fusion-JetBrainsMapleMono/releases/latest/download/JetBrainsMapleMono-NF-XX-XX.zip
unzip JetBrainsMapleMono-NF-XX-XX.zip
mkdir -p ~/.fonts
mv *.ttf ~/.fonts/
rm JetBrainsMapleMono-NF-XX-XX.zip LICENSE.txt
fc-cache -f -vwget https://github.com/atelier-anchor/smiley-sans/releases/download/v2.0.1/smiley-sans-v2.0.1.zip
unzip smiley-sans-v2.0.1.zip
mkdir -p ~/.fonts
mv SmileySans-* ~/.fonts
rm smiley-sans-v2.0.1.zip
fc-cache -f -vsudo apt install fcitx5 fcitx5-rime fcitx5-configtool fcitx5-chinese-addons fcitx5-frontend-all im-config
git clone https://github.com/rime/plum.git
cd plum
rime_frontend=fcitx5-rime bash rime-install --select :all lotem/rime-forge/lotem-packages.conf
# pick: 16 21 12 .
fcitx5-configtool
# Add 中州韵
# Customize
wget https://raw.githubusercontent.com/eallion/dotfiles/refs/heads/main/.local/share/fcitx5/rime/custom_phrase.txt -O ~/.local/share/fcitx5/rime/custom_phrase.txt
wget https://raw.githubusercontent.com/eallion/dotfiles/refs/heads/main/.local/share/fcitx5/rime/default.custom.yaml -O ~/.local/share/fcitx5/rime/default.custom.yaml
wget https://raw.githubusercontent.com/eallion/dotfiles/refs/heads/main/.local/share/fcitx5/rime/wubi_pinyin.custom.yaml -O ~/.local/share/fcitx5/rime/wubi_pinyin.custom.yaml
# Redeploy Rime
# Install Kimpanel: https://extensions.gnome.org/extension/261/kimpanelhttps://github.com/Schniz/fnm
Fast Node Manager, nodejs-lts, npm, pnpm
curl -fsSL https://fnm.vercel.app/install | bash
# 添加到 shell 配置
echo 'export PATH="$HOME/.local/share/fnm:$PATH"' >> ~/.bashrc
echo 'eval "$(fnm env)"' >> ~/.bashrc
# 重新加载配置
source ~/.bashrc
# 安装 Node.js LTS
fnm install --lts
fnm use lts/latest
# 安装 pnpm
npm install -g pnpm# 使用官方安装脚本
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# 添加用户到 docker 组
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
# 配置 Docker 服务(可选)
sudo systemctl disable docker.service
sudo systemctl disable docker.socket
sudo systemctl disable containerd.service# 安装 UFW
sudo apt-get install -y ufw
# 配置默认策略
sudo ufw default deny incoming
sudo ufw default allow outgoing
# 允许 SSH
sudo ufw allow ssh
# 启用 UFW
sudo ufw --force enable
# 查看状态
sudo ufw status# 下载 ufw-docker 脚本
sudo wget -O /usr/local/bin/ufw-docker https://github.com/chaifeng/ufw-docker/raw/master/ufw-docker
sudo chmod +x /usr/local/bin/ufw-docker
# 配置 UFW Docker 规则
sudo tee -a /etc/ufw/after.rules > /dev/null <<EOF
# ufw-docker
*filter
:ufw-user-forward - [0:0]
:DOCKER-USER - [0:0]
-A DOCKER-USER -j UFW-USER-FORWARD
-A UFW-USER-FORWARD -j RETURN -s 10.0.0.0/8
-A UFW-USER-FORWARD -j RETURN -s 172.16.0.0/12
-A UFW-USER-FORWARD -j RETURN -s 192.168.0.0/16
-A UFW-USER-FORWARD -p tcp -d 127.0.0.1 --dport 2375 -j RETURN
-A UFW-USER-FORWARD -p tcp -d 127.0.0.1 --dport 2376 -j RETURN
COMMIT
EOF
# 重新加载 UFW
sudo ufw reload
# 使用示例
ufw-docker allow nginx
ufw-docker allow mysql# 下载并安装 Ghostty (根据你的系统选择合适的包)
# Ubuntu/Debian:
curl -fsSL https://github.com/ghostty-org/ghostty/releases/latest/download/ghostty_amd64.deb -o ghostty.deb
sudo dpkg -i ghostty.deb
# 或者从源码编译 (需要 Go)
git clone https://github.com/ghostty-org/ghostty
cd ghostty
sudo apt install libgtk-4-dev libadwaita-1-dev
go build -o ghostty ./cmd/ghostty
# 配置 Ghostty
mkdir -p ~/.config/ghostty
# 下载配置文件
curl -fsSL https://raw.githubusercontent.com/eallion/dotfiles/main/.config/ghostty/config.ghostty -o ~/.config/ghostty/config.ghostty
curl -fsSL https://raw.githubusercontent.com/eallion/dotfiles/main/.config/ghostty/auto/theme.ghostty -o ~/.config/ghostty/auto/theme.ghostty