From 5c27c379da88a59c93ea345a10896d1be1673ce3 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Fri, 1 Aug 2025 00:09:59 +0200 Subject: [PATCH] Cleanup ZSH configuration --- lazyvim/.config/nvim/lazy-lock.json | 6 +-- zsh/.profile.d/dotfiles.sh | 3 -- zsh/.profile.d/editor.sh | 3 -- zsh/.profile.d/fzf.sh | 38 -------------- zsh/.profile.d/ghcup.sh | 3 -- zsh/.profile.d/go.sh | 12 ----- zsh/.profile.d/graalvm.sh | 3 -- zsh/.profile.d/help.sh | 5 -- zsh/.profile.d/homebrew.sh | 3 -- zsh/.profile.d/java.sh | 3 -- zsh/.profile.d/jmeter.sh | 4 -- zsh/.profile.d/rust.sh | 5 -- zsh/.profile.d/ssh-agent.sh | 18 +------ zsh/.profile.d/sway-startup.sh | 77 ++++++++++++++--------------- zsh/.profile.d/venv.sh | 3 -- zsh/.zshenv | 31 ++++++++---- zsh/.zshrc | 15 +++++- 17 files changed, 78 insertions(+), 154 deletions(-) delete mode 100755 zsh/.profile.d/dotfiles.sh delete mode 100755 zsh/.profile.d/editor.sh delete mode 100755 zsh/.profile.d/fzf.sh delete mode 100755 zsh/.profile.d/ghcup.sh delete mode 100755 zsh/.profile.d/go.sh delete mode 100755 zsh/.profile.d/graalvm.sh delete mode 100755 zsh/.profile.d/help.sh delete mode 100755 zsh/.profile.d/homebrew.sh delete mode 100755 zsh/.profile.d/java.sh delete mode 100755 zsh/.profile.d/jmeter.sh delete mode 100755 zsh/.profile.d/rust.sh delete mode 100755 zsh/.profile.d/venv.sh diff --git a/lazyvim/.config/nvim/lazy-lock.json b/lazyvim/.config/nvim/lazy-lock.json index 99d75dc..ea8e93b 100644 --- a/lazyvim/.config/nvim/lazy-lock.json +++ b/lazyvim/.config/nvim/lazy-lock.json @@ -4,13 +4,13 @@ "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "94f6e8a06b6bb7b8e5529cf9f93adb4654534241" }, + "catppuccin": { "branch": "main", "commit": "cb5665990a797b102715188e73c44c3931b3b42e" }, "clangd_extensions.nvim": { "branch": "main", "commit": "db28f29be928d18cbfb86fbfb9f83f584f658feb" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "b01433169be710d6c69f7b4ee264d9670698b831" }, + "gitsigns.nvim": { "branch": "main", "commit": "cc2e664c7e3cd8a31af34df040d16a75cfcadced" }, "glow.nvim": { "branch": "main", "commit": "5d5954b2f22e109d4a6eba8b2618c5b96e4ee7a2" }, "grug-far.nvim": { "branch": "main", "commit": "482517700eef8579b289a20995f017a0775a6ec4" }, "hydra.nvim": { "branch": "main", "commit": "8c4a9f621ec7cdc30411a1f3b6d5eebb12b469dc" }, @@ -33,7 +33,7 @@ "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "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-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, diff --git a/zsh/.profile.d/dotfiles.sh b/zsh/.profile.d/dotfiles.sh deleted file mode 100755 index ce610c5..0000000 --- a/zsh/.profile.d/dotfiles.sh +++ /dev/null @@ -1,3 +0,0 @@ -#/usr/bin/env bash - -export DOTFILES="$HOME/.dotfiles" diff --git a/zsh/.profile.d/editor.sh b/zsh/.profile.d/editor.sh deleted file mode 100755 index a55e9e0..0000000 --- a/zsh/.profile.d/editor.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -export EDITOR=vim diff --git a/zsh/.profile.d/fzf.sh b/zsh/.profile.d/fzf.sh deleted file mode 100755 index bdccac0..0000000 --- a/zsh/.profile.d/fzf.sh +++ /dev/null @@ -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" diff --git a/zsh/.profile.d/ghcup.sh b/zsh/.profile.d/ghcup.sh deleted file mode 100755 index 8a285c2..0000000 --- a/zsh/.profile.d/ghcup.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -[ -f "$HOME/.ghcup/env" ] && . "$HOME/.ghcup/env" diff --git a/zsh/.profile.d/go.sh b/zsh/.profile.d/go.sh deleted file mode 100755 index fc20431..0000000 --- a/zsh/.profile.d/go.sh +++ /dev/null @@ -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 diff --git a/zsh/.profile.d/graalvm.sh b/zsh/.profile.d/graalvm.sh deleted file mode 100755 index 4471bc4..0000000 --- a/zsh/.profile.d/graalvm.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -export GRAALVM_HOME="${HOME}/.local/share/mise/installs/java/graalvm-community-23.0.1" diff --git a/zsh/.profile.d/help.sh b/zsh/.profile.d/help.sh deleted file mode 100755 index 7ebd5a2..0000000 --- a/zsh/.profile.d/help.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -if [[ $SHELL == "zsh" ]]; then - export HELPDIR=/usr/share/zsh/"${ZSH_VERSION}"/help -fi diff --git a/zsh/.profile.d/homebrew.sh b/zsh/.profile.d/homebrew.sh deleted file mode 100755 index 9a0db64..0000000 --- a/zsh/.profile.d/homebrew.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -export HOMEBREW_NO_ENV_HINTS=1 diff --git a/zsh/.profile.d/java.sh b/zsh/.profile.d/java.sh deleted file mode 100755 index 41e1f74..0000000 --- a/zsh/.profile.d/java.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -export JAVA_HOME="${HOME}/.local/share/mise/installs/java/23.0.1" diff --git a/zsh/.profile.d/jmeter.sh b/zsh/.profile.d/jmeter.sh deleted file mode 100755 index d4c1838..0000000 --- a/zsh/.profile.d/jmeter.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -JMETER_HOME="$(which jmeter)" -export JMETER_HOME diff --git a/zsh/.profile.d/rust.sh b/zsh/.profile.d/rust.sh deleted file mode 100755 index 4b9ab3b..0000000 --- a/zsh/.profile.d/rust.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -if [ -e "$HOME/.cargo" ]; then - source "$HOME/.cargo/env" -fi \ No newline at end of file diff --git a/zsh/.profile.d/ssh-agent.sh b/zsh/.profile.d/ssh-agent.sh index a3a7f8d..5fa784c 100755 --- a/zsh/.profile.d/ssh-agent.sh +++ b/zsh/.profile.d/ssh-agent.sh @@ -1,6 +1,4 @@ -#!/usr/bin/env zsh - -# This script sets up ssh-agent and gpg-agent differently for WSL and non-WSL. +#!/usr/bin/env bash start_keychain() { local ssh_key="$1" @@ -24,16 +22,4 @@ start_keychain() { fi } -# 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 - start_keychain "$HOME/.ssh/id_rsa_deadalus" "9DDD59AD62494FB2" -else - start_keychain "$HOME/.ssh/id_ed25519_nymph" "9DDD59AD62494FB2" -fi - +# start_keychain "$HOME/.ssh/id_ed25519_nymph" "9DDD59AD62494FB2" diff --git a/zsh/.profile.d/sway-startup.sh b/zsh/.profile.d/sway-startup.sh index f271ca6..2afea68 100755 --- a/zsh/.profile.d/sway-startup.sh +++ b/zsh/.profile.d/sway-startup.sh @@ -1,55 +1,54 @@ #!/usr/bin/env bash 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 - 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_CONFIG_HOME + export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0 - # XDG_CONFIG_HOME - export GTK2_RC_FILES=${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0 + # Reduces crashs for some gdk apps, like evolution + # ! Do not set as global variable. Electron Apps will not start ! + # export GDK_BACKEND=wayland - # Reduces crashs for some gdk apps, like evolution - # ! Do not set as global variable. Electron Apps will not start ! - # export GDK_BACKEND=wayland + # Required for tray icons on waybar + export XDG_CURRENT_DESKTOP=sway - # Required for tray icons on waybar - export XDG_CURRENT_DESKTOP=sway + # Enable QT apps to have gtk theme + export QT_QPA_PLATFORMTHEME=qt5ct - # Enable QT apps to have gtk theme - export QT_QPA_PLATFORMTHEME=qt5ct + # Force wayland on qt apps + export QT_QPA_PLATFORM=wayland - # Force wayland on qt apps - export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + # 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 - # 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 + # Make Qt apps honour DPI settings. + export QT_AUTO_SCREEN_SCALE_FACTOR=1 - # Make Qt apps honour DPI settings. - export QT_AUTO_SCREEN_SCALE_FACTOR=1 + # Mozilla Wayland support + hardware video decoding + export MOZ_ENABLE_WAYLAND=1 + export MOZ_WAYLAND_USE_VAAPI=1 - # Mozilla Wayland support + hardware video decoding - export MOZ_ENABLE_WAYLAND=1 - export MOZ_WAYLAND_USE_VAAPI=1 + # SDL + export SDL_VIDEODRIVER=wayland - # SDL - export SDL_VIDEODRIVER=wayland + # Java under Xwayland + export _JAVA_AWT_WM_NONREPARENTING=1 - # Java under Xwayland - export _JAVA_AWT_WM_NONREPARENTING=1 + # Session Type for later screensharing + export XDG_SESSION_TYPE=wayland - # Session Type for later screensharing - export XDG_SESSION_TYPE=wayland - - exec dbus-launch --exit-with-session sway - else - echo "Cannot found dbus session: Sway don't work" - fi + exec dbus-launch --exit-with-session sway + else + echo "Cannot found dbus session: Sway don't work" + fi fi diff --git a/zsh/.profile.d/venv.sh b/zsh/.profile.d/venv.sh deleted file mode 100755 index c66cedb..0000000 --- a/zsh/.profile.d/venv.sh +++ /dev/null @@ -1,3 +0,0 @@ -#/usr/bin/env bash - -export VIRTUAL_ENV_DISABLE_PROMPT=1 diff --git a/zsh/.zshenv b/zsh/.zshenv index 6327347..9baf525 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,11 +1,22 @@ -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 +export DOTFILES="$HOME/.dotfiles" +export EDITOR=nvim +export FZF_CTRL_T_COMMAND="fd --hidden --type file --exclude .git" +export FZF_ALT_C_COMMAND="fd --hidden --type directory --exclude .git" +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" +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 diff --git a/zsh/.zshrc b/zsh/.zshrc index 3b21c25..3f4394f 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -121,7 +121,20 @@ fpath=(~/.zsh $fpath) autoload run-help 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_HOME/shell/key-bindings.zsh" source "$FZF_HOME/shell/completion.zsh"