Cleanup ZSH configuration
This commit is contained in:
@@ -4,13 +4,13 @@
|
|||||||
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
|
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
"catppuccin": { "branch": "main", "commit": "94f6e8a06b6bb7b8e5529cf9f93adb4654534241" },
|
"catppuccin": { "branch": "main", "commit": "cb5665990a797b102715188e73c44c3931b3b42e" },
|
||||||
"clangd_extensions.nvim": { "branch": "main", "commit": "db28f29be928d18cbfb86fbfb9f83f584f658feb" },
|
"clangd_extensions.nvim": { "branch": "main", "commit": "db28f29be928d18cbfb86fbfb9f83f584f658feb" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
|
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "b01433169be710d6c69f7b4ee264d9670698b831" },
|
"gitsigns.nvim": { "branch": "main", "commit": "cc2e664c7e3cd8a31af34df040d16a75cfcadced" },
|
||||||
"glow.nvim": { "branch": "main", "commit": "5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2" },
|
"glow.nvim": { "branch": "main", "commit": "5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2" },
|
||||||
"grug-far.nvim": { "branch": "main", "commit": "482517700eef8579b289a20995f017a0775a6ec4" },
|
"grug-far.nvim": { "branch": "main", "commit": "482517700eef8579b289a20995f017a0775a6ec4" },
|
||||||
"hydra.nvim": { "branch": "main", "commit": "8c4a9f621ec7cdc30411a1f3b6d5eebb12b469dc" },
|
"hydra.nvim": { "branch": "main", "commit": "8c4a9f621ec7cdc30411a1f3b6d5eebb12b469dc" },
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" },
|
"nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "9c6207559297b24f0b7c32829f8e45f7d65b991f" },
|
"nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "3db16ceeea947517f0dc1404c24dcb5ab0c91d26" },
|
"nvim-lspconfig": { "branch": "master", "commit": "3db16ceeea947517f0dc1404c24dcb5ab0c91d26" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#/usr/bin/env bash
|
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
export EDITOR=vim
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/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"
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
[ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
export GRAALVM_HOME="${HOME}/.local/share/mise/installs/java/graalvm-community-23.0.1"
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [[ $SHELL == "zsh" ]]; then
|
|
||||||
export HELPDIR=/usr/share/zsh/"${ZSH_VERSION}"/help
|
|
||||||
fi
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
export HOMEBREW_NO_ENV_HINTS=1
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
export JAVA_HOME="${HOME}/.local/share/mise/installs/java/23.0.1"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
JMETER_HOME="$(which jmeter)"
|
|
||||||
export JMETER_HOME
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [ -e "$HOME/.cargo" ]; then
|
|
||||||
source "$HOME/.cargo/env"
|
|
||||||
fi
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# This script sets up ssh-agent and gpg-agent differently for WSL and non-WSL.
|
|
||||||
|
|
||||||
start_keychain() {
|
start_keychain() {
|
||||||
local ssh_key="$1"
|
local ssh_key="$1"
|
||||||
@@ -24,16 +22,4 @@ start_keychain() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Detect if running inside WSL by checking /proc/version for "Microsoft"
|
# start_keychain "$HOME/.ssh/id_ed25519_nymph" "9DDD59AD62494FB2"
|
||||||
if grep -qi microsoft /proc/version; then
|
|
||||||
IS_WSL=true
|
|
||||||
else
|
|
||||||
IS_WSL=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$IS_WSL" = true ]; then
|
|
||||||
start_keychain "$HOME/.ssh/id_rsa_deadalus" "9DDD59AD62494FB2"
|
|
||||||
else
|
|
||||||
start_keychain "$HOME/.ssh/id_ed25519_nymph" "9DDD59AD62494FB2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +1,54 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||||
|
# XDG Settings Basic
|
||||||
|
export XDG_CONFIG_HOME=${HOME}/.config
|
||||||
|
export XDG_DATA_HOME=${HOME}/.local/share
|
||||||
|
export XDG_CACHE_HOME=${HOME}/.local/cache
|
||||||
|
export XDG_STATE_HOME=${HOME}/.local/state
|
||||||
|
|
||||||
# XDG Settings Basic
|
# XDG_CONFIG_HOME
|
||||||
export XDG_CONFIG_HOME=${HOME}/.config
|
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
|
||||||
export XDG_DATA_HOME=${HOME}/.local/share
|
|
||||||
export XDG_CACHE_HOME=${HOME}/.local/cache
|
|
||||||
export XDG_STATE_HOME=${HOME}/.local/state
|
|
||||||
|
|
||||||
# XDG_CONFIG_HOME
|
# Reduces crashs for some gdk apps, like evolution
|
||||||
export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0
|
# ! Do not set as global variable. Electron Apps will not start !
|
||||||
|
# export GDK_BACKEND=wayland
|
||||||
|
|
||||||
# Reduces crashs for some gdk apps, like evolution
|
# Required for tray icons on waybar
|
||||||
# ! Do not set as global variable. Electron Apps will not start !
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
# export GDK_BACKEND=wayland
|
|
||||||
|
|
||||||
# Required for tray icons on waybar
|
# Enable QT apps to have gtk theme
|
||||||
export XDG_CURRENT_DESKTOP=sway
|
export QT_QPA_PLATFORMTHEME=qt5ct
|
||||||
|
|
||||||
# Enable QT apps to have gtk theme
|
# Force wayland on qt apps
|
||||||
export QT_QPA_PLATFORMTHEME=qt5ct
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
|
||||||
# Force wayland on qt apps
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||||
export QT_QPA_PLATFORM=wayland
|
# Explicitly set to '96' instead of 'physical' because some apps have problems
|
||||||
|
# Looking at you nextcloud client!
|
||||||
|
# https://github.com/nextcloud/desktop/issues/1079
|
||||||
|
# https://github.com/swaywm/sway/issues/2424
|
||||||
|
export QT_WAYLAND_FORCE_DPI=96
|
||||||
|
|
||||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
# Make Qt apps honour DPI settings.
|
||||||
# Explicitly set to '96' instead of 'physical' because some apps have problems
|
export QT_AUTO_SCREEN_SCALE_FACTOR=1
|
||||||
# Looking at you nextcloud client!
|
|
||||||
# https://github.com/nextcloud/desktop/issues/1079
|
|
||||||
# https://github.com/swaywm/sway/issues/2424
|
|
||||||
export QT_WAYLAND_FORCE_DPI=96
|
|
||||||
|
|
||||||
# Make Qt apps honour DPI settings.
|
# Mozilla Wayland support + hardware video decoding
|
||||||
export QT_AUTO_SCREEN_SCALE_FACTOR=1
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
export MOZ_WAYLAND_USE_VAAPI=1
|
||||||
|
|
||||||
# Mozilla Wayland support + hardware video decoding
|
# SDL
|
||||||
export MOZ_ENABLE_WAYLAND=1
|
export SDL_VIDEODRIVER=wayland
|
||||||
export MOZ_WAYLAND_USE_VAAPI=1
|
|
||||||
|
|
||||||
# SDL
|
# Java under Xwayland
|
||||||
export SDL_VIDEODRIVER=wayland
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
# Java under Xwayland
|
# Session Type for later screensharing
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export XDG_SESSION_TYPE=wayland
|
||||||
|
|
||||||
# Session Type for later screensharing
|
exec dbus-launch --exit-with-session sway
|
||||||
export XDG_SESSION_TYPE=wayland
|
else
|
||||||
|
echo "Cannot found dbus session: Sway don't work"
|
||||||
exec dbus-launch --exit-with-session sway
|
fi
|
||||||
else
|
|
||||||
echo "Cannot found dbus session: Sway don't work"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#/usr/bin/env bash
|
|
||||||
|
|
||||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
|
||||||
31
zsh/.zshenv
31
zsh/.zshenv
@@ -1,11 +1,22 @@
|
|||||||
if command -v starship > /dev/null 2>&1; then
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
# Initialize Starship
|
export EDITOR=nvim
|
||||||
eval "$(starship init zsh)"
|
export FZF_CTRL_T_COMMAND="fd --hidden --type file --exclude .git"
|
||||||
fi
|
export FZF_ALT_C_COMMAND="fd --hidden --type directory --exclude .git"
|
||||||
|
export FZF_CTRL_R_OPTS="--preview 'echo {}'"
|
||||||
# Aggiungi ~/.local/bin a PATH se non c'è già
|
# Export Catppuccin Mocha theme for FZF
|
||||||
case ":$PATH:" in
|
export FZF_DEFAULT_OPTS=" \
|
||||||
*":$HOME/.local/bin:"*) ;;
|
--height 60% --layout=reverse --border \
|
||||||
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
--color=bg+:#313244,bg:#1E1E2E,spinner:#F5E0DC,hl:#F38BA8 \
|
||||||
esac
|
--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"
|
||||||
|
export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf
|
||||||
|
export GOPATH="$HOME/.local/share/Go"
|
||||||
|
export GOBIN=$GOPATH/bin
|
||||||
|
export GRAALVM_HOME="${HOME}/.local/share/mise/installs/java/graalvm-community-23.0.1"
|
||||||
|
export JAVA_HOME="${HOME}/.local/share/mise/installs/java/23.0.1"
|
||||||
|
export HELPDIR=/usr/share/zsh/"${ZSH_VERSION}"/help
|
||||||
|
export JMETER_HOME="$(which jmeter)"
|
||||||
|
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||||
|
|
||||||
|
|||||||
15
zsh/.zshrc
15
zsh/.zshrc
@@ -121,7 +121,20 @@ fpath=(~/.zsh $fpath)
|
|||||||
autoload run-help
|
autoload run-help
|
||||||
autoload -Uz compinit && compinit -u
|
autoload -Uz compinit && compinit -u
|
||||||
|
|
||||||
export FZF_HOME=$HOME/.oh-my-zsh/custom/plugins/fzf
|
if command -v starship > /dev/null 2>&1; then
|
||||||
|
# Initialize Starship
|
||||||
|
eval "$(starship init zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$HOME/.local/bin:"*) ;;
|
||||||
|
*) export PATH="$HOME/.local/bin:$PATH" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -e "$HOME/.cargo" ]; then
|
||||||
|
source "$HOME/.cargo/env"
|
||||||
|
fi
|
||||||
|
|
||||||
source <(fzf --zsh)
|
source <(fzf --zsh)
|
||||||
source "$FZF_HOME/shell/key-bindings.zsh"
|
source "$FZF_HOME/shell/key-bindings.zsh"
|
||||||
source "$FZF_HOME/shell/completion.zsh"
|
source "$FZF_HOME/shell/completion.zsh"
|
||||||
|
|||||||
Reference in New Issue
Block a user