Add support for atuin integration, Homebrew on Linux and eza as ls replacement (#17)

This is basically adding support for bazzite-cli usage.

---------

Co-authored-by: Vladimir Viatskii <vladimir@vtsk.online>
Reviewed-on: misc/zsh-config#17
Co-authored-by: Vladimir Viatskii <vladimir@hodakov.me>
This commit is contained in:
hdkvandVladimir Viatskii authored and Stanislav Nikitin committed 2026-11-08 23:30:56 +05:00
1 parent f655fbf527
commit e7b0a9b313
7 files changed
+115 -21

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
atuin_init() {
eval "$(atuin init zsh)"
}
atuin_init
+9
View File
@@ -0,0 +1,9 @@
function bazzite-cli() {
# Those two are conflicting with Bazzite CLI aliases.
unalias ls
unalias sl
source /usr/share/bazzite-cli/bling.sh
}
bazzite-cli
+66
View File
@@ -0,0 +1,66 @@
# Functions for docker in Lima for macOS.
# Requires lima, docker, docker-compose and docker-credentials-helper to be installed.
if [ "${OS/Darwin}" != "${OS}" ]; then
LIMA_DOCKER=1
# Candidates cobra offers for the last argument, one per line, without the directive line or descriptions
function _docker_complete() {
local -a out=("${(@f)$(command docker __complete "$@" 2>/dev/null)}")
print -rl -- "${(@)${(@)out:#:*}%%$'\t'*}"
}
function _docker_with_platform() {
local platform=$1 extra=$2
shift 2
local -a args=("$@")
# Completion requests and explicitly pinned platforms pass through untouched
if [[ $1 == __complete* ]] || (( ${args[(I)(--platform|--platform=*)]} )); then
command docker "$@"
return
fi
# Walk the command path; stop at the first command that accepts --platform
local -i i pos=0
local -a cmds flags
for (( i = 1; i <= $#args; i++ )); do
[[ ${args[i]} == -* ]] && continue
cmds=("${(@f)$(_docker_complete "${(@)args[1,i-1]}" "")}")
if (( ! ${cmds[(Ie)${args[i]}]} )); then
# Not a command: either the previous option's value, or we've left the command path
(( i > 1 )) && [[ ${args[i-1]} == -* && ${args[i-1]} != *=* ]] && continue
break
fi
flags=("${(@f)$(_docker_complete "${(@)args[1,i]}" -)}")
if (( ${flags[(Ie)--platform]} )); then
pos=$i
break
fi
done
if (( pos )); then
local -a inject=(--platform=$platform)
local f name
for f in ${=extra}; do
name=${f%%=*}
# Only if this command accepts it and the user didn't pass it already
(( ${flags[(Ie)$name]} && ! ${args[(I)$name(|=*)]} )) && inject+=("$f")
done
args=("${(@)args[1,pos]}" $inject "${(@)args[pos+1,-1]}")
print -u2 $'\e[34m-> docker '"${(j: :)${(@q-)args}}"$'\e[0m'
fi
command docker "${args[@]}"
}
function docker() {
_docker_with_platform "linux/arm64/v8" "" "$@"
}
function docker-amd64() {
_docker_with_platform "linux/amd64" "--device=lima-vm.io/rosetta=cached" "$@"
}
fi