Moved chezmoi data one level down under chezmoi.roots

This commit is contained in:
Lockszmith (Mac@VAST) 2025-04-14 14:05:59 -04:00
parent c34f7ae631
commit de47f0c388
240 changed files with 90 additions and 76 deletions

View file

@ -0,0 +1,142 @@
## where to store your database, default is your system data directory
## linux/mac: ~/.local/share/atuin/history.db
## windows: %USERPROFILE%/.local/share/atuin/history.db
# db_path = "~/.history.db"
## where to store your encryption key, default is your system data directory
## linux/mac: ~/.local/share/atuin/key
## windows: %USERPROFILE%/.local/share/atuin/key
# key_path = "~/.key"
## where to store your auth session token, default is your system data directory
## linux/mac: ~/.local/share/atuin/session
## windows: %USERPROFILE%/.local/share/atuin/session
# session_path = "~/.session"
## date format used, either "us" or "uk"
# dialect = "us"
## enable or disable automatic sync
# auto_sync = true
## enable or disable automatic update checks
# update_check = true
## address of the sync server
# sync_address = "http://192.168.222.65"
## how often to sync history. note that this is only triggered when a command
## is ran, so sync intervals may well be longer
## set it to 0 to sync after every command
# sync_frequency = "10m"
## which search mode to use
## possible values: prefix, fulltext, fuzzy, skim
# search_mode = "fuzzy"
## which filter mode to use
## possible values: global, host, session, directory
# filter_mode = "global"
## With workspace filtering enabled, Atuin will filter for commands executed
## in any directory within a git repository tree (default: false)
# workspaces = false
## which filter mode to use when atuin is invoked from a shell up-key binding
## the accepted values are identical to those of "filter_mode"
## leave unspecified to use same mode set in "filter_mode"
# filter_mode_shell_up_key_binding = "directory"
## which search mode to use when atuin is invoked from a shell up-key binding
## the accepted values are identical to those of "search_mode"
## leave unspecified to use same mode set in "search_mode"
# search_mode_shell_up_key_binding = "fuzzy"
## which style to use
## possible values: auto, full, compact
# style = "auto"
## the maximum number of lines the interface should take up
## set it to 0 to always go full screen
inline_height = 20
## Invert the UI - put the search bar at the top , Default to `false`
# invert = false
## enable or disable showing a preview of the selected command
## useful when the command is longer than the terminal width and is cut off
show_preview = true
## what to do when the escape key is pressed when searching
## possible values: return-original, return-query
# exit_mode = "return-original"
## possible values: emacs, subl
# word_jump_mode = "emacs"
## characters that count as a part of a word
# word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
## number of context lines to show when scrolling by pages
# scroll_context_lines = 1
## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts
## alt-0 .. alt-9
# ctrl_n_shortcuts = false
## prevent commands matching any of these regexes from being written to history.
## Note that these regular expressions are unanchored, i.e. if they don't start
## with ^ or end with $, they'll match anywhere in the command.
## For details on the supported regular expression syntax, see
## https://docs.rs/regex/latest/regex/#syntax
# history_filter = [
# "^secret-cmd",
# "^innocuous-cmd .*--secret=.+"
# ]
## prevent commands run with cwd matching any of these regexes from being written
## to history. Note that these regular expressions are unanchored, i.e. if they don't
## start with ^ or end with $, they'll match anywhere in CWD.
## For details on the supported regular expression syntax, see
## https://docs.rs/regex/latest/regex/#syntax
# cwd_filter = [
# "^/very/secret/area"
# ]
## Configure the maximum height of the preview to show.
## Useful when you have long scripts in your history that you want to distinguish
## by more than the first few lines.
max_preview_height = 8
## Configure whether or not to show the help row, which includes the current Atuin
## version (and whether an update is available), a keymap hint, and the total
## amount of commands in your history.
show_help = true
## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include
## 1. AWS key id
## 2. Github pat (old and new)
## 3. Slack oauth tokens (bot, user)
## 4. Slack webhooks
## 5. Stripe live/test keys
# secrets_filter = true
## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit.
# This applies for new installs. Old installs will keep the old behaviour unless configured otherwise.
enter_accept = false
#[stats]
# Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl
common_subcommands = [
"cargo",
"go",
"git",
"npm",
"yarn",
"pnpm",
"kubectl",
"apt"
]
#
# Set commands that should be totally stripped and ignored from stats
#common_prefix = ["sudo"]

View file

@ -0,0 +1,37 @@
[General]
Backend = "gist" # specify backend service to sync snippets (gist, ghe or gitlab, default: gist)
cmd = ["sh", "-c"] # specify the command to execute the snippet with
Color = false # enables output coloring with fzf, same as '--color' flag
Column = 40 # column size for list command
Editor = "vim" # your favorite text editor
Format = "[$description]: $command $tags" # controls the format of the output when searching
SelectCmd = "fzf --ansi --layout=reverse --border --height=90% --pointer=* --cycle --prompt=Snippets:" # selector command for edit command (fzf or peco)
SnippetDirs = []
SnippetFile = "/Users/gal.szkolnik/.config/pet/snippet.toml" # specify snippet path
SortBy = "" # specify how snippets get sorted (recency (default), -recency, description, -description, command, -command, output, -output)
[Gist]
file_name = "pet-snippet.toml"
access_token = "" # your access token
gist_id = "" # Gist ID
Public = false # public or priate
auto_sync = false # sync automatically when editing snippets
[GitLab]
file_name = "pet-snippet.toml" # specify GitLab Snippets file name
access_token = "XXXXXXXXXXXXX" # your access token
ID = "" # GitLab Snippets ID
Visibility = "private" # public or internal or private
auto_sync = false # sync automatically when editing snippets
Url = ""
skip_ssl = false
[GHEGist]
Public = false
access_token = ""
auto_sync = false
base_url = ""
file_name = ""
gist_id = ""
upload_url = ""

View file

@ -0,0 +1,18 @@
[[Snippets]]
Description = "shell's nil"
Output = ""
Tag = []
command = ": ;"
[[Snippets]]
Description = "echo"
Output = ""
Tag = []
command = "echo"
[[Snippets]]
Description = "Initialize MacBook Pro connection into TechPort"
Output = ""
Tag = []
command = "lsif\nlsip\npull-vast.id_rsa 0\nvastconnect 192.168.2.2\nauto-copy-ssh-id 192.168.2.2"

View file

@ -0,0 +1,101 @@
# Customized, based on tokyo-night
# global prompt configuration ( https://starship.rs/config/#prompt )
format = """
[](#a3aed2)\
$os\
[](bg:#769ff0 fg:#a3aed2)\
$directory\
[](fg:#769ff0 bg:#394260)\
$git_branch\
$git_status\
[](fg:#394260 bg:#212736)\
$nodejs\
$rust\
$golang\
[](fg:#212736 bg:#1d2230)\
$time\
[](fg:#212736 bg:#1d2230)\
$cmd_duration\
$status\
[ ](fg:#1d2230)\
$line_break$character"""
command_timeout = 1500 # milliseconds; default is 500
[profiles]
transient = """
$time\
[](fg:#212736 bg:#1d2230)\
$character"""
[os]
style = "bg:#a3aed2 fg:#090c0c"
disabled = false
# Without NerdFont
#[os.symbols]
#Windows = " Win"
# NerdFont - see https://www.nerdfonts.com/cheat-sheet
[os.symbols]
Windows = " "
[directory]
style = "fg:#e3e5e5 bg:#769ff0"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
[git_branch]
symbol = ""
style = "bg:#394260"
format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)'
[git_status]
style = "bg:#394260"
format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)'
[nodejs]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[rust]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[golang]
symbol = ""
style = "bg:#212736"
format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)'
[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#1d2230"
format = '[[  $time ](fg:#a0a9cb bg:#1d2230)]($style)'
[cmd_duration]
min_time = 500 # milliseconds
# nerd font version:
format = 'prev: [[  $duration ](fg:#a0a9cb bg:#1d2230)]($style)'
# General UNICODE font version:
# format = '[[ ⧗ $duration ](fg:#a0a9cb bg:#1d2230)]($style)'
# Emoji version:
# format = '[[ ⌛ $duration ](fg:#a0a9cb bg:#1d2230)]($style)'
[status]
disabled = false
[character]
disabled = false

View file

@ -0,0 +1,9 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if [[ ! "$-" =~ i ]]; then
LOAD_EXIT=1
echo "Non interactive session ($-) , stopping load of shell environment" 1>&2
else
${NO_RESET:+:} reset
export NO_RESET=1
fi

View file

@ -0,0 +1,8 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
function is_truenas() {
local TRUENAS_TARGET="truenas.target"
[ "$(systemctl get-default)" = "$TRUENAS_TARGET" ] \
&& [ "$(systemctl is-active "$TRUENAS_TARGET")" = "active" ]
}

View file

@ -0,0 +1,4 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
PATH="$HOME/bin:$PATH"
PATH="$HOME/.local/bin:$PATH"

View file

@ -0,0 +1,3 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
export PATH="$HOME/.local/opt/node/bin:$PATH"

View file

@ -0,0 +1,16 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd midclt && [ -z "$SCALE_POOL" ]; then
export SCALE_POOL=szmedia
export SCALE_POOL="$(midclt call "kubernetes.config" 2>/dev/null | jq -r '.pool')"
[ -n "$SCALE_POOL" ] && [ "$SCALE_POOL" != "null" ] || export SCALE_POOL="$(midclt call "pool.query" 2>/dev/null | jq -r '.[0].name')"
[ -d "/mnt/$SCALE_POOL" ] || unset SCALE_POOL
fi
[ -n "$SCALE_POOL" ] \
&& export SCALE_POOL_ROOT=/mnt/$SCALE_POOL \
&& PATH="$SCALE_POOL_ROOT/_apps.data/_scripts/truestuff:$PATH" \
&& PATH="$SCALE_POOL_ROOT/data/scripts/truestuff:$PATH" \
&& export PATH

View file

@ -0,0 +1,15 @@
#!/usr/bin/env -S sh -c 'echo "Not a user script. source(aka .) only"'
# Remove duplicates from PATH
OLDPATH="$PATH"; NEWPATH=""; colon=""
while [ "${OLDPATH#*:}" != "$OLDPATH" ]; do
entry="${OLDPATH%%:*}"; search=":${OLDPATH#*:}:"
[ "${search#*:"$entry":}" = "$search" ] && [[ -d $entry ]] && NEWPATH="$NEWPATH$colon$entry" && colon=:
OLDPATH="${OLDPATH#*:}"
done
NEWPATH="$NEWPATH:$OLDPATH"
export PATH="$NEWPATH"
unset NEWPATH OLDPATH colon entry search
[[ -n "${DBG}" ]] && echo "${PATH//:/\n}"

View file

@ -0,0 +1,12 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
SZ_NOMUX=${SZ_NOMUX:-0}
if [ "${SZ_NOMUX:-0}" -ne 1 ]; then
[ "$TERM_PROGRAM" != 'vscode' ] \
&& [ "$TERM_PROGRAM" != 'Tabby' ] \
&& [ -z "${VSCODE_PROFILE_INITIALIZED}" ] \
|| SZ_NOMUX=1
fi

View file

@ -0,0 +1,68 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if [[ "${BASE_SHELL}" == "zsh" ]]; then
[ -z "$ZSH_CACHE_DIR" ] && export ZSH_CACHE_DIR=$HOME/.cache/zsh
mkdir -p $ZSH_CACHE_DIR/completions
mkdir -p "$HOME/.local/share/zsh/completions"
# Remove duplicates from fpath, and add local completion dir
fpath=( $(
for d in $(
awk '!seen[$0]++' <(
echo "$HOME/.local/share/zsh/completions"
printf '%s\n' $fpath
)
); do
[ -d "$d" ] && echo "$d"
done
) )
skip_global_compinit=1
# # Jump to the bottom of the screen
# SZ_TPUT_END=$(tput cup 9999 0)
# echo $SZ_TPUT_END
PS1="$(zsh -c '. <([ -n "$(echo /etc/*-release(N))" ] && cat /etc/*-release(N) | uniq -u || NAME="$VENDOR" ); echo "$NAME $VERSION_ID "')| ZSH ${ZSH_VERSION} LOADING >"
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#""" Shell Settings """
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
typeset -g HISTFILE="$HOME/.zsh_history"
typeset -g HISTSIZE=1000000
typeset -g SAVEHIST=$HISTSIZE
typeset -g COMPLETION_WAITING_DOTS="true"
setopt hist_ignore_dups # ignore duplicated commands history list
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # fix "+[__NSPlaceholderDictionary initialize] may have been in progress in another thread when fork() was called" issue
#####################
# SETOPT #
#####################
setopt promptsubst
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_all_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data
setopt always_to_end # cursor moved to the end in full completion
setopt hash_list_all # hash everything before completion
setopt nocompletealiases # no complete alisases - no need for specific compdef for aliases
setopt always_to_end # when completing from the middle of a word, move the cursor to the end of the word
setopt complete_in_word # allow completion from within a word/phrase
setopt nocorrect # spelling correction for commands
setopt list_ambiguous # complete as much of a completion until it gets ambiguous.
setopt auto_cd # changing directories without cd
setopt nolisttypes
setopt listpacked
setopt automenu
setopt interactivecomments # allow # comments in command-line
setopt vi
[[ -n "${DBG}" ]] && echo "ZSH preped"
fi

View file

@ -0,0 +1,31 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#""" z-shell/zi """
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#
# ### Added by z-shell/zi's installer
ZI_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zi/bin"
mkdir -p "$(dirname "$ZI_HOME")"
if [[ ! -d "$ZI_HOME/.git" ]]; then
print -P "%F{33}▓▒░ %F{160}Installing (%F{33}z-shell/zi%F{160})…%f"
command mkdir -p "$(dirname "$ZINIT_HOME")" \
&& command chmod go-rwX "$(dirname "$ZI_HOME")"
command git clone -q --depth=1 --branch "main" \
https://github.com/z-shell/zi.git "$ZI_HOME" \
&& print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" \
|| print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "${ZI_HOME}/zi.zsh"
autoload -Uz _zi
(( ${+_comps} )) && _comps[zi]=_zi
# examples here -> https://wiki.zshell.dev/ecosystem/category/-annexes
zicompinit # <- https://wiki.zshell.dev/docs/guides/commands
### End of z-shell/zi installer's chunk
alias zinit=zi
zinit ice depth=1
zinit light jeffreytse/zsh-vi-mode
[[ -n "${DBG}" ]] && echo "zi ready"

View file

@ -0,0 +1,10 @@
#!/usr/bin/env -S zsh -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if [[ "${BASE_SHELL}" == "zsh" ]]; then
autoload -Uz +X compinit bashcompinit && compinit && bashcompinit
zstyle ':completion:*' menu yes select
fi

View file

@ -0,0 +1,12 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd load-zellij; then
[[ -z "$ZELLIJ_SESSION_NAME" && "${SZ_NOMUX:-0}" -eq '1' ]] \
&& ZELLIJ_SESSION_NAME=__NO_LOAD__
# zellij will need to allow reload of the enviornment
[[ -z "$ZELLIJ_SESSION_NAME" ]] && unset SZ_ENV_LOADED
. <( load-zellij - )
[[ -z "$ZELLIJ_SESSION_NAME" ]] && SZ_ENV_LOADED=1
[[ "$ZELLIJ_SESSION_NAME" == '__NO_LOAD__' ]] && unset ZELLIJ_SESSION_NAME
fi

View file

@ -0,0 +1,37 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
alias _ls='command ls '
{{- if eq .chezmoi.os "darwin" }}
alias ls='_ls -hF --color=auto '
alias l='ls -la '
alias lold='l -t '
alias lnew='l -tr '
{{ else }}
alias ls='_ls -hF --color=auto --group-directories-first '
alias l='ls -la '
alias lold='l --sort=time '
alias lnew='l --sort=time --reverse '
{{- end }}
alias ll='l -A'
alias lu='l -U '
alias sudo='sudo '
is_cmd ov \
&& alias less="ov " \
&& export PAGER=ov
is_cmd moar \
&& alias less="moar " \
&& export PAGER=moar
is_cmd nvim \
&& export VISUAL="nvim" EDITOR="nvim" \
|| export VISUAL="vim" EDITOR="vim"
alias nvim="POSTFIX_BUITINS=1 command $EDITOR -p "
alias vi='nvim '
alias vim='nvim '
alias nvimdiff='nvim -d '
alias vimdiff='nvimdiff '

View file

@ -0,0 +1,24 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
update-bash-preexec() {
local workdir="$SZ_ENV_ROOT/lib/bash-preexec"
[ -d "$workdir" ] && rm -fR "$workdir"
mkdir -p "$workdir"
cd "$workdir"
# Pull down our file from GitHub and write it to your home directory as a hidden file.
curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ./bash-preexec.sh
# Source our file to bring it into our environment
source .bash-preexec.sh
source "$workdir/ble-nightly/ble.sh"
}
# shellcheck disable=SC1091 source=$HOME/.bash-preexec.sh
if [[ -f "$SZ_ENV_ROOT/lib/bash-preexec/.bash-preexec.sh" ]]; then
SZ_ENV_BASH_LOAD_PREEXEC='. "$SZ_ENV_ROOT/lib/bash-preexec/.bash-preexec.sh"'
[[ -n "${DBG}" ]] && echo "Bash-preexec will be loaded."
fi

View file

@ -0,0 +1,22 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
update-ble.sh() {
[[ -n "${DBG}" ]] && set -x
local workdir="$SZ_ENV_ROOT/lib/ble.sh.curl"
[ -d "$workdir" ] && rm -fR "$workdir"
mkdir -p "$workdir"
cd "$workdir"
curl -L https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
source "$workdir/ble-nightly/ble.sh"
[[ -n "${DBG}" ]] && set +x
}
if [ -f "$SZ_ENV_ROOT/lib/ble.sh.curl/ble-nightly/ble.sh" ]; then
source "$SZ_ENV_ROOT/lib/ble.sh.curl/ble-nightly/ble.sh" --noattach
fi
if [[ -n "${DBG}" && -n "${BLE_VERSION-}" ]]; then
echo "ble.sh will be loaded."
fi

View file

@ -0,0 +1,6 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd broot; then
source /mnt/szmedia/USERDATA/home/sz/.config/broot/launcher/bash/br
fi

View file

@ -0,0 +1,10 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if [ -f "$SZ_ENV_ROOT/lib/complete-alias" ]; then
source "$SZ_ENV_ROOT/lib/complete-alias" --noattach
fi
if [[ -n "${DBG}" && -n "$( command -v _complete_alias )" ]]; then
echo "complete-alias will be loaded."
fi

View file

@ -0,0 +1,15 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
export ENVMAN_LOAD=''
if [ -s "$HOME/.config/envman/load.sh" ]; then
[[ -n "${DBG}" ]] && echo "Loading envman"
source "$HOME/.config/envman/load.sh"
[[ -n "${DBG}" ]] && echo "${PATH//:/\n}"
fi
if is_cmd webi; then
. <(webi --init "${SHELL##*/}")
fi

View file

@ -0,0 +1,97 @@
#! /usr/bin/env bash
# Helper function
is_sourced() {
if [ -n "$ZSH_VERSION" ]; then
case $ZSH_EVAL_CONTEXT in *:file:*) return 0;; esac
else # Add additional POSIX-compatible shell names here, if needed.
case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh) return 0;; esac
fi
return 1; # NOT sourced.
}
BASE_0=${BASE_0:-$0}
BASE_SHELL=$(basename "$SHELL")
is_cmd() {
type -p -- "${@}" 2> /dev/null 1> /dev/null
}
if is_sourced; then
# shellcheck disable=SC2139 # This expands when defined, not when used.
alias _r="unset DBG; exec $SHELL -l "
# shellcheck disable=SC2139 # This expands when defined, not when used.
alias _rdbg="exec sh -c 'DBG=1 $SHELL -l '"
SZ_ENV_ROOT=$( cd -- "$( dirname -- "${BASE_0}" )" &> /dev/null && pwd )
USER_HOME=$HOME
[[ -n "${SUDO_USER}" ]] && USER_HOME="$(eval "echo ~${SUDO_USER}")"
load_next() {
[ "$LOAD_EXIT" != "0" ] && return 1
if [[ -n "${DBG}" ]]; then
echo "Loading ${1}..." 1>&2
#shellcheck disable=SC2086
${DBG/%1/:} 1>&2
fi
#shellcheck source=/dev/null
. "${1}"
}
load_all() {
local ALL_ENV_FILES
if [ -z "$SZ_ENV_LOADED" ]; then
SZ_ENV_LOADED=1
LOAD_EXIT=0
# The following constructs a list of load_next ... commands
FIND_CMD="$( printf "%s " \
"find ~/.config/sz.env -xdev -type d -not -name '*.off'" \
"-exec sh -c '" \
'find "$1" -xdev -maxdepth 1 -type f' \
'-name "ID_*.env" -or -name "ID_*.env.'"${BASE_SHELL}"\" \
"| sort' shell '{}' ';'" \
"-exec sh -c '" \
'find "$1" -xdev -maxdepth 1 -type f' \
'-name "PATH_*.env" -or -name "PATH_*.env.'"${BASE_SHELL}"\" \
"| sort' shell '{}' ';'" \
"-exec sh -c '" \
'find "$1" -xdev -maxdepth 1 -type f' \
'-name "*.env" -or -name "*.env.'"${BASE_SHELL}"\" \
'| grep -Ev "/(PATH|ID)_[^/]+$"' \
"| sort' shell '{}' ';'" \
"-exec sh -c '" \
'find "$1" -xdev -maxdepth 1 -type f -name "PATH_zz_cleanup.env"' \
"' shell '{}' ';'"
)"
ALL_ENV_FILES="$(
eval "$FIND_CMD" | sed -e 's/^/load_next "/; s/$/";/'
)"
${DBG/%1/:} unset FIND_CMD
if [ -n "$DBG_NO_SZ_LOAD" ]; then
ALL_ENV_FILES=$(<<<"$ALL_ENV_FILES" sed -Ee '
/PATH_/!s/^(load_next )/# \1/
')
printf 'Loading limited environment...\n'
fi
# Run the constructed (see above) list
eval "$ALL_ENV_FILES"
${DBG/%1/:} unset ALL_ENV_FILES
fi
}
load_all
elif [[ "$1" == '-' ]]; then
echo "BASE_0=${BASE_0}"
cat "${0}"
else
is_cmd "${BASE_0##*/}" && SCRIPT_NAME="${BASE_0##*/}" || SCRIPT_NAME="${BASE_0/$HOME/\~}"
printf '%s\n' \
"It seems '$SCRIPT_NAME' was invoked as a standalone script." \
'This script is designed to produce output that is sourced.' \
'' \
'The recommended way is to use calling pattern below:' \
" $ . <( $SCRIPT_NAME - ) # Note the '-' after the script's name" \
''
fi

View file

@ -0,0 +1,7 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd szetup-kubectl4k3s && [ "$(systemctl is-active k3s.service)" = "active" ]; then
. <( szetup-kubectl4k3s - )
[[ -n "${DBG}" ]] && echo "kubectl for k3s setup complete."
fi

View file

@ -0,0 +1,22 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if [[ -x "${CUSTOM_NVIM_PATH:-$HOME/.local/bin/nvim}" ]]; then
fix_nvim () {
CUSTOM_NVIM_PATH="${CUSTOM_NVIM_PATH:-$HOME/.local/bin/nvim}"
printf '%s\n' \
"update-alternatives --install /usr/bin/editor editor '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/edit edit '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/ex ex '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/vi vi '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/view view '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/vim vim '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --install /usr/bin/vimdiff vimdiff '${CUSTOM_NVIM_PATH}' 110" \
"update-alternatives --set editor '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set edit '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set ex '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set vi '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set view '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set vim '${CUSTOM_NVIM_PATH}'" \
"update-alternatives --set vimdiff '${CUSTOM_NVIM_PATH}'"
}
fi

View file

@ -0,0 +1,19 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd midclt; then
if [ -n "$SCALE_POOL_ROOT" ]; then
if [ -e "$SCALE_POOL_ROOT/jailmaker/jlmkr.py" ]; then
#alias jlmkr="bash -c '_jlmkr() { $SCALE_POOL_ROOT/jailmaker/jlmkr.py \${@:---help}; }; _jlmkr \$@' "
function jlmkr() { sudo VISUAL="${VISUAL:-}" EDITOR="${EDITOR:-}" $SCALE_POOL_ROOT/jailmaker/jlmkr.py "${@:---help}"; }
jlmkr-zellij() {
zellij action go-to-tab-name --create "jailmkr"
zellij action new-pane --name "${1:?must pass jail name}@jlmkr" -- sh -ci "reset; sudo $SCALE_POOL_ROOT/jailmaker/jlmkr.py shell --uid ${UID} ${1}"
zellij action focus-previous-pane
zellij action close-pane
}
fi
fi
fi

View file

@ -0,0 +1,17 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if is_cmd atuin; then
if [[ "${BASE_SHELL}" == "bash" ]] && ! [[ -n "$SZ_ENV_BASH_LOAD_PREEXEC$BLE_VERSION" ]]; then
printf '%s\n' \
'atuin was found, but bash-preexec or ble.sh are not loaded,' \
'to load atuin, first run update-ble.sh or update-bash-preexec ' \
'then relaod (_r) the shell.'
fi
. <( atuin init "${BASE_SHELL}" )
. <( atuin gen-completions --shell ${BASE_SHELL} )
[[ -n "${DBG}" ]] && echo "atuin loaded."
fi

View file

@ -0,0 +1,11 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd lsd; then
alias _ls="$(command -v lsd) "
alias lg="ll --git "
[[ -n "${DBG}" ]] && echo "assigned lsd as ls alias."
fi

View file

@ -0,0 +1,9 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if is_cmd pet; then
. <( pet completion ${BASE_SHELL} )
[[ -n "${DBG}" ]] && echo "pet loaded."
fi

View file

@ -0,0 +1,13 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd load-starship; then
. <( load-starship - )
[[ -n "${DBG}" ]] && echo "starship loaded."
elif [[ -n "${DBG}" ]]; then
>&2 printf '%s\n' \
'starship is not installed, you can install by running:' \
'\tcurl -sS https://starship.rs/install.sh | FORCE=1 BIN_DIR=$HOME/bin sh > /dev/null' \
''
fi

View file

@ -0,0 +1,10 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd vivid && [ -z "$LS_COLORS" ]; then
export LS_COLORS="$(vivid generate alabaster_dark)"
[[ -n "${DBG}" ]] && echo "LS_COLORS loaded with vivid."
fi

View file

@ -0,0 +1,11 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if is_cmd eza; then
alias _ls="$(command -v eza) --icons "
alias lg="ll --git --git-repos-no-status"
[[ -n "${DBG}" ]] && echo "assigned eza as ls alias."
fi

View file

@ -0,0 +1,12 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if [[ "${BASE_SHELL}" == "bash" ]]; then
eval "${SZ_ENV_BASH_LOAD_PREEXEC}"
if [[ -n "${BLE_VERSION-}" ]]; then
[[ -n "${DBG}" ]] && echo "attaching ble.sh"
ble-attach
fi
fi

View file

@ -0,0 +1,45 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
# shellcheck disable=SC1090
if is_cmd 'chezmoi'; then
alias cz="chezmoi "
eval "$( chezmoi completion "${SHELL##*/}" | sed -Ee 's/(complete -o default .* chezmoi)/\1 cz/' )"
export CHEZMOI_GITHUB_ACCESS_TOKEN={{- .githubToken | quote }}
CZG_ROOT="$(chezmoi git -- rev-parse --show-toplevel)"
alias czg="git --work-tree=$CZG_ROOT --git-dir=$CZG_ROOT/.git "
unset CZG_ROOT
complete -F _complete_alias czg
chezmoi() {
${SET_X:-:} -x
case "$1" in
cd) cd "$(SET_X=':' command chezmoi source-path ${2})" ;;
edit) ${VISUAL:-${EDITOR:-vi}} $(SET_X=':' chezmoi source-path "${@:2}") ;;
source-path) printf '%s\n' "${@:2}" | xargs -r chezmoi source-path ;;
*) command chezmoi "${@}" ;;
esac
${SET_X:-:} +x
}
czcd() { chezmoi cd "${@}"; }
czedext() {
local CZ_EXT="$(find $(command chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
CZ_EXT="${CZ_EXT:-$(chezmoi source-path "${@}")/.chezmoiexternal.yaml.tmpl}"
"${VISUAL:-${EDITOR:-vi}}" "${CZ_EXT}"
}
czed() {
local EDITLIST=() f _f
for _f in "${@}"; do
[[ -e "$_f" ]] || f="$(which "$_f")"
[[ -z "$f" ]] && is_cmd tv && f="$(tv "$_f")" || f=$_f
EDITLIST=( "${EDITLIST[@]}" "$f" )
done
EDITLIST=("${@}")
chezmoi edit "${EDITLIST[@]}" --apply --interactive
}
alias czx="CZ_EXTR=1 chezmoi "
fi
# vim: set ft=bash sw=4 sts=4 et:

View file

@ -0,0 +1,5 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
if ! is_cmd atuin && is_cmd load-fzf; then
. <( load-fzf - )
fi

View file

@ -0,0 +1,11 @@
#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"'
BASE_SHELL=${BASE_SHELL:-${SHELL##*/}}
if is_cmd tsh && tsh version | grep -q '^Teleport'; then
tsh-login() {
command tsh login --proxy=teleport.vastdata.com "${@}"
}
. <(tsh --completion-script-${BASE_SHELL})
fi

View file

@ -0,0 +1 @@
../../../_src.all/private_dot_config/vim/_init