Compare commits

...

4 Commits

Author SHA1 Message Date
526e6cae26 feat(functions): Add a function to start and log into the devenv container 2025-09-28 17:55:51 +02:00
1a003a9d72 feat(bashrc): Add management for functions 2025-09-28 17:55:51 +02:00
2b51dfd554 feat(bashrc): remove z.sh third party library
Better use zoxide (See https://github.com/ajeetdsouza/zoxide).
(It is available with mise. Just `mise use -g zoxide`.)
2025-09-28 17:52:54 +02:00
d078a852df fix(profile): fix keychain inheritance 2025-09-28 17:50:30 +02:00
3 changed files with 25 additions and 2 deletions

7
bashrc
View File

@@ -28,7 +28,6 @@ _source_dir_files "${BASEDIR}"/libs
# Source 3rd party libs if they exists # Source 3rd party libs if they exists
_source_file_if_exists "${BASEDIR}/3rd-party/complete-alias/complete_alias" _source_file_if_exists "${BASEDIR}/3rd-party/complete-alias/complete_alias"
# _source_file_if_exists "${BASEDIR}/3rd-party/z/z.sh" # FIX: Problème de gestion de la variable PROMPT_COMMAND
# Early customization # Early customization
_source_dir_files "${BASEDIR}"/rc.before.d _source_dir_files "${BASEDIR}"/rc.before.d
@@ -37,6 +36,12 @@ _source_dir_files "${BASEDIR}"/rc.before.d
_source_dir_files "${BASEDIR}"/rc _source_dir_files "${BASEDIR}"/rc
_source_dir_files "${BASEDIR}"/rc.d _source_dir_files "${BASEDIR}"/rc.d
# Source functions definitions
_source_file_if_exists ~/.bash_functions
_source_file_if_exists "${BASEDIR}"/functions
_source_dir_files "${BASEDIR}"/functions
_source_dir_files "${BASEDIR}"/functions.d
# Source alias definitions # Source alias definitions
_source_file_if_exists ~/.bash_aliases _source_file_if_exists ~/.bash_aliases
_source_file_if_exists "${BASEDIR}"/aliases _source_file_if_exists "${BASEDIR}"/aliases

18
functions.d/devenv Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
function devenv() {
local status
# Get LXC container status
status=$(lxc info devenv | yq .Status)
# Start container if not running
if [ "${status}" != "RUNNING" ]; then lxc start devenv; fi
# Rename tmux window if inside tmux
if [ -n "$TMUX" ]; then tmux rename-window "devenv"; fi
# Login as user xavier
lxc exec devenv -- login -f xavier
}

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
if (command -v keychain &>/dev/null); then if (command -v keychain &>/dev/null); then
eval "$(keychain --eval --noask ~/.ssh/{id_ed25519,id_rsa_native})" eval "$(keychain --inherit any --quiet --noask ~/.ssh/id_{rsa,ed25519})"
fi fi