refactor: group stow packages into common, mac and kde
Split the packages by platform so each app stays an opt-in Stow package under common/, mac/ or kde/. KDE gets its own Fastfetch, Helium and Spectacle packages, and darwin-breeze becomes kde/theme. The READMEs document stowing a whole group as well as individual packages.
This commit is contained in:
1 parent
1e99a15f6c
commit
34e978e84c
74 files changed
+532
-151
No files matched your search
@@ -0,0 +1,5 @@
|
||||
.zcompdump
|
||||
.zsh_history
|
||||
.zcompcache/
|
||||
.zsh_sessions/
|
||||
config/secrets.zsh
|
||||
@@ -0,0 +1,75 @@
|
||||
# install zinit
|
||||
if ! source "$ZDOTDIR/zinit.zsh"; then
|
||||
print -u2 "zinit: failed to initialize; skipping plugin configuration"
|
||||
return 1
|
||||
fi
|
||||
|
||||
zinit light zdharma-continuum/zinit-annex-bin-gem-node
|
||||
zinit light zdharma-continuum/zinit-annex-binary-symlink
|
||||
|
||||
zinit wait lucid light-mode id-as depth'1' for \
|
||||
wintermi/zsh-brew \
|
||||
hlissner/zsh-autopair \
|
||||
Aloxaf/fzf-tab \
|
||||
atinit'zicompinit; zicdreplay -q' \
|
||||
zdharma-continuum/fast-syntax-highlighting \
|
||||
atload'_zsh_autosuggest_start' \
|
||||
zsh-users/zsh-autosuggestions
|
||||
|
||||
zinit id-as from'gh-r' lbin'!' completions for \
|
||||
lsd-rs/lsd \
|
||||
micro-editor/micro \
|
||||
mv'**/bat.zsh -> _bat' \
|
||||
@sharkdp/bat
|
||||
|
||||
zinit for \
|
||||
id-as \
|
||||
as'completion' \
|
||||
from'gh-r' \
|
||||
mv'**/_fastfetch -> _fastfetch' \
|
||||
atpull'%atclone' \
|
||||
lbin'!**bin/fastfetch -> fastfetch' \
|
||||
@fastfetch-cli/fastfetch
|
||||
|
||||
zinit for \
|
||||
id-as \
|
||||
from'gh-r' \
|
||||
atclone'./zoxide init zsh > init.zsh' \
|
||||
atpull'%atclone' \
|
||||
lbin'!' \
|
||||
@ajeetdsouza/zoxide
|
||||
|
||||
zinit for \
|
||||
id-as \
|
||||
from'gh-r' \
|
||||
atclone'
|
||||
VP_SELF_SETUP_NO_MODIFY_PATH=1 ./vp env setup --refresh > /dev/null; \
|
||||
./vp env on > /dev/null; \
|
||||
VP_COMPLETE=zsh "$XDG_DATA_HOME/vite-plus/bin/vp" > init.zsh;
|
||||
' \
|
||||
atpull'%atclone' \
|
||||
atload'source "$XDG_CONFIG_HOME/vite-plus/env"' \
|
||||
@voidzero-dev/vite-plus
|
||||
|
||||
zinit for \
|
||||
id-as \
|
||||
from'gh-r' \
|
||||
atclone'
|
||||
./starship init zsh > init.zsh; \
|
||||
./starship completions zsh > _starship;
|
||||
' \
|
||||
atpull'%atclone' \
|
||||
sbin'starship' \
|
||||
@starship/starship
|
||||
|
||||
zinit for \
|
||||
id-as \
|
||||
from'gh-r' \
|
||||
atclone'./fzf --zsh > init.zsh' \
|
||||
atpull'%atclone' \
|
||||
lbin'!fzf' \
|
||||
@junegunn/fzf
|
||||
|
||||
for script in $ZDOTDIR/config/*.zsh; do
|
||||
source "$script"
|
||||
done
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Modern alternatives to traditional commands
|
||||
alias cat='bat'
|
||||
alias ls='lsd -A'
|
||||
alias la='lsd -lA'
|
||||
alias tree='lsd --tree'
|
||||
alias nano='micro'
|
||||
alias fetch='fastfetch'
|
||||
|
||||
# Global alias
|
||||
alias \-g -- --help="--help | bat -plhelp"
|
||||
|
||||
docker() {
|
||||
if command -v podman >/dev/null 2>&1; then
|
||||
podman "$@"
|
||||
else
|
||||
command docker "$@"
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
local brew_prefix="${HOMEBREW_PREFIX:-}"
|
||||
# `brew --prefix` costs ~12 ms because it runs Ruby. Check the standard
|
||||
# Apple Silicon location first, then fall back for anything else.
|
||||
if [[ -z "$brew_prefix" ]]; then
|
||||
[[ -x /opt/homebrew/bin/brew ]] && brew_prefix=/opt/homebrew
|
||||
fi
|
||||
if [[ -z "$brew_prefix" ]] && command -v brew >/dev/null 2>&1; then
|
||||
brew_prefix="$(brew --prefix 2>/dev/null)"
|
||||
fi
|
||||
|
||||
if [[ -n "$brew_prefix" ]]; then
|
||||
gnu_tools=(
|
||||
"coreutils"
|
||||
"findutils"
|
||||
"gnu-tar"
|
||||
"gnu-sed"
|
||||
"gawk"
|
||||
"gnu-indent"
|
||||
"grep"
|
||||
)
|
||||
|
||||
if [[ -n "$XDG_BIN_HOME" ]] && mkdir -p "$XDG_BIN_HOME"; then
|
||||
for tool in $gnu_tools; do
|
||||
gnubin="$brew_prefix/opt/$tool/libexec/gnubin"
|
||||
if [[ -d "$gnubin" ]]; then
|
||||
for bin in "$gnubin"/*(N); do
|
||||
target="$XDG_BIN_HOME/${bin:t}"
|
||||
[[ "$target" -ef "$bin" ]] || ln -sf "$bin" "$target"
|
||||
done
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
local bin_paths=(
|
||||
"$XDG_BIN_HOME"
|
||||
"${brew_prefix:+$brew_prefix/opt/gnu-getopt/bin}"
|
||||
)
|
||||
for bin_path in "${bin_paths[@]}"; do
|
||||
if [[ -d "$bin_path" ]]; then
|
||||
case ":$PATH:" in
|
||||
*":$bin_path:"*) ;;
|
||||
*) path=("$bin_path" $path) ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
export MANWIDTH=999
|
||||
|
||||
export EDITOR="micro"
|
||||
export PAGER="bat"
|
||||
export VISUAL="micro"
|
||||
export SUDO_EDITOR="micro"
|
||||
|
||||
export STARSHIP_CONFIG="$XDG_CONFIG_HOME"/starship/starship.toml
|
||||
export HOMEBREW_NO_UPGRADE_AUTO_UPDATES_CASKS=1
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# NetBird is installed from the official signed .pkg, not Homebrew: the brew
|
||||
# cask removed the launchd plist in uninstall_preflight and then ran the app's
|
||||
# installer.sh against the missing service, leaving the daemon crash-looping.
|
||||
# The pkg's preinstall aborts if the brew formula is present, so keep it out.
|
||||
nbup() {
|
||||
local pkg tmp
|
||||
tmp="$(mktemp -d)" || return 1
|
||||
pkg="$tmp/netbird.pkg"
|
||||
|
||||
print "netbird: downloading arm64 pkg"
|
||||
curl -fL --progress-bar -o "$pkg" "https://pkgs.netbird.io/macos/arm64" || { rm -rf "${tmp:?}"; return 1; }
|
||||
|
||||
if ! pkgutil --check-signature "$pkg" | grep -q "NetBird GmbH"; then
|
||||
print -u2 "netbird: unexpected pkg signature, refusing to install"
|
||||
rm -rf "${tmp:?}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sudo installer -pkg "$pkg" -target / || { rm -rf "${tmp:?}"; return 1; }
|
||||
rm -rf "${tmp:?}"
|
||||
|
||||
local i
|
||||
for i in {1..30}; do
|
||||
[[ -S /var/run/netbird.sock ]] && break
|
||||
sleep 1
|
||||
done
|
||||
/usr/local/bin/netbird status 2>/dev/null |
|
||||
grep -E '^(Daemon version|CLI version|Management|Signal|NetBird IP):'
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
unsetopt BEEP
|
||||
setopt AUTO_CD
|
||||
setopt GLOB_DOTS
|
||||
setopt NOMATCH
|
||||
setopt MENU_COMPLETE
|
||||
setopt EXTENDED_GLOB
|
||||
setopt INTERACTIVE_COMMENTS
|
||||
setopt APPEND_HISTORY
|
||||
setopt PUSHD_IGNORE_DUPS
|
||||
|
||||
setopt BANG_HIST # Treat the '!' character specially during expansion.
|
||||
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
|
||||
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
||||
setopt SHARE_HISTORY # Share history between all sessions.
|
||||
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
|
||||
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
|
||||
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
||||
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
||||
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
|
||||
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
|
||||
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
|
||||
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
|
||||
|
||||
HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history"
|
||||
HISTSIZE=5000000
|
||||
SAVEHIST=5000000
|
||||
|
||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath'
|
||||
|
||||
# Starship counts every entry in jobstates, including completed jobs that zsh
|
||||
# hasn't reaped yet. Run jobs before Starship's precmd hook so parallel Zinit
|
||||
# updates don't leave a stale job badge in the prompt.
|
||||
autoload -Uz add-zsh-hook
|
||||
|
||||
_zinit_reap_done_jobs() {
|
||||
jobs -p >/dev/null 2>&1
|
||||
}
|
||||
|
||||
add-zsh-hook -d precmd _zinit_reap_done_jobs 2>/dev/null || true
|
||||
precmd_functions=( _zinit_reap_done_jobs ${precmd_functions:#_zinit_reap_done_jobs} )
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||
if [[ ! -d "$ZINIT_HOME/.git" ]]; then
|
||||
mkdir -p "$(dirname "$ZINIT_HOME")" || return 1
|
||||
git clone --depth 1 https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" || return 1
|
||||
fi
|
||||
|
||||
if [[ ! -r "$ZINIT_HOME/zinit.zsh" ]]; then
|
||||
print -u2 "zinit: bootstrap is incomplete at $ZINIT_HOME"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# not to use aliases: zi or zini
|
||||
typeset -A ZINIT
|
||||
ZINIT[NO_ALIASES]=1
|
||||
ZINIT[LIST_COMMAND]='lsd --tree'
|
||||
|
||||
source "${ZINIT_HOME}/zinit.zsh"
|
||||
Whitespace-only changes.
@@ -0,0 +1,7 @@
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
|
||||
XDG_BIN_HOME="${XDG_BIN_HOME:-$HOME/.local/bin}"
|
||||
ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
||||
Reference in new issue
Block a user