diff --git a/.bashrc b/.bashrc index 8e3861a..e1bcacb 100644 --- a/.bashrc +++ b/.bashrc @@ -109,52 +109,28 @@ if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" fi -# Check if we are running from zellij, if not then launch it -launch_zellij_conditionally() { - if [ -z "$ZELLIJ" ]; then - # Don't launch zellij in tmux, vscode, screen or zeditor. - if [ ! -t 1 ] || [ -n "$TMUX" ] || [ -n "$VSCODE_STABLE" ] || [ -n "$STY" ] || [ -n "$ZED_TERM" ]; then - return - fi - - # Launch zellij - zellij - - # Exit if zellij exits properly with a zero exit code - if [ $? -eq 0 ]; then - exit $? - fi - - echo "Zellij exited with a non-zero exit code, falling back to regular shell." - return - fi -} - -# Disabled for now, I don't like the way it behaves but I don't want to remove it either -# launch_zellij_conditionally - # Source ble.sh if it exists -# if [[ -f "${HOME}/.nix-profile/share/blesh/ble.sh" ]]; then -# source "${HOME}/.nix-profile/share/blesh/ble.sh" +if [[ -f "${HOME}/.nix-profile/share/blesh/ble.sh" ]]; then + source "${HOME}/.nix-profile/share/blesh/ble.sh" -# # Custom function for fzf history search -# function fzf_history_search() { -# local selected -# selected=$(history | fzf --tac --height=40% --layout=reverse --border --info=inline \ -# --query="$READLINE_LINE" \ -# --color 'fg:#ebdbb2,bg:#282828,hl:#fabd2f,fg+:#ebdbb2,bg+:#3c3836,hl+:#fabd2f' \ -# --color 'info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#665c54' \ -# | sed 's/^ *[0-9]* *//') -# if [[ -n "$selected" ]]; then -# READLINE_LINE="$selected" -# READLINE_POINT=${#selected} -# fi -# ble-redraw-prompt -# } + # Custom function for fzf history search + function fzf_history_search() { + local selected + selected=$(history | fzf --tac --height=40% --layout=reverse --border --info=inline \ + --query="$READLINE_LINE" \ + --color 'fg:#ebdbb2,bg:#282828,hl:#fabd2f,fg+:#ebdbb2,bg+:#3c3836,hl+:#fabd2f' \ + --color 'info:#83a598,prompt:#bdae93,spinner:#fabd2f,pointer:#83a598,marker:#fe8019,header:#665c54' \ + | sed 's/^ *[0-9]* *//') + if [[ -n "$selected" ]]; then + READLINE_LINE="$selected" + READLINE_POINT=${#selected} + fi + ble-redraw-prompt + } -# # Bind Ctrl+R to our custom function -# bind -x '"\C-r": fzf_history_search' -# fi + # Bind Ctrl+R to our custom function + bind -x '"\C-r": fzf_history_search' +fi # Display a welcome message for interactive shells if [ -t 1 ]; then diff --git a/config/ansible/tasks/global/symlinks.yml b/config/ansible/tasks/global/symlinks.yml index 161f983..7360955 100644 --- a/config/ansible/tasks/global/symlinks.yml +++ b/config/ansible/tasks/global/symlinks.yml @@ -14,6 +14,7 @@ - { src: "$DOTFILES_PATH/config/ssh/config", dest: "~/.ssh/config" } - { src: "$DOTFILES_PATH/config/ssh/config.d", dest: "~/.ssh/config.d" } - { src: "$DOTFILES_PATH/config/starship.toml", dest: "~/.config/starship.toml" } + - { src: "$DOTFILES_PATH/.bashrc", dest: "~/.bashrc.extra" } - name: Create gitconfig symlink ansible.builtin.file: diff --git a/config/home-manager/packages/common/bash.nix b/config/home-manager/packages/common/bash.nix index d788fdf..aa9aab9 100644 --- a/config/home-manager/packages/common/bash.nix +++ b/config/home-manager/packages/common/bash.nix @@ -4,8 +4,6 @@ let dotfilesPath = builtins.getEnv "DOTFILES_PATH"; in { - home.file.".bashrc.extra".source = "${dotfilesPath}/.bashrc"; - programs.bash = { enable = true; enableCompletion = true; diff --git a/config/ssh/config b/config/ssh/config index a43e15c..e108375 100644 --- a/config/ssh/config +++ b/config/ssh/config @@ -1,5 +1,5 @@ Host * - IdentityFile $DOTFILES_PATH/secrets/ssh_keys/mennos-2025.pem + IdentityFile ~/.dotfiles/secrets/ssh_keys/mennos-2025.pem IdentityAgent ~/.1password/agent.sock AddKeysToAgent yes ForwardAgent yes