Cleanup ZSH config

This commit is contained in:
Fabio Scotto di Santolo
2025-08-18 22:20:47 +02:00
parent d5741c38a1
commit 3bce5ef841
10 changed files with 100 additions and 124 deletions

5
zsh/.profile.d/cargo.sh Normal file
View File

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

6
zsh/.profile.d/golang.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
if command -v go > /dev/null 2>&1; then
export GOPATH="$HOME/.local/share/Go"
export GOBIN="$GOPATH/bin"
fi

5
zsh/.profile.d/java.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if command -v java > /dev/null 2>&1; then
export JAVA_HOME="$(dirname $(mise bin-paths | grep -i java))"
fi

5
zsh/.profile.d/mise.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if command -v mise > /dev/null 2>&1; then
eval "$(mise activate zsh)"
fi

View File

@@ -2,54 +2,6 @@
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; 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_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
# Required for tray icons on waybar
export XDG_CURRENT_DESKTOP=sway
# Enable QT apps to have gtk theme
export QT_QPA_PLATFORMTHEME=qt5ct
# 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
# 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
# SDL
export SDL_VIDEODRIVER=wayland
# Java under Xwayland
export _JAVA_AWT_WM_NONREPARENTING=1
# Session Type for later screensharing
export XDG_SESSION_TYPE=wayland
# SSH socket
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
exec dbus-launch --exit-with-session sway
else
echo "Cannot found dbus session: Sway don't work"

5
zsh/.profile.d/zoxide.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
if command -v zoxide > /dev/null 2>&1; then
eval "$(zoxide init zsh)"
fi