# BabyFetch **Repository Path**: obaby/baby-fetch ## Basic Information - **Project Name**: BabyFetch - **Description**: Linux MacOS ssh 命令行自定义欢迎语 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-13 - **Last Updated**: 2025-02-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Baby Fetch ### 此项目为针对 mac os linux 终端以及 ssh 的个性化定制配置示例项目,支持设置终端以及 ssh 欢迎语。 效果图: ![screenshots/1.jpg](screenshots/1.jpg) ![screenshots/2.jpg](screenshots/2.jpg) ![screenshots/3.jpg](screenshots/3.jpg) ![screenshots/4.jpg](screenshots/4.jpg) 1.安装 fastfetch,具体安装方法,参考https://github.com/fastfetch-cli/fastfetch Linux Some distros package an outdated fastfetch version. Older versions receive no support, so please try always to use the latest version. Ubuntu: ppa:zhangsongcui3371/fastfetch (for Ubuntu 22.04 or newer) Debian: apt install fastfetch (for Debian 13 or newer) Debian / Ubuntu: Download fastfetch-linux-.deb from Github release page and double-click it (for Ubuntu 20.04 or newer and Debian 11 or newer). Arch Linux: pacman -S fastfetch Fedora: dnf install fastfetch Gentoo: emerge --ask app-misc/fastfetch Alpine: apk add --upgrade fastfetch NixOS: nix-shell -p fastfetch openSUSE: zypper install fastfetch ALT Linux: apt-get install fastfetch Exherbo: cave resolve --execute app-misc/fastfetch Solus: eopkg install fastfetch Slackware: sbopkg -i fastfetch Void Linux: xbps-install fastfetch Venom Linux: scratch install fastfetch You may need sudo, doas or sup to run these commands. If fastfetch is not packaged for your distro or an outdated version is packaged, linuxbrew is a good alternative: brew install fastfetch macOS HomeBrew: brew install fastfetch MacPorts: sudo port install fastfetch Windows scoop: scoop install fastfetch Chocolatey: choco install fastfetch winget: winget install fastfetch MSYS2 MinGW: pacman -S mingw-w64---fastfetch You may also download the program directly from the GitHub releases page in the form of an archive file. FreeBSD pkg install fastfetch Android (Termux) pkg install fastfetch 2.拉取项目代码:git clone https://gitee.com/obaby/baby-fetch 可以通过下面的命令一键部署: ``` chmod +x deploy.sh ./deploy.sh ``` 将项目目录下的 fastfetch 复制到用户目录下的.config 目录下 ``` cp -rf fastfetch ~/.config/ ``` 3.修改终端配置文件,在修改之前需要确定当前运行的终端是什么 bash,zsh 或者是其他的什么东西。 例如,我这里的终端是 zsh,运行 fastfetch 查看 shell 字段: ![screenshots/shell.jpg](screenshots/shell.jpg) ``` vim ~/.zshrc ``` 添加以下代码: ``` if [ -f ~/.config/fastfetch/welcome.sh ]; then ~/.config/fastfetch/welcome.sh fi ``` 如果是 bash : ``` vim ~/.bash_profile ``` 同理其他的终端修改对应的位置文件,执行 source ~/.zshrc加载配置文件,如果无误应该就可以看到效果了。 目前针对 macos welcome.sh 会针对是否运行在 iterm 内加载不同的配置文件: ``` #!/bin/bash if [ "$TERM_PROGRAM" = "iTerm.app" ]; then # echo "当前运行在 iTerm 中" fastfetch -c ~/.config/fastfetch/config-obaby-mac-iterm-weding.jsonc else # echo "当前没有运行在 iTerm 中" fastfetch -c ~/.config/fastfetch/config-obaby-logo-80.jsonc fi ``` 同样定制化加载的文件也可以通过修改 welcome.sh实现,或者直接修改这个文件加载的配置文件实现。 为了更好的体验效果,在 mac 下建议安装 iterm,linux 下建议安装kitty。 iterm 建议通过 homebrew 安装: ``` brew install iterm2 ``` https://iterm2.com https://sw.kovidgoyal.net/kitty/binary/ 4.显示问题,如果显示有乱码建议安装包含自带字体图标的字体,可以通过这里下载:https://www.nerdfonts.com/font-downloads 项目中已经包含了两个字体压缩包,可以直接安装使用。 同样,针对 ssh 的欢迎语也可以通过修改终端配置文件实现,这么改的好处是,针对不同用户可以用户自己定义。并且不需要修改 sshd配置文件,无需重启服务。 测试环境: ``` Mac:  CPU Apple M1 󰋵 GPU Apple Apple M1 Ghz 󰀚 Memory 13.46 GiB / 16.00 GiB (84%) 󰘳 Shell zsh v5.9 󰀚 Disk 200.69 GiB / 228.27 GiB (88%) - apfs [Read-only] 󰀚 Disk 5.06 MiB / 5.06 MiB (100%) - hfs [External, Read-only] 󰀚 Disk 766.07 MiB / 934.23 MiB (82%) - apfs [External, Read-only] 󰘳 Network en0 192.168.8.100/24 󱦟 OS Age 20132 days 󱫐 Uptime 41 days, 23 hours, 57 mins  Machine MacBook Pro (13-inch, M1, 2020) (Apple Inc.) Ubuntu: 󰀶 OSUbuntu 22.04.4 LTS x86_64 󱢌 Bios449e491 (0.0)  KernelLinux 5.15.0-92-generic 󰏗 Packages1190 (dpkg), 3 (snap) 󰹑 Display1024x768 @ 60 Hz  Terminalsshd ● ● ● ● ● ● ● ●  CPUIntel(R) Xeon(R) Platinum 󰋵 GPUCirrus Logic GD 5446 Ghz 󰀚 Memory1.00 GiB / 1.65 GiB (61%) 󰘳 Shellbash v5.1.16 󰀚 Disk27.71 GiB / 39.01 GiB (71%) - ext4 󰘳 Networketh0 172.23.120.93/20 󱦟 OS Age 380 days 󱫐 Uptime 89 days, 20 hours, 50 mins  MachineAlibaba Cloud ECS (Alibaba Cloud) ```