Updates for aliases and rc.d.
This commit is contained in:
parent
96d9c8db4b
commit
6c49e78867
|
|
@ -125,14 +125,14 @@ cat >"${ALIAS_FILE}" <<-'EOF'
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALIAS_FILE="${DEST}/${ALIAS_DIR}/003_local.sh"
|
ALIAS_FILE="${DEST}/${ALIAS_DIR}/003_local.zsh"
|
||||||
cat >"${ALIAS_FILE}" <<-'EOF'
|
cat >"${ALIAS_FILE}" <<-'EOF'
|
||||||
alias baobab='dbus-run-session baobab'
|
alias baobab='dbus-run-session baobab'
|
||||||
alias bc='bc -lq'
|
alias bc='bc -lq'
|
||||||
alias leech="wget -e robots=off -c -r --level=0 -nc -np --random-wait"
|
alias leech="wget -e robots=off -c -r --level=0 -nc -np --random-wait"
|
||||||
alias less="less -R"
|
alias less="less -R"
|
||||||
#alias mpv='mpv --ao=alsa --force-window -af "crossfeed=strength=0.2:range=0.5:slope=0.5:level_in=0.9:level_out=1:block_size=1024"'
|
#alias mpv='mpv --ao=alsa --force-window -af "crossfeed=strength=0.2:range=0.5:slope=0.5:level_in=0.9:level_out=1:block_size=1024"'
|
||||||
alias mpv='mpv --ao=pipewire --pipewire-buffer=47 --force-window'
|
#alias mpv='mpv --ao=pipewire --pipewire-buffer=47 --force-window'
|
||||||
alias odc='~/bin/odysee-dl_low.sh hls-215'
|
alias odc='~/bin/odysee-dl_low.sh hls-215'
|
||||||
alias pastebinit='pastebinit -b paste.debian.net'
|
alias pastebinit='pastebinit -b paste.debian.net'
|
||||||
alias plocate='plocate --existing --basename --ignore-case'
|
alias plocate='plocate --existing --basename --ignore-case'
|
||||||
|
|
@ -154,17 +154,26 @@ cat >"${ALIAS_FILE}" <<-'EOF'
|
||||||
alias ytfzf='ytfzf --ytdl-pref=18'
|
alias ytfzf='ytfzf --ytdl-pref=18'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_iotop.sh"
|
ALIAS_FILE="${DEST}/${ALIAS_DIR}/001_editor.zsh"
|
||||||
|
cat >"${ALIAS_FILE}" <<EOF
|
||||||
|
if [ -x /usr/bin/nvim ]; then
|
||||||
|
alias vi="/usr/bin/nvim"
|
||||||
|
alias vim="/usr/bin/nvim"
|
||||||
|
export EDITOR="/usr/bin/nvim"
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_iotop.zsh"
|
||||||
cat >"${ALIAS_FILE}" <<-'EOF'
|
cat >"${ALIAS_FILE}" <<-'EOF'
|
||||||
alias iotop='bash -c "sudo sysctl kernel.task_delayacct=1 && sudo iotop ; sudo sysctl kernel.task_delayacct=0"'
|
alias iotop='bash -c "sudo sysctl kernel.task_delayacct=1 && sudo iotop ; sudo sysctl kernel.task_delayacct=0"'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_docker_path.sh"
|
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_docker_path.zsh"
|
||||||
cat <<-EOF | tee "${ALIAS_FILE}"
|
cat <<-EOF | tee "${ALIAS_FILE}"
|
||||||
export PATH=$PATH:/usr/libexec/docker/cli-plugins
|
export PATH=$PATH:/usr/libexec/docker/cli-plugins
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_cargo-path.sh"
|
ALIAS_FILE="${DEST}/${ALIAS_DIR}/004_cargo-path.zsh"
|
||||||
cat <<-EOF | tee "${ALIAS_FILE}"
|
cat <<-EOF | tee "${ALIAS_FILE}"
|
||||||
export PATH=$PATH:${HOME}/.cargo/bin
|
export PATH=$PATH:${HOME}/.cargo/bin
|
||||||
EOF
|
EOF
|
||||||
|
|
|
||||||
|
|
@ -260,28 +260,34 @@ cat <<-EOF | tee "${DEST}"/.zgen-local-plugins
|
||||||
zgenom save
|
zgenom save
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Dedup path
|
||||||
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/zzz_dedup_path.zsh"
|
||||||
|
# Dedup the path, auto installers help themselves to you config files.'
|
||||||
|
typeset -U path
|
||||||
|
EOF
|
||||||
|
|
||||||
# prevent update
|
# prevent update
|
||||||
cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/001_quickstart-refresh.zsh
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/001_quickstart-refresh.zsh"
|
||||||
# Use unset 'QUICKSTART_KIT_REFRESH_IN_DAYS' to disable.'
|
# Use unset 'QUICKSTART_KIT_REFRESH_IN_DAYS' to disable.'
|
||||||
# QUICKSTART_KIT_REFRESH_IN_DAYS=0'
|
# QUICKSTART_KIT_REFRESH_IN_DAYS=0'
|
||||||
unset "QUICKSTART_KIT_REFRESH_IN_DAYS"
|
unset "QUICKSTART_KIT_REFRESH_IN_DAYS"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
#
|
#
|
||||||
echo '# zgenom autoupdate' >"${DEST}"/"${ALIAS_DIR}"/001_zgenom-refresh.zsh
|
echo '# zgenom autoupdate' >"${DEST}/${ALIAS_DIR}/001_zgenom-refresh.zsh"
|
||||||
|
|
||||||
# oh-my-zsh disable update check
|
# oh-my-zsh disable update check
|
||||||
echo 'DISABLE_AUTO_UPDATE="true"' >"${DEST}"/"${ALIAS_DIR}"/001_auto-update-off.zsh
|
echo 'DISABLE_AUTO_UPDATE="true"' >"${DEST}/${ALIAS_DIR}/001_auto-update-off.zsh"
|
||||||
|
|
||||||
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ~/.zshrc
|
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ~/.zshrc
|
||||||
|
|
||||||
# Use powerline-daemon to speedup the prompt.
|
# Use powerline-daemon to speedup the prompt.
|
||||||
echo 'powerline-daemon -q' >"${DEST}"/"${ALIAS_DIR}"/006_powerline-daemon.zsh
|
echo 'powerline-daemon -q' >"${DEST}/${ALIAS_DIR}/006_powerline-daemon.zsh"
|
||||||
|
|
||||||
sudo sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
|
sudo sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
|
||||||
|
|
||||||
# set theme for zsh
|
# set theme for zsh
|
||||||
cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/002_theme.zsh
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/002_theme.zsh"
|
||||||
# https://zshthem.es/browse-zsh-themes/
|
# https://zshthem.es/browse-zsh-themes/
|
||||||
ZSH_THEME="agnoster" # powerline based theme
|
ZSH_THEME="agnoster" # powerline based theme
|
||||||
#ZSH_THEME="3den"
|
#ZSH_THEME="3den"
|
||||||
|
|
@ -289,13 +295,13 @@ cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/002_theme.zsh
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# set colorize tool
|
# set colorize tool
|
||||||
cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/003_colorize.zsh
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/003_colorize.zsh"
|
||||||
ZSH_COLORIZE_TOOL="chroma"
|
ZSH_COLORIZE_TOOL="chroma"
|
||||||
ZSH_COLORIZE_CHROMA_FORMATTER=terminal256
|
ZSH_COLORIZE_CHROMA_FORMATTER=terminal256
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# see also ZVM jeffreytse/zsh-vi-mode plugin
|
# see also ZVM jeffreytse/zsh-vi-mode plugin
|
||||||
cat <<-'EOF' | tee "${DEST}"/"${ALIAS_DIR}"/001_vi-mode.sh
|
cat <<-'EOF' | tee "${DEST}/${ALIAS_DIR}/001_vi-mode.sh"
|
||||||
# Set vi mode
|
# Set vi mode
|
||||||
bindkey -v
|
bindkey -v
|
||||||
bindkey '^R' history-incremental-search-backward
|
bindkey '^R' history-incremental-search-backward
|
||||||
|
|
@ -338,7 +344,7 @@ EOF
|
||||||
|
|
||||||
## add a separate zsh aliases directory
|
## add a separate zsh aliases directory
|
||||||
|
|
||||||
cat <<'EOF' | tee "${DEST}"/"${ALIAS_DIR}"/000_enable-aliases-directory.zsh
|
cat <<'EOF' | tee "${DEST}/${ALIAS_DIR}/000_enable-aliases-directory.zsh"
|
||||||
# Enable ${ALIAS_DIR} to keep aliases separate from env variables
|
# Enable ${ALIAS_DIR} to keep aliases separate from env variables
|
||||||
if [ -d ~/.zsh_aliases.d ]; then
|
if [ -d ~/.zsh_aliases.d ]; then
|
||||||
for f in ~/.zsh_aliases.d/**/*.zsh(N); do
|
for f in ~/.zsh_aliases.d/**/*.zsh(N); do
|
||||||
|
|
@ -348,18 +354,18 @@ fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALIASES_HOME=".zsh_aliases.d"
|
ALIASES_HOME=".zsh_aliases.d"
|
||||||
mkdir -p "${DEST}"/"${ALIASES_HOME}"
|
mkdir -p "${DEST}/${ALIASES_HOME}"
|
||||||
|
|
||||||
# Set the path to the pipx bin directory
|
# Set the path to the pipx bin directory
|
||||||
cat <<'EOF' | tee "${DEST}"/"${ALIAS_DIR}"/001_pipx-path.zsh
|
cat <<'EOF' | tee "${DEST}/${ALIAS_DIR}/001_pipx-path.zsh"
|
||||||
export PATH="$PATH:$HOME/.local/bin"
|
export PATH="$PATH:$HOME/.local/bin"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value.
|
# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value.
|
||||||
echo "# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value." >"${DEST}"/"${ALIAS_DIR}"/002_sudo.zsh
|
echo "# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value." >"${DEST}"/"${ALIAS_DIR}"/002_sudo.zsh
|
||||||
echo 'alias sudo="sudo "' >>"${DEST}"/"${ALIAS_DIR}"/002_sudo.zsh
|
echo 'alias sudo="sudo "' >>"${DEST}/${ALIAS_DIR}/002_sudo.zsh"
|
||||||
|
|
||||||
cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/003_py_aliases.zsh
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/003_py_aliases.zsh"
|
||||||
_py_version() {
|
_py_version() {
|
||||||
PY_VERSIONS=(2 3)
|
PY_VERSIONS=(2 3)
|
||||||
|
|
||||||
|
|
@ -396,8 +402,8 @@ cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/003_py_aliases.zsh
|
||||||
# alias jupyter="_py_version"
|
# alias jupyter="_py_version"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkdir -p "${DEST}"/"${ALIAS_DIR}"/
|
mkdir -p "${DEST}/${ALIAS_DIR}/"
|
||||||
cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/003_transfer.zsh
|
cat <<-EOF | tee "${DEST}/${ALIAS_DIR}/003_transfer.zsh"
|
||||||
#
|
#
|
||||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||||
#
|
#
|
||||||
|
|
@ -466,10 +472,23 @@ cat <<-EOF | tee "${DEST}"/"${ALIAS_DIR}"/003_transfer.zsh
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF | tee "${DEST}"/"${ALIAS_DIR}"/002_nvm.zsh
|
cat <<EOF | tee "${DEST}/${ALIAS_DIR}/002_nvm.zsh"
|
||||||
plugins+=(nvm)
|
plugins+=(nvm)
|
||||||
zstyle ':omz:plugins:nvm' lazy yes
|
zstyle ':omz:plugins:nvm' lazy yes
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# https://github.com/catppuccin/fzf/blob/main/themes/catppuccin-fzf-mocha.sh
|
||||||
|
conf_print_fzf_colors() {
|
||||||
|
cat <<EOF
|
||||||
|
export FZF_DEFAULT_OPTS=" \
|
||||||
|
--color=bg+:#313244,bg:#1E1E2E,spinner:#F5E0DC,hl:#F38BA8 \
|
||||||
|
--color=fg:#CDD6F4,header:#F38BA8,info:#CBA6F7,pointer:#F5E0DC \
|
||||||
|
--color=marker:#B4BEFE,fg+:#CDD6F4,prompt:#CBA6F7,hl+:#F38BA8 \
|
||||||
|
--color=selected-bg:#45475A \
|
||||||
|
--color=border:#6C7086,label:#CDD6F4"
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
conf_print_fzf_colors | tee "${DEST}/${ALIAS_DIR}/002_fzf_colors.zsh"
|
||||||
|
|
||||||
sudo chown -R root:root /usr/local/share/zsh/site-functions
|
sudo chown -R root:root /usr/local/share/zsh/site-functions
|
||||||
sudo chmod -R 755 /usr/local/share/zsh/site-functions
|
sudo chmod -R 755 /usr/local/share/zsh/site-functions
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue