Compare commits
5 Commits
3393198919
...
22d0c9e391
| Author | SHA1 | Date | |
|---|---|---|---|
| 22d0c9e391 | |||
| 48dcc3cb3c | |||
| 8a4bd87007 | |||
| b495e4e935 | |||
| 843d5b0c84 |
27
home/dot_zim/modules/passwordstore/init.zsh
Normal file
27
home/dot_zim/modules/passwordstore/init.zsh
Normal file
@@ -0,0 +1,27 @@
|
||||
# modules-local/passwordstore/init.zsh
|
||||
|
||||
# === Passwordstore async pull ===
|
||||
PASS_PULL_LOG="/tmp/passstore-pull.log"
|
||||
PASS_PULL_LOCK="/tmp/passstore-pull.lock"
|
||||
|
||||
# Fonction pour lancer le pull async
|
||||
_passwordstore_async_pull() {
|
||||
# Si le répertoire existe et qu'aucun pull n'est en cours
|
||||
[[ -d "$PASSWORD_STORE_DIR" ]] || return
|
||||
if [[ ! -f "$PASS_PULL_LOCK" ]]; then
|
||||
# Création d'un lock pour éviter les pulls simultanés
|
||||
touch "$PASS_PULL_LOCK"
|
||||
(
|
||||
cd "$PASSWORD_STORE_DIR" || exit
|
||||
# Vérifie la connectivité avant pull
|
||||
if git ls-remote &>/dev/null; then
|
||||
git pull --ff-only &> "$PASS_PULL_LOG"
|
||||
fi
|
||||
rm -f "$PASS_PULL_LOCK"
|
||||
) & disown
|
||||
fi
|
||||
}
|
||||
|
||||
# Lancer au démarrage
|
||||
_passwordstore_async_pull
|
||||
|
||||
BIN
home/dot_zim/modules/passwordstore/readonly_init.zsh.zwc
Normal file
BIN
home/dot_zim/modules/passwordstore/readonly_init.zsh.zwc
Normal file
Binary file not shown.
@@ -3,38 +3,19 @@
|
||||
# Modules
|
||||
# -------
|
||||
|
||||
# Environment
|
||||
#
|
||||
# Sets sane Zsh built-in environment options.
|
||||
zmodule environment
|
||||
# Applies correct bindkeys for input events.
|
||||
zmodule input
|
||||
|
||||
# Completion
|
||||
#
|
||||
# Additional completion definitions for Zsh.
|
||||
zmodule zsh-users/zsh-completions
|
||||
# Enables and configures smart and extensive tab completion.
|
||||
# completion must be sourced after zsh-users/zsh-completions
|
||||
zmodule completion
|
||||
# Fish-like autosuggestions for Zsh.
|
||||
zmodule zsh-users/zsh-autosuggestions
|
||||
zmodule zsh-users/zsh-syntax-highlighting
|
||||
zmodule zsh-users/zsh-history-substring-search
|
||||
# zmodule completion
|
||||
|
||||
# Productivity
|
||||
#
|
||||
# Alacritty completions modules
|
||||
zmodule alacritty -z
|
||||
# Sets up asdf, with auto install and optimized usage of the direnv plugin.
|
||||
#zmodule asdf
|
||||
# Buku completions modules
|
||||
zmodule buku -z
|
||||
# chezmoi
|
||||
zmodule joke/zim-chezmoi
|
||||
# Provides handy git aliases and functions.
|
||||
zmodule git
|
||||
# Sets a custom terminal title.
|
||||
zmodule termtitle
|
||||
# Provides archive and unarchive functions for easy archive manipulation.
|
||||
zmodule archive
|
||||
{{ if (eq .chezmoi.os "linux") -}}
|
||||
# Distribution aliases and functions.
|
||||
@@ -46,35 +27,17 @@ zmodule pacman
|
||||
zmodule debian
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
# sudo module
|
||||
|
||||
zmodule sudo -z
|
||||
# Utility aliases and functions. Adds colour to ls, grep and less.
|
||||
zmodule utility
|
||||
# exa
|
||||
## zmodule exa
|
||||
# fzf
|
||||
zmodule fzf
|
||||
# Personal aliases
|
||||
zmodule jl-helper -z
|
||||
# magic enter feature from subnixr's minimal prompt theme
|
||||
zmodule magic-enter
|
||||
|
||||
# Syntx highlighting
|
||||
#
|
||||
# Fish-like syntax highlighting for Zsh.
|
||||
# zsh-users/zsh-syntax-highlighting must be sourced after completion
|
||||
zmodule zsh-users/zsh-syntax-highlighting
|
||||
# Fish-like history search (up arrow) for Zsh.
|
||||
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
|
||||
zmodule zsh-users/zsh-history-substring-search
|
||||
|
||||
# Prompt
|
||||
#
|
||||
# Exposes git repository status information to prompts.
|
||||
zmodule git-info
|
||||
# A customizable version of steeef's prompt theme.
|
||||
zmodule steeef
|
||||
# starship
|
||||
zmodule joke/zim-starship
|
||||
# zmodule joke/zim-starship
|
||||
zmodule password -z
|
||||
|
||||
zstyle ':zim:module' skip 'prompt'
|
||||
|
||||
# End configuration added by Zim install
|
||||
|
||||
@@ -37,51 +37,26 @@ ZOXIDE_CMD_OVERRIDE=cd
|
||||
# Module configuration
|
||||
# --------------------
|
||||
|
||||
#
|
||||
# completion
|
||||
#
|
||||
zstyle ':zim:module' skip 'prompt'
|
||||
|
||||
# Set a custom path for the completion dump file.
|
||||
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
|
||||
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"
|
||||
|
||||
#
|
||||
# git
|
||||
#
|
||||
|
||||
# Set a custom prefix for the generated aliases. The default prefix is 'G'.
|
||||
#zstyle ':zim:git' aliases-prefix 'g'
|
||||
|
||||
#
|
||||
# input
|
||||
#
|
||||
|
||||
# Append `../` to your input for each `.` you type after an initial `..`
|
||||
zstyle ':zim:input' double-dot-expand yes
|
||||
|
||||
#
|
||||
# termtitle
|
||||
#
|
||||
|
||||
# Set a custom terminal title format using prompt expansion escape sequences.
|
||||
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
|
||||
# If none is provided, the default '%n@%m: %~' is used.
|
||||
#zstyle ':zim:termtitle' format '%1~'
|
||||
|
||||
#
|
||||
# zsh-autosuggestions
|
||||
#
|
||||
|
||||
# Customize the style that the suggestions are shown with.
|
||||
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
|
||||
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
|
||||
|
||||
#
|
||||
# zsh-syntax-highlighting
|
||||
#
|
||||
|
||||
# Set what highlighters will be used.
|
||||
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
||||
|
||||
# Customize the main highlighter styles.
|
||||
@@ -99,6 +74,8 @@ if [[ ${ZIM_HOME}/init.zsh -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
||||
fi
|
||||
source ${ZIM_HOME}/init.zsh
|
||||
|
||||
autoload -Uz compinit && compinit -C
|
||||
|
||||
# ------------------------------
|
||||
# Post-init module configuration
|
||||
# ------------------------------
|
||||
@@ -185,38 +162,20 @@ if [ -z "$TMUX" ]; then
|
||||
ssh-add 2>/dev/null
|
||||
|
||||
# start tmux
|
||||
#
|
||||
# passwordstore
|
||||
#
|
||||
if [[ $(curl -s -w "%{http_code}\n" -L "https://git.jefflance.me/" -o /dev/null) = "200" ]]; then
|
||||
echo -ne "\npasswordstore: " && pass git pull
|
||||
else
|
||||
echo -ne "\npasswordstore: serveur hors ligne"
|
||||
fi
|
||||
tmux attach
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# ocaml
|
||||
#
|
||||
# [[ ! -r '/home/jeff/.opam/opam-init/init.zsh' ]] || source '/home/jeff/.opam/opam-init/init.zsh' > /dev/null 2> /dev/null
|
||||
# test -r /home/jeff/.opam/opam-init/init.zsh && . /home/jeff/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
|
||||
# eval "$(asdf exec opam env)"
|
||||
|
||||
|
||||
# #
|
||||
# # conda
|
||||
# #
|
||||
# # !! Contents within this block are managed by 'conda init' !!
|
||||
# __conda_setup="$('/home/jeff/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
||||
# if [ $? -eq 0 ]; then
|
||||
# eval "$__conda_setup"
|
||||
# else
|
||||
# if [ -f "/home/jeff/miniconda3/etc/profile.d/conda.sh" ]; then
|
||||
# . "/home/jeff/miniconda3/etc/profile.d/conda.sh"
|
||||
# else
|
||||
# export PATH="/home/jeff/miniconda3/bin:$PATH"
|
||||
# fi
|
||||
# fi
|
||||
# unset __conda_setup
|
||||
|
||||
|
||||
|
||||
#
|
||||
# gpg-agent
|
||||
#
|
||||
@@ -226,11 +185,3 @@ gpgconf --launch gpg-agent
|
||||
|
||||
|
||||
|
||||
#
|
||||
# passwordstore
|
||||
#
|
||||
if [[ $(curl -s -w "%{http_code}\n" -L "https://git.jefflance.me/" -o /dev/null) = "200" ]]; then
|
||||
echo -ne "\npasswordstore: " && pass git pull
|
||||
else
|
||||
echo -ne "\npasswordstore: serveur hors ligne"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user