Skip to content

Zen ZSH #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/install/dotfiles/before_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ if [ -d ~/$dot_folder/.settings ] ;then
_move_folder ~/$dot_folder/.config/gtk/xsettings ~/$dot_folder/.config/xsettings
_move_file ~/$dot_folder/.config/gtk/.gtkrc-2.0 ~/$dot_folder/.gtkrc-2.0
_move_file ~/$dot_folder/.config/gtk/.Xresources ~/$dot_folder/.Xresources
_move_file ~/$dot_folder/.config/starship/starship.toml ~/$dot_folder/.config/starship.toml
_del_folder ~/$dot_folder/gtk
_del_folder ~/$dot_folder/eww
_del_folder ~/$dot_folder/starship

# Replace Quicklink
sed -i -e 's/dotfiles\/.settings/.config\/ml4w\/settings/g' ~/$dot_folder/.config/ml4w/settings/waybar-quicklinks.json
Expand Down
14 changes: 8 additions & 6 deletions share/dotfiles/.config/bashrc/20-customization
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# CUSTOMIZATION
# -----------------------------------------------------

# -----------------------------------------------------
# Starship Prompt
# -----------------------------------------------------
eval "$(starship init bash)"
POSH=agnoster

# -----------------------------------------------------
# Pywal
# oh-my-posh promt
# -----------------------------------------------------
cat ~/.cache/wal/sequences
# Custom Theme
eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/zen.toml)"

# Shipped Theme
# eval "$(oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/$POSH.omp.json)"

6 changes: 6 additions & 0 deletions share/dotfiles/.config/bashrc/30-autostart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# AUTOSTART
# -----------------------------------------------------

# -----------------------------------------------------
# Pywal
# -----------------------------------------------------
cat ~/.cache/wal/sequences


# -----------------------------------------------------
# Fastfetch
# -----------------------------------------------------
Expand Down
133 changes: 119 additions & 14 deletions share/dotfiles/.config/ml4w/scripts/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,151 @@ if [[ $shell == "bash" ]] ;then
# -----------------------------------------------------
elif [[ $shell == "zsh" ]] ;then

# Change shell to shh
# Change shell to zsh
while ! chsh -s $(which zsh); do
echo "ERROR: Authentication failed. Please enter the correct password."
sleep 1
done
echo ":: Shell is now zsh."

# Installing oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo ":: Installing oh-my-zsh"
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
cp ~/.config/ml4w/tpl/.zshrc ~/
# Check for plugins directory
if [ ! -d "$HOME/.config/zshrc/plugins" ]; then
echo ":: Making ZSH Plugin directory"
mkdir -p $HOME/.config/zshrc/plugins
else
echo ":: oh-my-zsh already installed"
echo ":: ZSH Plugin directory already exists"
fi

# Installing zsh-autosuggestions
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-autosuggestions" ]; then
echo ":: Installing zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.config/zshrc/plugins/zsh-autosuggestions
else
echo ":: zsh-autosuggestions already installed"
fi

# Installing zsh-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-syntax-highlighting" ]; then
echo ":: Installing zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.config/zshrc/plugins/zsh-syntax-highlighting
else
echo ":: zsh-syntax-highlighting already installed"
fi

# Installing fast-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/fast-syntax-highlighting" ]; then
if [ ! -d "$HOME/.config/zshrc/plugins/fast-syntax-highlighting" ]; then
echo ":: Installing fast-syntax-highlighting"
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git $HOME/.config/zshrc/plugins/fast-syntax-highlighting
else
echo ":: fast-syntax-highlighting already installed"
fi

# Installing zsh-completions
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-completions" ]; then
echo ":: Installing zsh-completions"
git clone https://github.com/zsh-users/zsh-completions.git $HOME/.config/zshrc/plugins/zsh-completions
else
echo ":: zsh-completions already installed"
fi

# Install zsh-plugin-git
if [ ! -f "$HOME/.config/zshrc/plugins/git.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-git"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/git/git.plugin.zsh -o $HOME/.config/zshrc/plugins/git.plugin.zsh
else
echo ":: zsh-plugin-git already installed"
fi

# Install zsh-plugin-sudo
if [ ! -f "$HOME/.config/zshrc/plugins/sudo.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-sudo"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/sudo/sudo.plugin.zsh -o $HOME/.config/zshrc/plugins/sudo.plugin.zsh
else
echo ":: zsh-plugin-sudo already installed"
fi

# Install zsh-plugin-web-search
if [ ! -f "$HOME/.config/zshrc/plugins/web-search.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-web-search"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/web-search/web-search.plugin.zsh -o $HOME/.config/zshrc/plugins/web-search.plugin.zsh
else
echo ":: zsh-plugin-web-search already installed"
fi

# Install zsh-plugin-archlinux
if [ ! -f "$HOME/.config/zshrc/plugins/archlinux.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-archlinux"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/archlinux/archlinux.plugin.zsh -o $HOME/.config/zshrc/plugins/archlinux.plugin.zsh
else
echo ":: zsh-plugin-archlinux already installed"
fi

# Install zsh-plugin-copyfile
if [ ! -f "$HOME/.config/zshrc/plugins/copyfile.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-copyfile"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/copyfile/copyfile.plugin.zsh -o $HOME/.config/zshrc/plugins/copyfile.plugin.zsh
else
echo ":: zsh-plugin-copyfile already installed"
fi

# Install zsh-plugin-copybuffer
if [ ! -f "$HOME/.config/zshrc/plugins/copybuffer.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-copybuffer"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/copybuffer/copybuffer.plugin.zsh -o $HOME/.config/zshrc/plugins/copybuffer.plugin.zsh
else
echo ":: zsh-plugin-copybuffer already installed"
fi

# Install zsh-plugin-dirhistory
if [ ! -f "$HOME/.config/zshrc/plugins/dirhistory.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-dirhistory"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/dirhistory/dirhistory.plugin.zsh -o $HOME/.config/zshrc/plugins/dirhistory.plugin.zsh
else
echo ":: zsh-plugin-dirhistory already installed"
fi

# Install zsh-plugin-colored-man-pages
if [ ! -f "$HOME/.config/zshrc/plugins/colored-man-pages.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-colored-man-pages"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/colored-man-pages/colored-man-pages.plugin.zsh -o $HOME/.config/zshrc/plugins/colored-man-pages.plugin.zsh
else
echo ":: zsh-plugin-colored-man-pages already installed"
fi

# Install zsh-plugin-command-not-found
if [ ! -f "$HOME/.config/zshrc/plugins/command-not-found.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-command-not-found"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/command-not-found/command-not-found.plugin.zsh -o $HOME/.config/zshrc/plugins/command-not-found.plugin.zsh
else
echo ":: zsh-plugin-command-not-found already installed"
fi

# Install zsh-plugin-extract
if [ ! -f "$HOME/.config/zshrc/plugins/extract.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-extract"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/extract/extract.plugin.zsh -o $HOME/.config/zshrc/plugins/extract.plugin.zsh
else
echo ":: zsh-plugin-extract already installed"
fi

# Install zsh-plugin-you-should-use
if [ ! -f "$HOME/.config/zshrc/plugins/you-should-use.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-you-should-use"
curl https://raw.githubusercontent.com/MichaelAquilina/zsh-you-should-use/refs/heads/master/you-should-use.plugin.zsh -o $HOME/.config/zshrc/plugins/you-should-use.plugin.zsh
else
echo ":: zsh-plugin-you-should-use already installed"
fi

# Install pkgfile if needed (for command not found)
if ! command -v pkgfile &> /dev/null; then
echo ":: Installing pkgfile"
sudo pacman -S pkgfile
else
echo ":: pkgfile already installed"
fi

sudo pkgfile -u

gum spin --spinner dot --title "Please reboot your system." -- sleep 3

# -----------------------------------------------------
Expand All @@ -92,4 +197,4 @@ elif [[ $shell == "zsh" ]] ;then
else
echo ":: Changing shell canceled"
exit
fi
fi
141 changes: 112 additions & 29 deletions share/dotfiles/.config/zshrc/20-customization
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,7 @@
# CUSTOMIZATION
# -----------------------------------------------------

# -----------------------------------------------------
# oh-myzsh themes: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# -----------------------------------------------------
# ZSH_THEME=robbyrussell

# -----------------------------------------------------
# oh-myzsh plugins
# -----------------------------------------------------
plugins=(
git
sudo
web-search
archlinux
zsh-autosuggestions
zsh-syntax-highlighting
fast-syntax-highlighting
copyfile
copybuffer
dirhistory
)

# Set-up oh-my-zsh
source $ZSH/oh-my-zsh.sh
POSH=agnoster

# -----------------------------------------------------
# Set-up FZF key bindings (CTRL R for fuzzy history finder)
Expand All @@ -37,16 +15,121 @@ HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory

# -----------------------------------------------------
# Starship promt
# -----------------------------------------------------
# eval "$(starship init zsh)"

# -----------------------------------------------------
# oh-my-posh promt
# -----------------------------------------------------
# Custom Theme
eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/zen.toml)"

# Shipped Theme
# eval "$(oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/agnoster.omp.json)"
# eval "$(oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/$POSH.omp.json)"

# -----------------------------------------------------
# PLUGINS
# -----------------------------------------------------

# zsh-autosuggestions
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-autosuggestions" ]; then
echo ":: Installing zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.config/zshrc/plugins/zsh-autosuggestions
else
source "$HOME/.config/zshrc/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh"
fi
# zsh-syntax-highlighting
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-syntax-highlighting" ]; then
echo ":: Installing zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.config/zshrc/plugins/zsh-syntax-highlighting
else
source "$HOME/.config/zshrc/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh"
fi
# fast-syntax-highlighting
if [ ! -d "$HOME/.config/zshrc/plugins/fast-syntax-highlighting" ]; then
echo ":: Installing fast-syntax-highlighting"
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git $HOME/.config/zshrc/plugins/fast-syntax-highlighting
else
source "$HOME/.config/zshrc/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
fi
# zsh-completions
if [ ! -d "$HOME/.config/zshrc/plugins/zsh-completions" ]; then
echo ":: Installing zsh-completions"
git clone https://github.com/zsh-users/zsh-completions.git $HOME/.config/zshrc/plugins/zsh-completions
else
source "$HOME/.config/zshrc/plugins/zsh-completions/zsh-completions.plugin.zsh"
fi
# zsh-plugin-git
if [ ! -f "$HOME/.config/zshrc/plugins/git.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-git"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/git/git.plugin.zsh -o $HOME/.config/zshrc/plugins/git.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/git.plugin.zsh"
fi
# zsh-plugin-sudo
if [ ! -f "$HOME/.config/zshrc/plugins/sudo.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-sudo"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/sudo/sudo.plugin.zsh -o $HOME/.config/zshrc/plugins/sudo.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/sudo.plugin.zsh"
fi
# zsh-plugin-web-search
if [ ! -f "$HOME/.config/zshrc/plugins/web-search.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-web-search"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/web-search/web-search.plugin.zsh -o $HOME/.config/zshrc/plugins/web-search.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/web-search.plugin.zsh"
fi
# zsh-plugin-archlinux
if [ ! -f "$HOME/.config/zshrc/plugins/archlinux.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-archlinux"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/archlinux/archlinux.plugin.zsh -o $HOME/.config/zshrc/plugins/archlinux.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/archlinux.plugin.zsh"
fi
# zsh-plugin-copyfile
if [ ! -f "$HOME/.config/zshrc/plugins/copyfile.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-copyfile"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/copyfile/copyfile.plugin.zsh -o $HOME/.config/zshrc/plugins/copyfile.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/copyfile.plugin.zsh"
fi
# zsh-plugin-copybuffer
if [ ! -f "$HOME/.config/zshrc/plugins/copybuffer.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-copybuffer"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/copybuffer/copybuffer.plugin.zsh -o $HOME/.config/zshrc/plugins/copybuffer.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/copybuffer.plugin.zsh"
fi
# zsh-plugin-dirhistory
if [ ! -f "$HOME/.config/zshrc/plugins/dirhistory.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-dirhistory"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/dirhistory/dirhistory.plugin.zsh -o $HOME/.config/zshrc/plugins/dirhistory.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/dirhistory.plugin.zsh"
fi
# zsh-plugin-colored-man-pages
if [ ! -f "$HOME/.config/zshrc/plugins/colored-man-pages.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-colored-man-pages"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/colored-man-pages/colored-man-pages.plugin.zsh -o $HOME/.config/zshrc/plugins/colored-man-pages.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/colored-man-pages.plugin.zsh"
fi
# zsh-plugin-command-not-found
if [ ! -f "$HOME/.config/zshrc/plugins/command-not-found.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-command-not-found"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/command-not-found/command-not-found.plugin.zsh -o $HOME/.config/zshrc/plugins/command-not-found.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/command-not-found.plugin.zsh"
fi
# zsh-plugin-extract
if [ ! -f "$HOME/.config/zshrc/plugins/extract.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-extract"
curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/refs/heads/master/plugins/extract/extract.plugin.zsh -o $HOME/.config/zshrc/plugins/extract.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/extract.plugin.zsh"
fi
# zsh-plugin-you-should-use
if [ ! -f "$HOME/.config/zshrc/plugins/you-should-use.plugin.zsh" ]; then
echo ":: Installing zsh-plugin-you-should-use"
curl https://raw.githubusercontent.com/MichaelAquilina/zsh-you-should-use/refs/heads/master/you-should-use.plugin.zsh -o $HOME/.config/zshrc/plugins/you-should-use.plugin.zsh
else
source "$HOME/.config/zshrc/plugins/you-should-use.plugin.zsh"
fi
7 changes: 2 additions & 5 deletions share/packages/general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ packagesPacman=(
"unzip"
"alacritty"
"dunst"
"starship"
"noto-fonts"
"otf-font-awesome"
"ttf-fira-sans"
Expand Down Expand Up @@ -53,12 +52,10 @@ packagesPacman=(
"zsh"
"fzf"
"htop"
"zsh-completions"
"rsync"
);

packagesAUR=(
"bibata-cursor-theme"
"trizen"
"pacseek"
"oh-my-posh"
"oh-my-posh-bin"
);
Loading