From 5533e947bbba56e1214b148b481dc214f401f09e Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 6 Aug 2026 20:06:40 +0200 Subject: mac updates --- .../share/private_gnupg/private_gpg-agent.conf | 3 - .../private_gnupg/private_gpg-agent.conf.tmpl | 7 +++ home/dot_zshrc | 64 -------------------- home/dot_zshrc.tmpl | 68 ++++++++++++++++++++++ 4 files changed, 75 insertions(+), 67 deletions(-) delete mode 100644 home/dot_local/share/private_gnupg/private_gpg-agent.conf create mode 100644 home/dot_local/share/private_gnupg/private_gpg-agent.conf.tmpl delete mode 100644 home/dot_zshrc create mode 100644 home/dot_zshrc.tmpl diff --git a/home/dot_local/share/private_gnupg/private_gpg-agent.conf b/home/dot_local/share/private_gnupg/private_gpg-agent.conf deleted file mode 100644 index 4e3bb5d..0000000 --- a/home/dot_local/share/private_gnupg/private_gpg-agent.conf +++ /dev/null @@ -1,3 +0,0 @@ -allow-preset-passphrase -max-cache-ttl 604800 -pinentry-program /usr/bin/pinentry-gtk diff --git a/home/dot_local/share/private_gnupg/private_gpg-agent.conf.tmpl b/home/dot_local/share/private_gnupg/private_gpg-agent.conf.tmpl new file mode 100644 index 0000000..2e9d8d6 --- /dev/null +++ b/home/dot_local/share/private_gnupg/private_gpg-agent.conf.tmpl @@ -0,0 +1,7 @@ +allow-preset-passphrase +max-cache-ttl 604800 +{{- if eq .chezmoi.os "darwin" }} +pinentry-program {{ lookPath "pinentry-mac" }} +{{- else if eq .chezmoi.os "linux" }} +pinentry-program {{ lookPath "pinentry-gtk" }} +{{- end }} diff --git a/home/dot_zshrc b/home/dot_zshrc deleted file mode 100644 index 6220015..0000000 --- a/home/dot_zshrc +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/zsh -export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" - -# do not glob for calculator command -aliases[=]="noglob =" - -# color aliases -alias ls='ls --color=auto' -alias grep='grep --color=auto' - -# completion -autoload -U compinit -zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' -zstyle ':completion:*' special-dirs true -setopt auto_menu # show completion menu when spamming -setopt complete_in_word -setopt always_to_end # move cursor to end of word after completion -setopt auto_cd # cd if the command is a valid path -WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS -compinit -d "$ZSH_COMPDUMP" - -# history -! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" -export HISTFILE="$XDG_DATA_HOME/zsh/history" -export HISTSIZE=10000000 -export SAVEHIST=10000000 -setopt hist_ignore_space -setopt share_history -setopt hist_ignore_dups - -# keybinds -bindkey -e # emacs bindings -bindkey '^[[Z' reverse-menu-complete - -# prompt -setopt PROMPT_SUBST -export VIRTUAL_ENV_DISABLE_PROMPT=y -PROMPT='$(eo=%{ ec=%} prompt)' - -# auto venv -function cd() { - builtin cd "$@" - - if [ -n "$VIRTUAL_ENV" ] ; then - if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] && [ ! -z "$(command -v deactivate)" ] ; then - deactivate - else - return - fi - fi - - git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" - for dir in ./ "$git_dir" ../ "$git_dir/.." ; do - [ ! -d "$dir" ] && continue - for file in "$dir"/.env "$dir"/venv/bin/activate ; do - [ ! -e "$file" ] && continue - source "$file" - return - done - done -} - diff --git a/home/dot_zshrc.tmpl b/home/dot_zshrc.tmpl new file mode 100644 index 0000000..eca7ae1 --- /dev/null +++ b/home/dot_zshrc.tmpl @@ -0,0 +1,68 @@ +#!/bin/zsh +export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump" + +# do not glob for calculator command +aliases[=]="noglob =" + +# color aliases +alias ls='ls --color=auto' +alias grep='grep --color=auto' + +# completion +autoload -U compinit +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*:*:*:*:*' menu select +zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' +zstyle ':completion:*' special-dirs true +setopt auto_menu # show completion menu when spamming +setopt complete_in_word +setopt always_to_end # move cursor to end of word after completion +setopt auto_cd # cd if the command is a valid path +WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS +compinit -d "$ZSH_COMPDUMP" + +# history +! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" +export HISTFILE="$XDG_DATA_HOME/zsh/history" +export HISTSIZE=10000000 +export SAVEHIST=10000000 +setopt hist_ignore_space +setopt share_history +setopt hist_ignore_dups + +# keybinds +bindkey -e # emacs bindings +bindkey '^[[Z' reverse-menu-complete + +# prompt +setopt PROMPT_SUBST +export VIRTUAL_ENV_DISABLE_PROMPT=y +PROMPT='$(eo=%{ ec=%} prompt)' + +# auto venv +function cd() { + builtin cd "$@" + + if [ -n "$VIRTUAL_ENV" ] ; then + if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] && [ ! -z "$(command -v deactivate)" ] ; then + deactivate + else + return + fi + fi + + git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" + for dir in ./ "$git_dir" ../ "$git_dir/.." ; do + [ ! -d "$dir" ] && continue + for file in "$dir"/.env "$dir"/venv/bin/activate ; do + [ ! -e "$file" ] && continue + source "$file" + return + done + done +} + +{{- if eq .chezmoi.os "darwin" }} + +eval "$(/opt/homebrew/bin/brew shellenv)" +{{- end }} -- cgit v1.2.3