From 3050db0a9b4b09c90b49c0bc12c42ea5fdd543a6 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Fri, 5 Dec 2025 04:11:13 +0100 Subject: [PATCH] .profile: Move desktop-specific vars to .config/profile.d --- .bashrc | 3 ++- .config/profile.d/30_desktop.sh | 16 ++++++++++++++ .pam_environment | 1 - .profile | 37 ++++++++++++++++++--------------- 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 .config/profile.d/30_desktop.sh delete mode 100644 .pam_environment diff --git a/.bashrc b/.bashrc index 018626c..d69d7b3 100644 --- a/.bashrc +++ b/.bashrc @@ -1,5 +1,6 @@ # -# ~/.bashrc -- Sourced by bash in interactive non-login shells; includes ~/bashrc.d/* and ~/.bashrc.local +# ~/.bashrc -- Sourced by bash in interactive non-login shells. +# Includes ~/.config/bashrc.d/* # # If not running interactively, don't do anything diff --git a/.config/profile.d/30_desktop.sh b/.config/profile.d/30_desktop.sh new file mode 100644 index 0000000..3ed9f2d --- /dev/null +++ b/.config/profile.d/30_desktop.sh @@ -0,0 +1,16 @@ +# +# ~/.config/profile.d/30_desktop.sh -- Environment variables for clients / desktop environments. +# + +# GNOME Keyring is used as an SSH agent on desktops +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + +# Preferred applications +export TERMINAL=sakura +export BROWSER=firefox + +# Wine: Do not change filetype associations +export WINEDLLOVERRIDES=winemenubuilder.exe=d + +# Firefox: Enable pixel-perfect scrolling +export MOZ_USE_XINPUT2=1 diff --git a/.pam_environment b/.pam_environment deleted file mode 100644 index 95f2bc4..0000000 --- a/.pam_environment +++ /dev/null @@ -1 +0,0 @@ -SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh-agent.sock" diff --git a/.profile b/.profile index 2df3854..e58d5b9 100644 --- a/.profile +++ b/.profile @@ -1,30 +1,33 @@ # -# ~/.profile -- Included by .bash_profile; includes ~/.profile.local +# ~/.profile -- Included by .bash_profile, i.e. sourced in login shells. +# Includes ~/.config/profile.d/* # -# SSH key agent -[[ -e "$XDG_RUNTIME_DIR/gcr/ssh" ]] && export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" - # GPG key stuff export GPG_TTY=$(tty) -# Environment variables +# Set terminal type to support colors export TERM=xterm-color -export TERMINAL=mate-terminal -export EDITOR=vim -export BROWSER=firefox -export BC_ENV_ARGS="-lq" -[[ -f "$HOME/.bcrc" ]] && export BC_ENV_ARGS="$BC_ENV_ARGS $HOME/.bcrc" -# PATH +# Preferred editor +export EDITOR=vim + +# Set PATH [[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH" [[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH" -# Wine: do not change filetype associations -export WINEDLLOVERRIDES=winemenubuilder.exe=d +# Settings for bc +export BC_ENV_ARGS="-lq" +[[ -f "$HOME/.bcrc" ]] && export BC_ENV_ARGS="$BC_ENV_ARGS $HOME/.bcrc" -# Firefox: Enable pixel-perfect scrolling -export MOZ_USE_XINPUT2=1 +# Include drop-in files +if [[ -d ~/.config/profile.d ]]; then + for f in ~/.config/profile.d/*; do + [[ -f $f ]] && source "$f" + done +fi -# Include host-specific .profile -[ -f ~/.profile.local ] && source ~/.profile.local +# Deprecation warning for .profile.local +if [[ -e ~/.profile.local ]]; then + echo "WARNING: ~/.profile.local is ignored, please use ~/.config/profile.d/ instead." +fi