@see https://dotfiles.github.io/
888 888 .d888 d8b 888
888 888 d88P" Y8P 888
888 888 888 888
.d88888 .d88b. 888888 888888 888 888 .d88b. .d8888b
d88" 888 d88""88b 888 888 888 888 d8P Y8b 88K
888 888 888 888 888 888 888 888 88888888 "Y8888b.
Y88b 888 Y88..88P Y88b. 888 888 888 Y8b. X88
"Y88888 "Y88P" "Y888 888 888 888 "Y8888 88888P'
Those make my Linux unique.
我真的很喜欢用各种可能的方式来配置我的系统。这个 repo 保存了我的原始配置。如果你刚开始,你可以用我的(我不在乎,也不介意)。
dotfile 就是你的那些 dot 开头的配置文件,比如说 .vim .vimrc .emacs.d .bashrc 。
命令行工具们有一个约定俗成的习惯:把配置文件写到用户的 Home 目录下面的隐藏文件里。系统用的时间一长,这样的文件就有一堆,有些你编辑过了,有些没有,并且你都不知道里面有些什么。先来看一下你有多少个这样的文件吧:
ls -ald ~/.* | grep -v ^l | tee >(wc -l)也许你已经想到了一千种方法来折腾它们。在用户目录下面 git init 一下?这可不是什么好主意。把它们手工复制到某个地方然后手工 ln -s 回来?这也太麻烦了。然而我们现在有个叫 stow 的工具可以自动化处理这一切。
GNU stow 本来是为了用于管理软件包安装以及多版本共存的一个程序。它做的主要工作就是根据目录来自动建立软链接。这样就正好满足了我们的需求。首先把所有的配置文件复制到某个文件夹去,然后运行一下 stow ,它们就自动链接好了。
这样还是有些太烦了。所以 James Swineson 写了个 Bash 函数来自动处理这一切。
export DOTFILES=~/dotfiles
dotfiles-count() {
pushd >/dev/null 2>&1
cd $HOME
ls -ald .* | grep -v ^l | tee >(wc -l)
popd >/dev/null 2>&1
}
dotfiles-init() {
pushd >/dev/null 2>&1
cd $HOME
ls -ald .$1*;
mkdir -p $DOTFILES/$1;
mv .$1* $DOTFILES/$1;
stow --dir=$DOTFILES --target=$HOME -vv $1
popd >/dev/null 2>&1
}
dotfiles-rebuild() {
stow --dir=$DOTFILES --target=$HOME -vv $@
}比如我们要处理来自 vim 的配置文件,只需要运行 dotfiles-init vim ,一切就自动完成。想用 Git 管理配置文件?没问题,去 $DOTFILES 下面 git init 一下。想用网盘同步?没问题,把 $DOTFILES 设置到你的网盘目录下面。想移动你的存放目录,或者在另一台机器上恢复配置?没问题,改下 $DOTFILES 然后运行 dotfiles-rebuild * 就好(如果你关掉了 Shell 并且没链接配置文件,那么祝贺你作死成功……)。
这样是不是干净多了呢?
如果把 $HOME/dotfiles 下的文件 cp 到 $HOME 下的话,我必须自己去同步这两个目录。改了前者,需要同步到后者;改了后者,需要同步到前者。忘了同步的话,我会奇怪自己的改动怎么不起作用;搞错同步的方向的话,我会哭鼻子。
用 symlink 的话,基本上没有这个问题。
store configuration files in ~/.dotfiles folder and symlink them to ~
$ cd ~/.dotfiles $ tree -a -L 2 . ├── dotfiles.sh ├── i3wm │ ├── .config │ ├── .conky │ ├── .conkyrc │ └── .i3 ├── shell │ ├── .oh-my-zsh │ ├── .zshrc │ ├── ... ...
这是一个使用 GNU Stow 管理的全面的 Linux 配置仓库,包含了广泛的工具和应用程序的配置。
- ZSH 搭配 Oh My Zsh 框架
- Powerlevel10k 主题提供自定义提示符
- 丰富的插件配置包括:
aliases,alias-tips命令别名管理archlinuxArch Linux 集成zsh-autosuggestions自动建议tmux,systemadmin,vscode工具集成- 网络工具:~podman~,
proxy,zsh-proxychains-ng - 开发工具:~npm~,
nvm,yarn,uv
- i3 平铺式窗口管理器配置
- Polybar 状态栏集成
- Dunst 通知系统
- Compton/Picom 窗口特效和透明度
- Nitrogen/Feh 壁纸管理
- i3lock 屏幕锁定
- 多屏幕布局支持(单屏和双屏)
- Git (git/) - 丰富的自定义别名和工作流管理
- Topic 工作流支持 (
topic-new-remote,topic-merge,topic-delete) - 分支管理工具
- 安全提交实践
- 与 FZF 集成的交互式操作
- Topic 工作流支持 (
- Tmux (tmux/) - 终端复用器,带有自定义插件和键位映射
- Vim/Neovim - 编辑器配置
- VSCode (vscode/) - IDE 配置
- X11 配置,包含 Xresources 用于终端和字体设置
- Xfce4 电源管理
- 自定义光标和字体配置
- 会话管理文件 (
.xinitrc,.profile)
- *DNS/网络*:
dnscrypt-proxy/- DNS 加密dnsmasq/- DNS 缓存unbound/- DNS 验证proxychains/- 代理管理
- *音频*:
PulseAudio/- 音频系统配置PipeWire/- 现代音频框架
- *系统服务*:
docker/- 容器管理podman/- 容器运行时systemd集成
- *安全*:
gpg/- GPG 配置ssh/- SSH 设置tor/- Tor 配置
- *终端模拟器*:
urxvt/- RXVT 终端配置terminator/- 终端模拟器termite/- 终端配置
- *文件管理*:
ranger/- 终端文件管理器vifm/- 类 VIM 文件管理器
- *命令行工具*:
ripgrep/,bat/,sift/,peco/- 增强的命令行工具 - *通信*:
mutt/- 邮件客户端
- Polybar (polybar/) - 带有模块和主题的状态栏
- Rofi (rofi/) - 应用启动器和菜单系统
- 字体 (font/) - 字体配置
- 各种桌面组件的主题
- Python (python/) - Python 环境配置
- Node.js/NPM (npm/) - JavaScript 包管理
- Emacs - 编辑器配置
- Arch Linux (archlinux/) - 发行版专用脚本
- Yay (yay/) - AUR 包管理器
- 部署和备份脚本
- Arch Linux 包管理
- 文件管理工具
- 系统自动化脚本
- *模块化设计*:每个工具在主仓库下都有自己的目录
- *GNU Stow 集成*:使用符号链接管理配置
- *版本控制*:整个仓库使用 Git 追踪
- *跨平台*:专为 Linux 设计,主要针对 Arch Linux
- *Topic 工作流*:先进的 Git 工作流与分支策略
- *环境设置*:自动化部署脚本用于系统配置
- *备份与同步*:用于备份和同步配置的脚本
- *包管理*:与 Arch Linux 包管理器集成
- *全面的 Git 别名*:600+ 行自定义 Git 别名,包括 topic 工作流
- *Powerlevel10k 集成*:带主题的高级 ZSH 提示符
- *i3 窗口管理器*:完整的桌面环境,支持平铺窗口管理
- *安全考虑*:DNS 加密、代理管理、GPG 集成
- *开发生产力*:丰富的开发工具配置
这是一个成熟的、生产就绪的 dotfiles 设置,展示了先进的 Linux 系统管理实践,专注于生产力、安全性和可维护性。
i manage symlinks with gnu stow
stow is available for all linux and most other unix like distributions via your package manager.
- for archlinux
sudo pacman -S stow - for ubuntu
sudo apt-get install stow - for mac
brew install stow
# navigate to your home directory cd ~ # clone the repo: git clone https://github.com/appleshan/dotfiles.git .dotfiles # enter the `.dotfiles` directory cd .dotfiles git submodule init --recursive # install the zsh settings stow shell stow vim stow tmux # etc, etc, etc... # (`stow --help` get more usage)
how it works by default the stow command will create symlinks for files in the parent directory of where you execute the command. so my dotfiles setup assumes this repo is located in the root of your home directory ~/.dotfiles. and all stow commands should be executed in that directory. otherwise you’ll need to use the -d flag with the repo directory location.
to install most of my configs you execute the stow command with the folder name as the only argument.
to install my shell configs use the command:
~/.dotfiles$ stow shell
this will symlink files to ~ and various other places.
note: stow can only create a symlink if a config file does not already exist. if a default file was created upon program installation you must delete it first before you can install a new one with stow. this does not apply to directories, only files.
dnscrypt-proxy -> dnscrypt-proxy 配置文件 docker -> docker 配置文件 dunst -> dunst 配置文件 git -> git 配置文件 i3wm -> i3wm 配置文件 mutt -> mutt 配置文件 neofetch -> neofetch 配置文件 ranger -> ranger 配置文件 redshift -> redshift 配置文件 rime -> rime 配置文件 shell -> zsh 配置文件 sift -> sift 配置文件 tmux -> tmux 配置文件 tor -> tor 配置文件 unbound -> unbound 配置文件 urxvt -> urxvt 配置文件 X11 -> Xresources 配置文件 polybar -> polybar 配置文件 rofi -> rofi 配置文件
*字体 ttf-monaco -> 一款很棒的等宽字体(AUR) ttf-font-awesome -> fontawesome字体(AUR) *桌面 lightdm(lightdm-gtk-greeter)-> 启动管理器 i3-gaps -> WM桌面 xrander -> 分辨率调整 picom -> 特效合成器(窗口透明) lxappearance -> 主题管理 polybar -> 状态栏(AUR)polybar-git arc-theme -> Gtk主题(AUR) numix-icon-theme-git -> Numix图标(AUR) dunst -> 通知管理器 *生产工具 termite -> 终端管理器 visual-studio-code -> IDE编辑器(AUR) gvim -> 编辑器 zsh -> 使用 zsh + oh-my-zsh + power10k *日常软件 rofi -> 程序启动器 thunar -> 文件管理器(GUI) gvfs-smb -> Thunar增加smaba服务 ranger -> 文件管理(终端) chromium -> 浏览器 pepper-flash -> Chromium的Flash支持(AUR) telegram -> 聊天软件(AUR) evince -> PDF查看软件 thunderbird -> 邮件查看 mplayer -> 视频播放器(终端) shadowsocks-libev -> sock5 代理 mpd -> 音乐播放器后端 moc/ncmpcpp -> 音乐播放器前端 fcitx5-rime -> 输入法 redshift -> 护眼 nitrogen, feh -> 壁纸设置器 xfce4-power-manager -> 电源管理器 flameshot -> 截图工具 qv2ray -> 科学上网工具 clipIt -> 剪切板管理器 i3lock-fancy-multimonitor -> 锁屏管理器 zathura -> pdf 阅读器 nvim -> 文本编辑器 doom-emacs -> 文本编辑器 *系统管理 yaourt -> 包管理 alsa -> 声卡 networkmanager -> 网络管理
| Shell | WM / DE | Editor | Terminal | Multiplexer | Compositor | Audio | Monitor | IRC | |
|---|---|---|---|---|---|---|---|---|---|
| bash / zsh | i3wm | Emacs | termite / urxvt | tmux | picom | pulseaudio | custom |