From ef46d0e0a07a78462f582114a190a54b520d75d9 Mon Sep 17 00:00:00 2001 From: eeleater Date: Thu, 15 Aug 2024 23:25:11 +0200 Subject: [PATCH] updated antidote in prep for usage on laptop --- dot_config/kitty/kitty.conf | 2 +- dot_config/topgrade.toml.tmpl | 6 +- dot_config/zsh/dot_zprofile | 1 - dot_config/zsh/dot_zsh_plugins.txt | 33 ++-- dot_config/zsh/{dot_zshrc => dot_zshrc.tmpl} | 17 +- dot_config/zsh/files/bashcomps.zsh | 11 -- dot_config/zsh/files/compinit.zsh | 4 - dot_config/zsh/files/distroicon.zsh | 33 ---- dot_config/zsh/files/evalstuff.zsh | 3 - dot_config/zsh/files/mal.zsh | 195 ------------------- dot_config/zsh/files/options.zsh | 5 - 11 files changed, 29 insertions(+), 281 deletions(-) delete mode 100644 dot_config/zsh/dot_zprofile rename dot_config/zsh/{dot_zshrc => dot_zshrc.tmpl} (82%) delete mode 100644 dot_config/zsh/files/bashcomps.zsh delete mode 100644 dot_config/zsh/files/compinit.zsh delete mode 100644 dot_config/zsh/files/distroicon.zsh delete mode 100644 dot_config/zsh/files/mal.zsh delete mode 100644 dot_config/zsh/files/options.zsh diff --git a/dot_config/kitty/kitty.conf b/dot_config/kitty/kitty.conf index d4c30d8..efa925e 100644 --- a/dot_config/kitty/kitty.conf +++ b/dot_config/kitty/kitty.conf @@ -7,7 +7,7 @@ enable_audio_bell no shell_integration disabled # Fonts -font_family FiraCode Nerd Font +font_family CommitMono Nerd Font # BEGIN_KITTY_THEME # Dracula diff --git a/dot_config/topgrade.toml.tmpl b/dot_config/topgrade.toml.tmpl index f293b35..1098f6a 100644 --- a/dot_config/topgrade.toml.tmpl +++ b/dot_config/topgrade.toml.tmpl @@ -21,11 +21,11 @@ skip_notify = true #run_in_tmux = true # List of remote machines with Topgrade installed on them -{{ if eq .chezmoi.hostname "pxm" }} +{{- if eq .chezmoi.hostname "pxm" }} remote_topgrades = ["docker", "kali", "mail"] -{{ else }} +{{- else }} remote_topgrades = ["pxm", "web", "infra"] -{{ end }} +{{- end }} # Arguments to pass SSH when upgrading remote systems #ssh_arguments = "-o ConnectTimeout=2" diff --git a/dot_config/zsh/dot_zprofile b/dot_config/zsh/dot_zprofile deleted file mode 100644 index 4e2652e..0000000 --- a/dot_config/zsh/dot_zprofile +++ /dev/null @@ -1 +0,0 @@ -# create the file diff --git a/dot_config/zsh/dot_zsh_plugins.txt b/dot_config/zsh/dot_zsh_plugins.txt index 08c0d61..2767945 100644 --- a/dot_config/zsh/dot_zsh_plugins.txt +++ b/dot_config/zsh/dot_zsh_plugins.txt @@ -1,32 +1,33 @@ -# completions -zsh-users/zsh-completions - # lscolors trapd00r/LS_COLORS # ohmyzsh -ohmyzsh/ohmyzsh path:lib/completion.zsh -ohmyzsh/ohmyzsh path:lib/key-bindings.zsh -ohmyzsh/ohmyzsh path:lib/history.zsh -ohmyzsh/ohmyzsh path:lib/directories.zsh +getantidote/use-omz +ohmyzsh/ohmyzsh path:lib + +# omz plugins ohmyzsh/ohmyzsh path:plugins/systemd ohmyzsh/ohmyzsh path:plugins/command-not-found +ohmyzsh/ohmyzsh path:plugins/fzf ohmyzsh/ohmyzsh path:plugins/ssh-agent -# other plugins -Aloxaf/fzf-tab -urbainvaes/fzf-marks +# utility plugins +3v1n0/zsh-bash-completions-fallback mroth/evalcache zpm-zsh/colorize -sobolevn/wakatime-zsh-plugin -amyreese/zsh-titles -laggardkernel/zsh-thefuck twopizza9621536/zsh-eza fdellwing/zsh-bat +amyreese/zsh-titles +Aloxaf/fzf-tab + +# other plugins +urbainvaes/fzf-marks +sobolevn/wakatime-zsh-plugin +laggardkernel/zsh-thefuck MichaelAquilina/zsh-you-should-use asdf-vm/asdf -olets/zsh-abbr -# fish like +# fish like (load last) +zsh-users/zsh-completions path:src kind:fpath zsh-users/zsh-autosuggestions -zsh-users/zsh-syntax-highlighting +zdharma-continuum/fast-syntax-highlighting diff --git a/dot_config/zsh/dot_zshrc b/dot_config/zsh/dot_zshrc.tmpl similarity index 82% rename from dot_config/zsh/dot_zshrc rename to dot_config/zsh/dot_zshrc.tmpl index 864f264..c6ca66d 100644 --- a/dot_config/zsh/dot_zshrc +++ b/dot_config/zsh/dot_zshrc.tmpl @@ -1,6 +1,10 @@ test -v DISTROBOX_HOST_HOME && { unset ZDOTDIR; exec zsh } # fix distrobox test "x$TERMINALNAME" = "xalacritty" && eval "$(zellij setup --generate-auto-start zsh)" # autostart zellij only in alacritty +# options +setopt NO_CLOBBER INTERACTIVE_COMMENTS HASH_EXECUTABLES_ONLY NUMERIC_GLOB_SORT +unsetopt FLOW_CONTROL + # deduplicate path typeset -U path PATH path+=("$XDG_DATA_HOME"/JetBrains/Toolbox/scripts) # jetbrains toolbox @@ -10,28 +14,23 @@ path+=("$HOME"/.local/bin) # local bin potentialBanner=('joke bofh' 'joke dad' 'fastfetch') eval "$potentialBanner[$RANDOM%$#potentialBanner+1]" -# disable flowcontrol -stty -ixon - -# initialize completion system -source "$ZDOTDIR"/files/compinit.zsh - # antidote +{{- if eq .chezmoi.osRelease.id "endeavouros" }} +source '/usr/share/zsh-antidote/antidote.zsh' +{{- else }} test -r "$XDG_DATA_HOME"/antidote/antidote.zsh || git clone https://github.com/mattmc3/antidote.git "$XDG_DATA_HOME"/antidote source "$XDG_DATA_HOME"/antidote/antidote.zsh +{{- end }} zstyle ':antidote:bundle' use-friendly-names 'yes' antidote load # source files source "$ZDOTDIR"/files/evalstuff.zsh -source "$ZDOTDIR"/files/options.zsh source "$ZDOTDIR"/files/aliases.zsh source "$ZDOTDIR"/files/functions.zsh -source "$ZDOTDIR"/files/distroicon.zsh # completion files source "$ZDOTDIR"/files/sshcomp.zsh -source "$ZDOTDIR"/files/bashcomps.zsh # local overrides for sourced in "$XDG_DATA_HOME"/zsh/files/*; do source $sourced; done diff --git a/dot_config/zsh/files/bashcomps.zsh b/dot_config/zsh/files/bashcomps.zsh deleted file mode 100644 index 7c9b85c..0000000 --- a/dot_config/zsh/files/bashcomps.zsh +++ /dev/null @@ -1,11 +0,0 @@ -if (( ${+commands[distrobox]} )); then - source /usr/share/bash-completion/completions/distrobox - source /usr/share/bash-completion/completions/distrobox-create - source /usr/share/bash-completion/completions/distrobox-enter - source /usr/share/bash-completion/completions/distrobox-ephemeral - source /usr/share/bash-completion/completions/distrobox-generate-entry - source /usr/share/bash-completion/completions/distrobox-list - source /usr/share/bash-completion/completions/distrobox-rm - source /usr/share/bash-completion/completions/distrobox-stop - source /usr/share/bash-completion/completions/distrobox-upgrade -fi diff --git a/dot_config/zsh/files/compinit.zsh b/dot_config/zsh/files/compinit.zsh deleted file mode 100644 index afd93cc..0000000 --- a/dot_config/zsh/files/compinit.zsh +++ /dev/null @@ -1,4 +0,0 @@ -mkdir -p "$XDG_CACHE_HOME"/zsh &>/dev/null - -autoload -Uz compinit -compinit -d "$XDG_CACHE_HOME"/zsh/compdump diff --git a/dot_config/zsh/files/distroicon.zsh b/dot_config/zsh/files/distroicon.zsh deleted file mode 100644 index fc4599c..0000000 --- a/dot_config/zsh/files/distroicon.zsh +++ /dev/null @@ -1,33 +0,0 @@ -# find out which distribution we are running on -FILE="/etc/*-release" -if [[ -f $FILE ]]; then - _distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }') -fi - -# set an icon based on the distro -case $_distro in - *kali*) ICON="ﴣ";; - *arch*|*endeavouros*) ICON="";; - *debian*) ICON="";; - *raspbian*) ICON="";; - *ubuntu*) ICON="";; - *elementary*) ICON="";; - *fedora*) ICON="";; - *coreos*) ICON="";; - *gentoo*) ICON="";; - *mageia*) ICON="";; - *centos*) ICON="";; - *opensuse*|*tumbleweed*) ICON="";; - *sabayon*) ICON="";; - *slackware*) ICON="";; - *linuxmint*) ICON="";; - *alpine*) ICON="";; - *aosc*) ICON="";; - *nixos*) ICON="";; - *devuan*) ICON="";; - *manjaro*) ICON="";; - *rhel*) ICON="";; - *) ICON="";; -esac - -export DISTROICON="$ICON" diff --git a/dot_config/zsh/files/evalstuff.zsh b/dot_config/zsh/files/evalstuff.zsh index b19e153..10e3509 100644 --- a/dot_config/zsh/files/evalstuff.zsh +++ b/dot_config/zsh/files/evalstuff.zsh @@ -1,8 +1,5 @@ # evalstuff -_evalcache fzf --zsh _evalcache zoxide init --cmd cd zsh _evalcache atuin init zsh _evalcache navi widget zsh _evalcache direnv hook zsh -#_evalcache ntfy shell-integration -#eval "$(keychain --dir "$XDG_CACHE_HOME"/keychain --eval --quiet id_rsa)" diff --git a/dot_config/zsh/files/mal.zsh b/dot_config/zsh/files/mal.zsh deleted file mode 100644 index fc14d7d..0000000 --- a/dot_config/zsh/files/mal.zsh +++ /dev/null @@ -1,195 +0,0 @@ -export ALIASES_FILE="$XDG_CONFIG_HOME"/aliasesrc - -function mal { - # Use fzf to allow the user to select an alias from the aliases file - function _execute_alias { - local alias_to_execute=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf) - - # Check if the user cancelled the selection - test -z $alias_to_execute && return 1 - - echo "Executing alias: $alias_to_execute" - # Execute the selected alias - eval ${alias_to_execute%%=*} - return 0 - } - - # Delete an existing alias by selecting it from a list - function _interactive_delete { - local alias_to_delete=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf) - - # Check if the user cancelled the selection - test -z $alias_to_delete && return 1 - - echo "Deleted alias: $alias_to_delete" - # Delete the selected alias from the aliases file - sed -i "/^alias ${alias_to_delete%%=*}=/d" "$ALIASES_FILE" - unalias ${alias_to_delete%%=*} - } - - # Delete an existing alias using specified name - function _parameter_delete { - local alias_to_delete=$1 - local line_with_alias=$(grep "$1=" "$ALIASES_FILE") - - # Check if the alias exists in the aliases file - if test -z "$line_with_alias"; then - echo "No alias with the name $1 found." - return 2 - fi - - echo "Deleted alias: $alias_to_delete" - # Delete the selected alias from the aliases file - sed -i "/^alias ${alias_to_delete%%=*}=/d" "$ALIASES_FILE" - unalias ${alias_to_delete%%=*} - } - - # Rename an existing alias by selecting it from a list - function _interactive_rename { - local alias_to_rename=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf) - - # Check if the user cancelled the selection - test -z $alias_to_rename && return 1 - - echo "Input new name:" - read new_name - echo "Renaming alias from $alias_to_rename to $new_name" - sed -i "s/^alias ${alias_to_rename%%=*}=/alias ${new_name}=/g" "$ALIASES_FILE" - unalias ${alias_to_rename%%=*} - } - - # Rename an existing alias using specified old and new names - function _parameter_rename { - local old_alias_name=$1 - local new_alias_name=$2 - local line_with_alias=$(grep "^alias ${old_alias_name}=" "$ALIASES_FILE") - - if test -z "$line_with_alias"; then - echo "No alias with the name $old_alias_name found." - return 1 - fi - - echo "Renaming alias from $old_alias_name to $new_alias_name" - sed -i "s/^alias ${old_alias_name}=/alias ${new_alias_name}=/g" "$ALIASES_FILE" - unalias ${old_alias_name} - } - - # Change the command associated with an existing alias by selecting it from a list - function _interactive_command_change { - local alias_to_change=$(cut -d' ' -f2- "$ALIASES_FILE" | fzf) - - # Check if the user cancelled the selection - test -z $alias_to_change && return 1 - - echo "Input new command:" - read new_command - echo "Changing command for alias ${alias_to_change%%=*} to \"$new_command\"" - sed -i "/^alias ${alias_to_change%%=*}=/{s/=.*/=\"$new_command\"/}" "$ALIASES_FILE" - } - - # Change the command associated with an existing alias using specified name and command - function _parameter_command_change { - local alias_to_change=$1 - local new_command="${@:2}" - local line_with_alias=$(grep "$alias_to_change=" "$ALIASES_FILE") - - if test -z "$line_with_alias"; then - echo "No alias with the name $alias_to_change found." - return 1 - fi - - echo "Changing command for alias $alias_to_change to \"$new_command\"" - sed -i "/^alias ${alias_to_change}=/{s/=.*/=\"$new_command\"/}" "$ALIASES_FILE" - } - - # Add a new alias - function _add_command { - local line_with_alias=$(grep "$1=" "$ALIASES_FILE") - - if test ! -z "$line_with_alias"; then - echo "Alias found: $line_with_alias; change alias by using the -c flag." - return 1 - fi - - local lh="alias $1" - local rh=\"${@:2}\" - local alias_str="$lh=$rh" - - echo $alias_str >>"$ALIASES_FILE" - echo "added '$alias_str' to .aliases" - } - - # List all aliases from the aliases file - function _list_aliases { - cut -d' ' -f2- "$ALIASES_FILE" | command cat - } - - # ============================================================================================================================================================== - - action="$1" - param1="$2" - param2="$3" - - # Check if the user has provided a help option or no arguments - helpParams=('-h' '--help' '-help') - if (($helpParams[(Ie)$action])) || test $# -eq 0; then - # Display usage information - echo "Usage: mal [OPTION]... [ALIAS_NAME] [ALIAS_COMMAND]..." - echo "" - echo "Create, delete, change, or execute aliases interactively." - echo "" - echo "Options:" - echo " -h, --help display this help and exit" - echo " -l list all defined aliases" - echo " -e execute an alias interactively" - echo " -d delete an alias interactively" - echo " -dn NAME delete an alias by name" - echo " -r rename an alias interactively" - echo " -rn OLD NEW rename an existing alias" - echo " -c change the command associated with an existing alias interactively" - echo " -cc NAME COMMAND change the command associated with an existing alias by name" - return 0 - fi - - case "$action" in - "-e") - # Execute an alias interactively - _execute_alias - ;; - "-l") - # List all aliases - _list_aliases - ;; - "-d") - # Delete an alias interactively - _interactive_delete - ;; - "-dn") - # Delete an alias using a parameter - _parameter_delete "$param1" - ;; - "-r") - # rename an alias interactively - _interactive_rename - ;; - "-rn") - # rename an alias using parameters - _parameter_rename "$param1" "$param2" - ;; - "-c") - # change a command interactively - _interactive_command_change - ;; - "-cc") - # change a command using parameters - _parameter_command_change "$param1" "$param2" - ;; - *) - # add a new command - _add_command "$action" "$param1" - ;; - esac - - # Reload aliases - source "$ALIASES_FILE" -} diff --git a/dot_config/zsh/files/options.zsh b/dot_config/zsh/files/options.zsh deleted file mode 100644 index a8477c6..0000000 --- a/dot_config/zsh/files/options.zsh +++ /dev/null @@ -1,5 +0,0 @@ -setopt NO_CLOBBER -setopt INTERACTIVE_COMMENTS -setopt HASH_EXECUTABLES_ONLY -setopt NUMERIC_GLOB_SORT -unsetopt FLOW_CONTROL