群晖安装oh-my-zsh
2020-05-12 本文已影响0人
洗洗睡吧i
1. zsh 安装
先从套件中心中安装zsh 。
-
登录DSM,找到
套件中心
→设置
, 将信任层级
设为Synology Inc. 和信任的发行者
. -
在
套件来源
选项卡中, 增加一项:- 名称: SynoCommunity
- 位置: http://packages.synocommunity.com/
-
返回
套件中心
, 左侧可以看到社群
选项卡, 打开后可以看到里面有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