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
|
# Modules
|
||||||
# -------
|
# -------
|
||||||
|
|
||||||
# Environment
|
|
||||||
#
|
|
||||||
# Sets sane Zsh built-in environment options.
|
|
||||||
zmodule environment
|
zmodule environment
|
||||||
# Applies correct bindkeys for input events.
|
|
||||||
zmodule input
|
zmodule input
|
||||||
|
|
||||||
# Completion
|
|
||||||
#
|
|
||||||
# Additional completion definitions for Zsh.
|
|
||||||
zmodule zsh-users/zsh-completions
|
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-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
|
zmodule buku -z
|
||||||
# chezmoi
|
|
||||||
zmodule joke/zim-chezmoi
|
zmodule joke/zim-chezmoi
|
||||||
# Provides handy git aliases and functions.
|
|
||||||
zmodule git
|
zmodule git
|
||||||
# Sets a custom terminal title.
|
|
||||||
zmodule termtitle
|
zmodule termtitle
|
||||||
# Provides archive and unarchive functions for easy archive manipulation.
|
|
||||||
zmodule archive
|
zmodule archive
|
||||||
{{ if (eq .chezmoi.os "linux") -}}
|
{{ if (eq .chezmoi.os "linux") -}}
|
||||||
# Distribution aliases and functions.
|
# Distribution aliases and functions.
|
||||||
@@ -46,35 +27,17 @@ zmodule pacman
|
|||||||
zmodule debian
|
zmodule debian
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
# sudo module
|
|
||||||
zmodule sudo -z
|
zmodule sudo -z
|
||||||
# Utility aliases and functions. Adds colour to ls, grep and less.
|
|
||||||
zmodule utility
|
zmodule utility
|
||||||
# exa
|
|
||||||
## zmodule exa
|
|
||||||
# fzf
|
|
||||||
zmodule fzf
|
zmodule fzf
|
||||||
# Personal aliases
|
|
||||||
zmodule jl-helper -z
|
zmodule jl-helper -z
|
||||||
# magic enter feature from subnixr's minimal prompt theme
|
|
||||||
zmodule magic-enter
|
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
|
zmodule git-info
|
||||||
# A customizable version of steeef's prompt theme.
|
|
||||||
zmodule steeef
|
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
|
# End configuration added by Zim install
|
||||||
|
|||||||
@@ -37,51 +37,26 @@ ZOXIDE_CMD_OVERRIDE=cd
|
|||||||
# Module configuration
|
# Module configuration
|
||||||
# --------------------
|
# --------------------
|
||||||
|
|
||||||
#
|
zstyle ':zim:module' skip 'prompt'
|
||||||
# completion
|
|
||||||
#
|
|
||||||
|
|
||||||
# Set a custom path for the completion dump file.
|
# Set a custom path for the completion dump file.
|
||||||
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
|
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
|
||||||
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"
|
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"
|
||||||
|
|
||||||
#
|
|
||||||
# git
|
|
||||||
#
|
|
||||||
|
|
||||||
# Set a custom prefix for the generated aliases. The default prefix is 'G'.
|
# Set a custom prefix for the generated aliases. The default prefix is 'G'.
|
||||||
#zstyle ':zim:git' aliases-prefix 'g'
|
#zstyle ':zim:git' aliases-prefix 'g'
|
||||||
|
|
||||||
#
|
|
||||||
# input
|
|
||||||
#
|
|
||||||
|
|
||||||
# Append `../` to your input for each `.` you type after an initial `..`
|
# Append `../` to your input for each `.` you type after an initial `..`
|
||||||
zstyle ':zim:input' double-dot-expand yes
|
zstyle ':zim:input' double-dot-expand yes
|
||||||
|
|
||||||
#
|
|
||||||
# termtitle
|
|
||||||
#
|
|
||||||
|
|
||||||
# Set a custom terminal title format using prompt expansion escape sequences.
|
# Set a custom terminal title format using prompt expansion escape sequences.
|
||||||
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
|
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
|
||||||
# If none is provided, the default '%n@%m: %~' is used.
|
# If none is provided, the default '%n@%m: %~' is used.
|
||||||
#zstyle ':zim:termtitle' format '%1~'
|
#zstyle ':zim:termtitle' format '%1~'
|
||||||
|
|
||||||
#
|
|
||||||
# zsh-autosuggestions
|
|
||||||
#
|
|
||||||
|
|
||||||
# Customize the style that the suggestions are shown with.
|
# Customize the style that the suggestions are shown with.
|
||||||
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
|
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
|
||||||
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
|
#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)
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
||||||
|
|
||||||
# Customize the main highlighter styles.
|
# Customize the main highlighter styles.
|
||||||
@@ -99,6 +74,8 @@ if [[ ${ZIM_HOME}/init.zsh -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
|
|||||||
fi
|
fi
|
||||||
source ${ZIM_HOME}/init.zsh
|
source ${ZIM_HOME}/init.zsh
|
||||||
|
|
||||||
|
autoload -Uz compinit && compinit -C
|
||||||
|
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
# Post-init module configuration
|
# Post-init module configuration
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
@@ -185,38 +162,20 @@ if [ -z "$TMUX" ]; then
|
|||||||
ssh-add 2>/dev/null
|
ssh-add 2>/dev/null
|
||||||
|
|
||||||
# start tmux
|
# 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
|
tmux attach
|
||||||
fi
|
fi
|
||||||
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
|
# 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