美文网首页
群晖安装oh-my-zsh

群晖安装oh-my-zsh

作者: 洗洗睡吧i | 来源:发表于2020-05-12 23:01 被阅读0次

1. zsh 安装

ref: https://synocommunity.com/

先从套件中心中安装zsh 。

  • 登录DSM,找到 套件中心设置, 将 信任层级 设为 Synology Inc. 和信任的发行者.

  • 套件来源 选项卡中, 增加一项:

  • 返回 套件中心, 左侧可以看到 社群 选项卡, 打开后可以看到里面有 Z shell (with modules), 安装套件.

# 显示当前 shell 类型
echo $SHELL

# 显示可使用的 shell
cat /etc/shells

2. oh-my-zsh 安装

ref: https://ohmyz.sh/

  • 需要先安装 git. (在套件中心里有)

  • 用 wget 安装。

    $ sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
    
  • 简单配置一下,打开配置文件 nano ~/.zshrc

    # 主题
    ZSH_THEME="ys"
    
    # 插件
    plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
    
  • 加载配置文件, source ~/.zshrc

3. 将 zsh 设为默认

一般用 chsh -s /bin/zsh 就可以更改了。

但群晖没有 chsh 命令,新建配置文件 nano ~/.profile,加入以下内容:

if [[ -x /usr/local/bin/zsh ]]; then
export SHELL=/usr/local/bin/zsh
exec /usr/local/bin/zsh
fi

ref: https://migege.com/post/install-ohmyzsh-on-synology-dsm

相关文章

网友评论

      本文标题:群晖安装oh-my-zsh

      本文链接:https://www.haomeiwen.com/subject/lzswnhtx.html