-
-
Save miquelbotanch/c90c2057cc0a2f7f10886810140cd1e0 to your computer and use it in GitHub Desktop.
Unraid Zsh with persistent config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is your .zshrc, put it in /boot/config/extra/ | |
export ZSH="/root/.oh-my-zsh" | |
ZSH_THEME="robbyrussell" | |
DISABLE_UPDATE_PROMPT="true" | |
plugins=( | |
zsh-autosuggestions | |
zsh-syntax-highlighting | |
) | |
source $ZSH/oh-my-zsh.sh | |
# User configurations | |
alias l='ls -lFh' #size,show type,human readable | |
alias la='ls -lAFh' #long list,show almost all,show type,human readable | |
HISTSIZE=10000 | |
SAVEHIST=10000 | |
HISTFILE=/root/.cache/zsh/history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start the Management Utility | |
/usr/local/sbin/emhttp | |
# This is the go file that runs at startup, located at: /boot/config/go | |
# Make sure to enable zsh in nerd pack first | |
# Install Oh-My-Zsh | |
HOME="/root" | |
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this script with Unraid user scripts plugin at array start | |
# Located at: /boot/config/plugins/user.scripts/scripts/<script name>/script | |
HOME=/root | |
OH_MY_ZSH_ROOT="$HOME/.oh-my-zsh" | |
ZSH_CUSTOM="$HOME/.oh-my-zsh/custom" | |
OH_MY_ZSH_PLUGINS="$ZSH_CUSTOM/plugins" | |
OH_MY_ZSH_THEMES="$ZSH_CUSTOM/themes" | |
mkdir -p $OH_MY_ZSH_PLUGINS | |
mkdir -p $OH_MY_ZSH_THEMES | |
# Install zsh-autosuggestions | |
if [ ! -d "$OH_MY_ZSH_PLUGINS/zsh-autosuggestions" ]; then | |
echo " -> Installing zsh-autosuggestions..." | |
git clone https://github.com/zsh-users/zsh-autosuggestions $OH_MY_ZSH_PLUGINS/zsh-autosuggestions | |
else | |
echo " -> zsh-autosuggestions already installed" | |
fi | |
# Install zsh-syntax-highlighting | |
if [ ! -d "$OH_MY_ZSH_PLUGINS/zsh-syntax-highlighting" ]; then | |
echo " -> Installing zsh-syntax-highlighting..." | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $OH_MY_ZSH_PLUGINS/zsh-syntax-highlighting | |
else | |
echo " -> zsh-syntax-highlighting already installed" | |
fi | |
chmod 755 $OH_MY_ZSH_PLUGINS/zsh-autosuggestions | |
chmod 755 $OH_MY_ZSH_PLUGINS/zsh-syntax-highlighting | |
chsh -s /bin/zsh | |
# Remove oh-my-zsh default .zshrc | |
rm /root/.zshrc | |
mkdir -p /root/.cache/zsh/ | |
mkdir -p /boot/config/extra/ | |
# Make sure history file exists | |
touch /boot/config/extra/history | |
# Symlink .zshrc and history files | |
cp -sf /boot/config/extra/.zshrc /root/.zshrc | |
cp -sf /boot/config/extra/history /root/.cache/zsh/history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment