Switch to zsh instead of bash

Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
Severin Kaderli 2019-02-13 20:40:47 +01:00
parent ca2c5b0c2b
commit 88927bbf39
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
13 changed files with 115 additions and 101 deletions

View file

@ -0,0 +1,18 @@
#!/bin/zsh
#
# SCRIPT NAME:
# .zlogout
#
# AUTHOR:
# Severin Kaderli <severin.kaderli@gmail.com>
#
# DESCRIPTION:
# This script is executed when the login shell exits.
#
# USAGE:
# This script is automatically executed when the login shell exits.
# Clear console output
if [ "${SHLVL}" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

View file

@ -0,0 +1,31 @@
#!/bin/zsh
#
# SCRIPT NAME:
# .zprofile
#
# AUTHOR:
# Severin Kaderli <severin.kaderli@gmail.com>
#
# DESCRIPTION:
# This script is called when you start a login shell.
#
# USAGE:
# This script is automatically executed when you start a login shell.
if [[ -f "${HOME}/.config/zsh/.zshrc" ]]; then
. "${HOME}/.config/zsh/.zshrc"
fi
if [[ -f "${XDG_CONFIG_HOME}/custom/keyleds" ]]; then
. "${XDG_CONFIG_HOME}/custom/keyleds"
fi
# Restore custom dconf configuration
dconf load / < "${XDG_CONFIG_HOME}/dconf/root.conf"
# Activate correct crontab file
crontab "${XDG_CONFIG_HOME}/cron/crontab"
# If we are on tty1 we start the x-server
if [ "$(tty)" = "/dev/tty1" ]; then
startx "${XDG_CONFIG_HOME}/X11/xinitrc" && exit
fi

63
system/.config/zsh/.zshrc Normal file
View file

@ -0,0 +1,63 @@
#!/bin/zsh
#
# SCRIPT NAME:
# .zshrc
#
# AUTHOR:
# Severin Kaderli <severin.kaderli@gmail.com>
#
# DESCRIPTION:
# This script is called when you start a new shell.
#
# USAGE:
# This script is automatically executed when you start a new shell.
# Zsh options
setopt prompt_subst
setopt extendedglob
unsetopt correct
# Zsh keybindings
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "\e[5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "\ee[C" forward-word
bindkey "\ee[D" backward-word
bindkey "^H" backward-delete-word
# Enable autocompletion features
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
# Persistent rehash
zstyle ':completion:*' rehash true
# XDG_Base_Directories
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_BIN_HOME="${HOME}/.local/bin"
# Sourcing environment variables
if [ -f "${XDG_CONFIG_HOME}/custom/env" ]; then
. "${XDG_CONFIG_HOME}/custom/env"
fi
# Enable color support of ls
if [ -f "${XDG_CONFIG_HOME}/custom/dircolors" ]; then
dircolors -b "${XDG_CONFIG_HOME}/custom/dircolors" > /dev/null 2>&1
fi
# Sourcing alias definitions
if [ -f "${XDG_CONFIG_HOME}/custom/aliases" ]; then
. "${XDG_CONFIG_HOME}/custom/aliases"
fi