diff --git a/.zshrc b/.zshrc index cb19629..67f7b9c 100644 --- a/.zshrc +++ b/.zshrc @@ -31,21 +31,13 @@ bindkey "^[[3;5~" delete-word #C-Delete source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -source /usr/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh -# Tab -bindkey "^I" menu-select -bindkey -M menuselect "^I" menu-complete -# Shift + Tab -bindkey -M menuselect "^[[Z" reverse-menu-complete -bindkey -M menuselect "^A" .accept-line -bindkey -M menuselect "^E" .accept-line # The following lines were added by compinstall zstyle ':completion:*' menu select zstyle ':completion::complete:*' gain-privileges 1 zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*' 'r:|[._-]=* r:|=*' -#autoload -Uz compinit -#compinit +autoload -Uz compinit +compinit # End of lines added by compinstall autoload -Uz promptinit @@ -99,14 +91,8 @@ alias _fzf_complete_nano=_fzf_complete_cat source /usr/share/doc/fzf/examples/completion.zsh source /usr/share/doc/fzf/examples/key-bindings.zsh -prompt fire - -export GOBIN=/usr/local/bin -export PATH=$HOME/.yarn/bin:$HOME/.local/bin:$PATH - -eval "$(zoxide init --cmd cd zsh)" - -function fzf_packages(){ +bindkey "^[[A" fzf-history-widget +fzf_packages_widget(){ local cmd="dpkg --get-selections | grep -v deinstall | awk '{print \$1}' | fzf --layout reverse --multi --preview 'dpkg -s {1}' | command tr '\n' ' '" setopt localoptions pipefail no_aliases 2> /dev/null LBUFFER=${LBUFFER}$(eval $cmd) @@ -114,9 +100,15 @@ function fzf_packages(){ zle reset-prompt return $ret } -zle -N fzf_packages -bindkey "^_" fzf_packages +zle -N fzf_packages_widget +bindkey "^_" fzf_packages_widget +prompt fire + +export GOBIN=/usr/local/bin +export PATH=$HOME/.yarn/bin:$HOME/.local/bin:$PATH + +eval "$(zoxide init --cmd cd zsh)" export MANROFFOPT="-c" export MANPAGER="sh -c 'col -bx|batcat -l man -p'" diff --git a/add-crowdsec.sh b/add-crowdsec.sh index 413838c..fb0e4c2 100755 --- a/add-crowdsec.sh +++ b/add-crowdsec.sh @@ -16,7 +16,7 @@ main(){ $command install -y crowdsec crowdsec-firewall-bouncer-iptables } -setup(){ +config(){ echo -e "db_config: use_wal: true" | tee /etc/crowdsec/config.yaml.local @@ -62,5 +62,5 @@ done; main; if [ $INSTALL_ONLY -eq 0 ]; then - setup; + config; fi; \ No newline at end of file diff --git a/init.sh b/init.sh index a8af848..fa96917 100755 --- a/init.sh +++ b/init.sh @@ -9,6 +9,7 @@ case $OS_CODE in bookworm) OS_VERSION="12" ;; Trixie) OS_VERSION="13" ;; esac +DISTRO_PVE=$((command -v pvesh &>/dev/null && echo 1) || echo 0) SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") @@ -83,7 +84,7 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Architectures: $OS_ARCH " | tee /etc/apt/sources.list.d/debian.sources - if [ $FOR_PVE -eq 1 ]; then + if [ $DISTRO_PVE -eq 1 ]; then echo -e "Types: deb URIs: $PVE_URL Suites: $OS_CODE @@ -98,7 +99,7 @@ Signed-By: /etc/apt/trusted.gpg.d/proxmox-release-$OS_CODE.gpg $command install -y ca-certificates curl gnupg lsb-release zsh - if [ $FOR_PVE -eq 0 ]; then + if [ $DISTRO_PVE -eq 0 ]; then echo -e "Types: deb URIs: $DOCKER_URL Suites: $OS_CODE @@ -124,21 +125,15 @@ Architectures: $OS_ARCH usermod -s /usr/bin/zsh $(whoami) cp "$SCRIPTPATH/.zshrc" $HOME cp "$SCRIPTPATH/.screenrc" $HOME - if [ $FOR_PVE -eq 1 ]; then + if [ $DISTRO_PVE -eq 1 ]; then sed -i -E "s/.*prompt .*/prompt bart/g" $HOME/.zshrc fi cp "$SCRIPTPATH/TINK-CA.crt" /usr/local/share/ca-certificates update-ca-certificates - if [ $FOR_PVE -eq 1 ]; then - sed -i -E "s/.*zsh-autocomplete.*//g" $HOME/.zshrc - sed -i -E "s/.*menu-select.*//g" $HOME/.zshrc - sed -i -E "s/.*menuselect.*//g" $HOME/.zshrc - sed -i -E "s/#autoload -Uz compinit/autoload -Uz compinit/g" $HOME/.zshrc - sed -i -E "s/#compinit/compinit/g" $HOME/.zshrc + if [ $DISTRO_PVE -eq 1 ]; then sed -i -E "s/.*zoxide.*//g" $HOME/.zshrc else - $SCRIPTPATH/install-release.sh -r marlonrichert/zsh-autocomplete -k tarball -p /usr/share/zsh-autocomplete -d 0 -o autocomplete.tar.gz $SCRIPTPATH/install-release.sh -r ajeetdsouza/zoxide -m x86_64-unknown -p /usr/local/bin -n zoxide -f fi } @@ -156,7 +151,6 @@ usage(){ echo "OPTIONS:"; echo " -f package list file (default: $PKG_BASE)"; echo " -i install only"; - echo " -p pve"; echo " -m apt mirror source"; echo " * official" echo " 1 nju (default)" @@ -167,7 +161,6 @@ usage(){ PKG_BASE="$SCRIPTPATH/packages-base" INSTALL_ONLY=0; -FOR_PVE=0; MIRROR_SOURCE=1; while getopts ":f:ipm:" OPT; do case $OPT in @@ -177,9 +170,6 @@ while getopts ":f:ipm:" OPT; do i) INSTALL_ONLY=1; ;; - p) - FOR_PVE=1; - ;; m) MIRROR_SOURCE=$OPTARG; ;;