diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-10-20 16:39:58 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-10-20 16:42:10 +0200 |
| commit | 08e817eeb0d62dc8afc8dbd416971b68854036b2 (patch) | |
| tree | a76fe5713e00a8c55a76c8122c868978a4b72b2b | |
| parent | a0f646e8c14db26eb13f8336a7cc8937d9c476b2 (diff) | |
Refactoring of bash_profile and remove deprecated homebrew token
The token didn't have any permissions, was used to just increase the
rate limit when it was reached.
This is why it's ok to leave it in the history after it has been
revoked.
This also fixes and adds some dependencies using homebrew
| -rw-r--r-- | .amethyst.yml | 3 | ||||
| -rw-r--r-- | .bash_profile | 83 | ||||
| -rw-r--r-- | .gitconfig | 3 | ||||
| -rw-r--r-- | .tmux.conf | 5 | ||||
| -rw-r--r-- | Brewfile | 2 |
5 files changed, 60 insertions, 36 deletions
diff --git a/.amethyst.yml b/.amethyst.yml index 0f17b10..9b03db3 100644 --- a/.amethyst.yml +++ b/.amethyst.yml @@ -1,3 +1,4 @@ +--- # https://github.com/ianyh/Amethyst/blob/development/docs/configuration-files.md # Don't use canary builds use-canary-build: false @@ -64,7 +65,7 @@ restore-layouts-on-launch: true # Disable mouse actions (Except for swapping apps) mouse-follows-focus: false -focus-follows-mouse: false +focus-follows-mouse: true mouse-swaps-windows: true mouse-resizes-windows: false diff --git a/.bash_profile b/.bash_profile index 8121b2f..8dfcfc5 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,3 +1,4 @@ +#!/bin/bash # ==== Homebrew Apple M1/Intel fixing of $PATH if [ -d /opt/homebrew ]; then eval "$(/opt/homebrew/bin/brew shellenv)" @@ -10,21 +11,22 @@ export CLICOLOR=1 # Mac OS custorm colors (not LS_COLORS as unix) export LSCOLORS=gxfxcxdxbxegedabagacad # Unix/Bash Readline custom colors -export LS_COLORS=$LS_COLORS:"di=00;36:ln=00;35:ex=00;31" +export LS_COLORS="$LS_COLORS:di=00;36:ln=00;35:ex=00;31" -export HISTSIZE=2000 # History size +export HISTSIZE=20000 # History size export IGNOREEOF=42 # Ignore Ctrl+D logout terminal session -export HISTCONTROL=erasedups # remove consecutive history entries +export HISTCONTROL=ignoredups:erasedups # remove consecutive history entries export EDITOR='vim' # Default editor export TERM="xterm-256color" export GREP_OPTIONS="--color=auto" -export HOMEBREW_GITHUB_API_TOKEN="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" export PS1="[a14m] \W \$ " export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 -export GPG_TTY=$(tty) +GPG_TTY=$(tty) +export GPG_TTY unset SSH_AGENT_PID -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +export SSH_AUTH_SOCK export BASH_SILENCE_DEPRECATION_WARNING=1 # Silence new macOS warning about bash export USE_GKE_GCLOUD_AUTH_PLUGIN=True @@ -43,27 +45,28 @@ alias gpgkill='( )' alias cgit='docker run --name cgit -v $(pwd):/srv -p 1313:80 --rm -it cgit' -# alias g='git' -# # look up the original completion command and replace the last with the alias -# complete -o bashdefault -o default -o nospace -F __git_wrap__git_main g - # ==== Functions -# get app ID to add to amethyst (apps have to be running) -function appid { +# get app ID to add to amethyst (example appid /Applications/Spotify.app/) +appid() { codesign -dr - "$@" } +homebrew_token() { + HOMEBREW_GITHUB_API_TOKEN=$(pass personal/github | grep homebrew_token | awk '{ print $NF}') + export HOMEBREW_GITHUB_API_TOKEN +} + # ==== Aliased Directories alias rc="cd ~/.rc" alias spc="cd ~/Work/Space/" alias mb="cd ~/Work/MBition/" -alias htb="cd ~/Work/HTB/" -alias otw="cd ~/Work/OTW/" alias obs="cd ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Vault/MBition/" if command -v neomutt 1>/dev/null 2>&1; then # Fixes the pinentry-tty error https://github.com/neomutt/neomutt/issues/1014 - alias mutt='PINENTRY_USER_DATA=curses neomutt $@' + mutt() { + PINENTRY_USER_DATA=curses neomutt "$@" + } fi # ==== go config. @@ -91,40 +94,40 @@ if command -v pipx 1>/dev/null 2>&1; then fi # ==== Rust config -if [ -f $HOME/.cargo/env ]; then +if [ -f "$HOME/.cargo/env" ]; then source "$HOME/.cargo/env" fi # ==== NVM config # node version manager from homebrew ,the source line to move install location # and prevent Node installs being lost upon upgrading nvm. -if [ -f $(brew --prefix nvm)/nvm.sh ]; then +if [ -f "$(brew --prefix nvm)/nvm.sh" ]; then export NVM_DIR=~/.nvm - source $(brew --prefix nvm)/nvm.sh + source "$(brew --prefix nvm)/nvm.sh" fi # ==== MISC config if command -v thefuck 1>/dev/null 2>&1; then # allow fuck to be alias of thefuck - eval $(thefuck --alias) + eval "$(thefuck --alias)" fi # ==== Vault completeion if command -v vault 1>/dev/null 2>&1; then - complete -C $(brew --prefix)/bin/vault vault + complete -C "$(brew --prefix)/bin/vault" vault fi # ==== Generate helm autocomplete stuff when it's not there if command -v helm 1>/dev/null 2>&1; then - if [ ! -f $(brew --prefix)/etc/bash_completion.d/helm ]; then - helm completion bash > $(brew --prefix)/etc/bash_completion.d/helm + if [ ! -f "$(brew --prefix)/etc/bash_completion.d/helm" ]; then + helm completion bash > "$(brew --prefix)/etc/bash_completion.d/helm" fi fi # ==== Generate podman completion script when it's not there if command -v podman 1>/dev/null 2>&1; then - if [ ! -f $(brew --prefix)/etc/bash_completion.d/podman ]; then - podman completion bash > $(brew --prefix)/etc/bash_completion.d/podman + if [ ! -f "$(brew --prefix)/etc/bash_completion.d/podman" ]; then + podman completion bash > "$(brew --prefix)/etc/bash_completion.d/podman" fi fi @@ -138,13 +141,18 @@ if command -v kubectl 1>/dev/null 2>&1; then complete -F _kube_namespaces kns fi +# ==== zoxide (smarter cd command) +if command -v zoxide 1>/dev/null 2>&1; then + eval "$(zoxide init bash --cmd cd)" +fi + # ==== load all bash completions -if [ -f $(brew --prefix)/etc/bash_completion ]; then - . $(brew --prefix)/etc/bash_completion +if [ -f "$(brew --prefix)/etc/bash_completion" ]; then + . "$(brew --prefix)/etc/bash_completion" fi # ==== MISC CowSay -fortune | cowsay | lolcat +# fortune | cowsay | lolcat # ==== Work config =========================================================== @@ -160,11 +168,11 @@ fi # ==== JFrog CLI config if command -v jf 1>/dev/null 2>&1; then _jfrog() { - local cur opts base + local cur opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + opts=$( "${COMP_WORDS[@]:0:$COMP_CWORD}" --generate-bash-completion ) + mapfile -t COMPREPLY < <(compgen -W "${opts}" -- "${cur}") } complete -F _jfrog -o default jfrog complete -F _jfrog -o default jf @@ -176,6 +184,15 @@ if command -v clang-format 1>/dev/null 2>&1; then fi alias assume=". assume" -alias glab_assume="export GITLAB_TOKEN=$(pass mbition/git | grep token | awk '{ print $NF}')" -alias glab_su_assume="export GITLAB_TOKEN=$(pass mbition/git | grep su_token | awk '{ print $NF}')" -alias glab_baas_assume="export GITLAB_TOKEN=$(pass mbition/git | grep baas_token | awk '{ print $NF}')" +gitlab_token() { + GITLAB_TOKEN=$(pass mbition/git | grep token | awk '{ print $NF}') + export GITLAB_TOKEN +} +gitlab_su_token() { + GITLAB_TOKEN=$(pass mbition/git | grep su_token | awk '{ print $NF}') + export GITLAB_TOKEN +} +gitlab_baas_token() { + GITLAB_TOKEN=$(pass mbition/git | grep baas_token | awk '{ print $NF}') + export GITLAB_TOKEN +} @@ -43,13 +43,14 @@ [fetch] prune = true [commit] - gpgsign = true + gpgSign = true verbose = true [rerere] enabled = true autoUpdate = true [tag] sort = -version:refname + gpgSign = true [maintenance] auto = true strategy = incremental @@ -5,7 +5,7 @@ set-option -g mouse on # mouse behavior set-option -g base-index 1 # start indexing from 1 not 0 set-option -g pane-base-index 1 # start indexing from 1 not 0 set-option -g renumber-windows on # renumber the windows after closing windows -set-option -g history-limit 10000 # Scroll History limit +set-option -g history-limit 100000 # Scroll History limit set-option -g display-time 4000 # window/status messages are displayed for 4 seconds set-option -g display-panes-time 4000 # pane messages are displayed for 4 seconds set-option -g focus-events on # focus events enabled for terminals that support them @@ -35,6 +35,9 @@ bind l select-pane -R # Load OSX specific configurations to add (fix copy) if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux-osx.conf' +# Unbind Ctrl+R in copy mode to prevent interference with Claude Code +unbind -T copy-mode C-r + # For better tmux support disable MacOS conflicting settings (to work better with control + arrows): # System Preferences > Keyboard > Shortcuts > Mission Control # System Preferences > Keyboard > Shortcuts > Mission Control > move (left | right) a space @@ -26,6 +26,8 @@ brew "youtube-dl" brew "reattach-to-user-namespace" brew "stow" brew "wifi-password" +brew "zoxide" +brew "fzf" # brew "ruby-build" # brew "rbenv" # brew "pyenv" |
