From 47299f66c409c5126c7e0510c18f9f15a3bb2fb5 Mon Sep 17 00:00:00 2001 From: FangcatChina Date: Thu, 30 Jul 2026 17:43:37 +0800 Subject: Zsh --- docs/applications/zsh.md | 74 +++++++++++++++++++++++++++++++ docs/concepts/linux/shell.md | 17 +++++++ docs/desktop/wm/hyprland.md | 9 ++-- docs/desktop/wm/niri.md | 9 ++-- docs/getting-started/common-command.md | 4 +- docs/getting-started/post-installation.md | 2 +- docs/img/hyprland.svg | 64 ++++++++++++++++++++++++++ 7 files changed, 169 insertions(+), 10 deletions(-) create mode 100644 docs/applications/zsh.md create mode 100644 docs/concepts/linux/shell.md create mode 100644 docs/img/hyprland.svg (limited to 'docs') diff --git a/docs/applications/zsh.md b/docs/applications/zsh.md new file mode 100644 index 0000000..f99c5c1 --- /dev/null +++ b/docs/applications/zsh.md @@ -0,0 +1,74 @@ +# Zsh + +Zsh是一款拥有高度自定义性的[Shell](../concepts/linux/shell.md),它具有强大的自动补全、语法高亮,并且由于Oh My Zsh的支持,拥有海量主题与插件,特别适合用于美化。 + +## 安装 + +### Zsh + +以下命令用于安装Zsh与部分推荐扩展。 + +- Debian: `sudo apt install zsh zsh-autosuggestions zsh-syntax-highlighting` +- Fedora: `sudo dnf install zsh zsh-autosuggestions zsh-syntax-highlighting` +- Arch: `sudo pacman -S zsh zsh-completions zsh-autosuggestions zsh-syntax-highlighting` + +安装好后,您可以运行`chsh -s /bin/zsh`来设置Zsh为默认终端。 + +部分发行版源的`zsh`包,在初次运行`zsh`时,会询问您想要如何配置`.zshrc`(Zsh的配置文件)。我们建议您输入2来选择`(2) Populate your ~/.zshrc with the configuration recommended by the system administrator and exit (you will need to edit the file by hand, if so desired).`(默认推荐配置)。 + +### Oh My Zsh + +[Oh My Zsh](https://ohmyz.sh/)能够用于管理`.zshrc`配置文件,简化Zsh的配置过程,并通过丰富的插件和主题生态,极大地提升终端的使用效率和视觉体验。 + +在安装之前,您首先需要使用包管理器安装Git(包名`git`)。 + +#### 一键安装 + +运行以下一键安装脚本即可。 + +```bash +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +# 或者 +sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" +``` +!!! warning "网络问题" + 该脚本与 https://install.ohmyz.sh 的脚本本质相同,均需要从Github克隆Zsh仓库,因此可能需要较好的网络环境。 + +#### 手动安装 + +若您因为网络原因无法使用一键安装,您可以采用手动安装。 + +```bash +# 克隆仓库(使用gh-proxy以规避网络问题) +git clone https://gh-proxy.com/https://github.com/ohmyzsh/ohmyzsh ~/.oh-my-zsh +# 或者使用Gitee(需要登录) +# git clone https://gitee.com/mirrors/ohmyzsh ~/.oh-my-zsh +# 备份.zshrc +mv ~/.zshrc ~/.zshrc.orig +# 使用Oh My Zsh提供的模板 +cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc +# 应用Oh My Zsh +zsh +``` + +## 主题 + +大部分Zsh主题可以在[Github](https://github.com/topics/zsh-theme)上找到,同时,Oh My Zsh也拥有大量的[预置主题](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes)。大部分主题均提供了安装脚本,此处我们以[Powerlevel10k](https://github.com/romkatv/powerlevel10k)为例。 + +??? note "字体" + Powerlevel10k需要安装以下字体(链接已加速)来确保呈现效果: + + - [MesloLGS NF Regular.ttf](https://gh-proxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf) + - [MesloLGS NF Bold.ttf](https://gh-proxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf) + - [MesloLGS NF Italic.ttf](https://gh-proxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf) + - [MesloLGS NF Bold Italic.ttf](https://gh-proxy.com/https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf) + + 下载字体后,双击通过桌面环境自带的字体应用安装即可。同时,您可能需要[配置对应终端的字体(Github)](https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k)。 + + +```bash +# 克隆仓库 +git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ~/powerlevel10k +# 写入.zshrc +echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc +``` diff --git a/docs/concepts/linux/shell.md b/docs/concepts/linux/shell.md new file mode 100644 index 0000000..9eeb82c --- /dev/null +++ b/docs/concepts/linux/shell.md @@ -0,0 +1,17 @@ +# Shell + +中文: 外壳 + +## 概述 + +Shell是用户与Linux内核直接对话的“窗口”,你可以将它理解为Windows的CMD(命令提示符)。用户通过在Shell输入指令达到操作系统的目的。 + +大多数Shell的配置文件包括环境变量、主题等内容,且位于用户目录下,为以`.`开头的隐藏文件,如`.bashrc`(Bash)、`.zshrc`(Zsh)。 + +!!! warning "消歧义" + 终端是Shell的图形化呈现。尽管有Ptyxis、Konsole等等终端,但其所调用、运行的依然是诸如Bash等等的Shell。 + +??? note "常见的Linux Shell" + - Bash: 大多数Linux发行版预装的Shell,兼容性强,支持广 + - Zsh: 自定义性强,有强大的自动补全功能,并兼容Bash语法 + - Fish: 用户友好,人性化设计,易配置 \ No newline at end of file diff --git a/docs/desktop/wm/hyprland.md b/docs/desktop/wm/hyprland.md index 69ae4dd..f879e24 100644 --- a/docs/desktop/wm/hyprland.md +++ b/docs/desktop/wm/hyprland.md @@ -1,15 +1,18 @@ # Hyprland -[官方Wiki(英文)](https://wiki.hypr.land/) +![Hyprland](../../img/hyprland.svg) -配置文件: `~/.config/hypr/hyprland.conf` -![Hyprland](https://hypr.land/ricing_competitions/1/flicko.webp) +[官方Wiki(英文)](https://wiki.hypr.land/) + +配置文件: `~/.config/hypr/hyprland.lua` ## 概述 Hyprland 是一款在 Linux 社区,尤其是喜欢定制桌面环境的用户中非常热门的**动态平铺 Wayland 合成器**。它之所以特别,是因为它试图在强大的功能、炫酷的视觉效果和高度可定制性之间找到一个很好的平衡点。 +![Hyprland](https://hypr.land/ricing_competitions/1/flicko.webp) + ## 特性 Hyprland拥有相对惊艳的视觉效果,并支持动态平铺窗口,能够自动排列并充分利用屏幕空间。它支持多种平铺布局,如 dwindle(二分平铺)和 master(主从布局),并且可以为不同的工作区设置独立的布局,并通过自定义渲染器,能提供流畅的窗口动画、圆角等效果。 diff --git a/docs/desktop/wm/niri.md b/docs/desktop/wm/niri.md index 651adb0..a040fd6 100644 --- a/docs/desktop/wm/niri.md +++ b/docs/desktop/wm/niri.md @@ -1,17 +1,18 @@ # Niri -[官方Wiki(英文,Github)](https://github.com/niri-wm/niri/wiki/) +![Niri](https://docs.akass.cn/niri/logo/niri-logo.svg) -[翻译版Wiki](https://docs.akass.cn/niri/) +[官方Wiki(英文,Github)](https://github.com/niri-wm/niri/wiki/) [翻译版Wiki](https://docs.akass.cn/niri/) 配置文件: `~/.config/niri/config.kdl` -![Niri](https://www.phoronix.net/image.php?id=2026&image=niri_2604_2) - ## 概述 Niri是一个以滚动平铺为核心理念的Wayland合成器。它用Rust编写,将窗口在无限水平长条上按列布局,打开新窗口不会改变现有窗口大小,旨在提供流畅、有组织的工作体验,目前可稳定用于日常使用。 +![Niri](https://www.phoronix.net/image.php?id=2026&image=niri_2604_2) + + ## 安装 在安装之前,我们建议您首先选择好适合的[桌面外壳](../../concepts/desktop/desktop_shell.md)。 diff --git a/docs/getting-started/common-command.md b/docs/getting-started/common-command.md index 24fc684..87f2c97 100644 --- a/docs/getting-started/common-command.md +++ b/docs/getting-started/common-command.md @@ -8,7 +8,7 @@ ## 常见符号 -- `$`: 用以表示终端环境,不需要进行输入。 +- `$`: 用以表示[Shell](../concepts/linux/shell.md)环境,不需要进行输入。 - `#`: 用以表示注释,井号后的内容会被自动忽略。 - `~`: 用以代表用户目录,如 `~/file` 。 - `*`: 通配符,可代指“全部”,如 `dir1/*` 指 `dir1` 下全部文件、文件夹,`dir1/file*.file`指 `dir1` 文件夹下所有以 `file` 开头,`.file` 结尾的文件与文件夹。 @@ -36,7 +36,7 @@ ### cd -将Shell的工作目录切换到某目录。 +将[Shell](../concepts/linux/shell.md)的工作目录切换到某目录。 默认情况下,Shell的工作目录为 `/home` 下的对应用户文件夹,并会在左侧展示(部分Shell可能除外)。 diff --git a/docs/getting-started/post-installation.md b/docs/getting-started/post-installation.md index 8005b81..da3fdd0 100644 --- a/docs/getting-started/post-installation.md +++ b/docs/getting-started/post-installation.md @@ -23,7 +23,7 @@ [Flatpak](../concepts/package_managers/flatpak.md)是新一代Linux软件管理工具。其采用沙箱式设计,使得软件能够兼容多数发行版。并且,基于Flatpak的Flathub是Linux上极其重要的应用商店,深度集成于KDE Discover, GNOME。 -**对于用户软件,我们推荐您使用Flatpak或[AppImage](../concepts/package_managers/appimage.md)进行安装。** +**对于用户软件,我们推荐您使用[Flatpak](../concepts/package_managers/flatpak.md)或[AppImage](../concepts/package_managers/appimage.md)进行安装。** 您可以通过包管理器或者桌面环境自带的应用商店安装Flatpak。同样的,Flathub也需要换源。 diff --git a/docs/img/hyprland.svg b/docs/img/hyprland.svg new file mode 100644 index 0000000..a2b3255 --- /dev/null +++ b/docs/img/hyprland.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.3