Initial commit

This commit is contained in:
Fabio Scotto di Santolo
2025-07-25 11:02:18 +02:00
commit 6249ebcb1f
73 changed files with 12227 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
is_debian_based() {
# Checking /etc/os-release
if [[ -f /etc/os-release ]]; then
. /etc/os-release
if [[ "$ID_LIKE" == *"debian"* ]] || [[ "$ID" == "debian" ]]; then
return 0 # OK: Debian-based
fi
fi
# Alternative check: /etc/debian_version
if [[ -f /etc/debian_version ]]; then
return 0 # OK: Debian-based
fi
return 1 # NO Debian-based
}
alias ls="eza --color=always --group-directories-first --icons"
# Replace some more things with better alternatives
if is_debian_based; then
alias bat='batcat'
alias fd='fdfind'
fi
alias cat='bat --style header --style snip --style changes --style header --pager never'
# Replace df command tool
alias df='duf'
# Replace Vim implementation
alias vi='nvim'
alias vim='nvim'
# Replace grep command tool
alias grep='ugrep --color=auto'
alias egrep='ugrep -E --color=auto'
alias fgrep='ugrep -F --color=auto'
# Other aliases
alias paths='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths
alias userlist="cut -d: -f1 /etc/passwd | sort"
alias ip='ip -color'
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
alias stow='stow -d $DOTFILES '

3
zsh/.profile.d/dotfiles.sh Executable file
View File

@@ -0,0 +1,3 @@
#/usr/bin/env bash
export DOTFILES="$HOME/.dotfiles"

3
zsh/.profile.d/editor.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
export EDITOR=vim

38
zsh/.profile.d/fzf.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
is_debian_based() {
# Checking /etc/os-release
if [[ -f /etc/os-release ]]; then
. /etc/os-release
if [[ "$ID_LIKE" == *"debian"* ]] || [[ "$ID" == "debian" ]]; then
return 0 # OK: Debian-based
fi
fi
# Alternative check: /etc/debian_version
if [[ -f /etc/debian_version ]]; then
return 0 # OK: Debian-based
fi
return 1 # NO Debian-based
}
# Add fzf keybindings and enhancements
if is_debian_based; then
export FZF_CTRL_T_COMMAND="fdfind --type f"
export FZF_ALT_C_COMMAND="fdfind --type d"
else
export FZF_CTRL_T_COMMAND="fd --type f"
export FZF_ALT_C_COMMAND="fd --type d"
fi
export FZF_CTRL_R_OPTS="--preview 'echo {}'"
# Export Catppuccin Mocha theme for FZF
export FZF_DEFAULT_OPTS=" \
--height 60% --layout=reverse --border \
--color=bg+:#313244,bg:#1E1E2E,spinner:#F5E0DC,hl:#F38BA8 \
--color=fg:#CDD6F4,header:#F38BA8,info:#CBA6F7,pointer:#F5E0DC \
--color=marker:#B4BEFE,fg+:#CDD6F4,prompt:#CBA6F7,hl+:#F38BA8 \
--color=selected-bg:#45475A \
--color=border:#313244,label:#CDD6F4"

3
zsh/.profile.d/ghcup.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
[ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env"

12
zsh/.profile.d/go.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
case $(uname -s) in
"Linux")
export GOPATH="$HOME/.local/share/Go";;
"Darwin")
export GOPATH="$HOME/Library/Go";;
*)
echo "Operating System unknown";;
esac
export GOBIN=$GOPATH/bin

3
zsh/.profile.d/graalvm.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
export GRAALVM_HOME="${HOME}/.local/share/mise/installs/java/graalvm-community-23.0.1"

5
zsh/.profile.d/help.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if [[ $SHELL == "zsh" ]]; then
export HELPDIR=/usr/share/zsh/"${ZSH_VERSION}"/help
fi

3
zsh/.profile.d/homebrew.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
export HOMEBREW_NO_ENV_HINTS=1

3
zsh/.profile.d/java.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
export JAVA_HOME="${HOME}/.local/share/mise/installs/java/23.0.1"

4
zsh/.profile.d/jmeter.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
JMETER_HOME="$(which jmeter)"
export JMETER_HOME

5
zsh/.profile.d/rust.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if [ -e "$HOME/.cargo" ]; then
source "$HOME/.cargo/env"
fi

41
zsh/.profile.d/ssh-agent.sh Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env zsh
# This script sets up ssh-agent and gpg-agent differently for WSL and Linux Mint.
# On WSL, it uses keychain to start agents.
# On Linux Mint (or other Linux), it assumes gnome-keyring manages agents automatically.
# Detect if running inside WSL by checking /proc/version for "Microsoft"
if grep -qi microsoft /proc/version; then
IS_WSL=true
else
IS_WSL=false
fi
if [ "$IS_WSL" = true ]; then
# We are in WSL - start keychain for ssh and gpg agents
# Adjust these variables to your actual SSH and GPG key names
SSH_KEY="$HOME/.ssh/id_rsa_deadalus"
#GPG_KEY=9DDD59AD62494FB2
# Check if keychain is installed
if command -v keychain >/dev/null 2>&1; then
SHORT_HOST=${SHORT_HOST:-${(%):-%m}}
# Start keychain quietly with no GUI prompts for ssh agents
eval "$(keychain --quiet --nogui --agents ssh $SSH_KEY)"
# Get the filenames to store/lookup the environment from
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"
_keychain_env_sh_gpg="$HOME/.keychain/$SHORT_HOST-sh-gpg"
# Source environment settings.
[ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh"
[ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg"
else
echo "Warning: keychain is not installed. Please install keychain to manage ssh/gpg agents."
fi
else
# Not WSL - assume gnome-keyring handles ssh-agent and gpg-agent
# Do nothing here to avoid conflicts with gnome-keyring
fi

9
zsh/.profile.d/sway-startup.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
exec sway
else
exec dbus-launch --exit-with-session sway
fi
fi

3
zsh/.profile.d/venv.sh Executable file
View File

@@ -0,0 +1,3 @@
#/usr/bin/env bash
export VIRTUAL_ENV_DISABLE_PROMPT=1

7
zsh/.zlogout Normal file
View File

@@ -0,0 +1,7 @@
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi

7
zsh/.zprofile Normal file
View File

@@ -0,0 +1,7 @@
# Load profiles from /etc/profile.d
if test -d $HOME/.profile.d/; then
for profile in $HOME/.profile.d/*.sh; do
test -r "$profile" && . "$profile"
done
unset profile
fi

18
zsh/.zshenv Normal file
View File

@@ -0,0 +1,18 @@
[ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env"
if [ -f "/home/linuxbrew/.linuxbrew/bin/brew" ]; then
# Initialize Homebrew
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if command -v starship > /dev/null 2>&1; then
# Initialize Starship
eval "$(starship init zsh)"
fi
# Aggiungi ~/.local/bin a PATH se non c'è già
case ":$PATH:" in
*":$HOME/.local/bin:"*) ;;
*) export PATH="$HOME/.local/bin:$PATH" ;;
esac

128
zsh/.zshrc Normal file
View File

@@ -0,0 +1,128 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
[[ ! -f ~/.zshenv ]] || source ~/.zshenv
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
ZSH_CUSTOM=$ZSH/custom
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
aws
colored-man-pages
command-not-found
gitignore
mise
zoxide
zsh-autosuggestions
zsh-interactive-cd
zsh-navigation-tools
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Setup emacs keymap
bindkey -e
fpath=(~/.zsh $fpath)
autoload run-help
autoload -Uz compinit && compinit -u
export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf
source <(fzf --zsh)
source "$FZF_HOME/shell/key-bindings.zsh"
source "$FZF_HOME/shell/completion.zsh"