From da97e41c2a2fa56c93b422cdbeed7ea643d25956 Mon Sep 17 00:00:00 2001 From: agryphus Date: Mon, 23 Oct 2023 23:30:39 -0400 Subject: [PATCH] Fixed environment for XRDP clients --- .config/zsh/.zprofile | 9 +++++--- .config/zsh/.zshenv | 49 +++++++++++-------------------------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 2179162..998ac7d 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,4 +1,5 @@ # ZSH Configurations + unsetopt autocd # Change directory just by typing its name (hurts performance) setopt interactivecomments # Allow comments in interactive mode setopt magicequalsubst # Enable filename expansion for arguments of the form ‘anything=expression’ @@ -13,11 +14,11 @@ setopt hist_verify # show command with history expansion to user befo unsetopt ksharrays # 0-indexing arrays breaks highlighting # Start gpg agent -unset SSH_AGENT_PID -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then +if [ -z "$(pidof gpg-agent)" ]; + unset SSH_AGENT_PID export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + eval $(gpg-agent --daemon) fi -eval $(gpg-agent --daemon) export PATH="$PATH:~/.local/share/cargo/bin/" export PATH="$PATH:$JAVA_HOME/bin/" @@ -27,6 +28,8 @@ if [ ! -z "$(grep nixos /etc/os-release)" ]; then # Yes I know I'm circumventing immutability. export PATH=/usr/local/bin:$PATH fi + +export PATH=sourced:$PATH # Flag to prevent setting PATH multiple times export PATH=~/.local/bin/overrides:$PATH # Overriding /usr/bin/* export PATH=~/.local/bin:$PATH # Highest precedence to local bin diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index 8791ade..51dc6a8 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -2,9 +2,16 @@ # source /opt/miniconda3/etc/profile.d/conda.sh -export BROWSER='firefox' -export EDITOR='nvim' -export TERMINAL='st' +if [ -z "$(printf $PATH | grep :sourced:)" ] && [ "$DISPLAY" = ":10.0" ]; then + # zprofile does not get sourced when logging in through an xrdp session (for some reason), even + # if I try to manually source it in ~/startwm.sh. This checks for if this is through xrdp (DISPLAY=:10.0) + # and if the :sourced: flag exists in PATH. + source ~/.config/zsh/.zprofile +fi + +export BROWSER="$(which firefox)" +export EDITOR="$(which nvim)" +export TERMINAL="$(which st)" # Configuring input method export GTK_IM_MODULE='fcitx' @@ -30,7 +37,6 @@ export GNUPGHOME="$XDG_DATA_HOME/gnupg" export SSB_HOME="$XDG_DATA_HOME/zoom" export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" export TMUX_TMPDIR="$XDG_RUNTIME_DIR" -export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" export VIMINIT='let $MYVIMRC = !has("nvim") ? "$XDG_CONFIG_HOME/vim/vimrc" : "$XDG_CONFIG_HOME/nvim/init.lua" | so $MYVIMRC' export JAVA_HOME="/usr/lib/jvm/default/" @@ -38,37 +44,6 @@ export XSECURELOCK_PASSWORD_PROMPT='kaomoji' export WALLPAPER=~/.config/wallpaper -export SUDO_PROMPT=" - ⢀⡔⣻⠁ ⢀⣀⣀⡀ - ⢀⣾⠳⢶⣦⠤⣀ ⣾⢀⡇⡴⠋⣀⠴⣊⣩⣤⠶⠞⢹⣄ - ⢸ ⢠⠈⠙⠢⣙⠲⢤⠤⠤ ⠒⠳⡄⣿⢀⠾⠓⢋⠅⠛⠉⠉⠝ ⠼ - ⢸ ⢰⡀⠁ ⠈⠑⠦⡀ ⠈⠺⢿⣂ ⠉⠐⠲⡤⣄⢉⠝⢸ - ⢸ ⢀⡹⠆ ⡠⠃ ⠉⠙⠲⣄ ⠙⣷⡄⢸ - ⢸⡀⠙⠂⢠ ⡠⠊ ⢠ ⠘⠄ ⠑⢦⣔ ⢡⡸ - ⢀⣧ ⢀⡧⣴⠯⡀ ⡎ ⢸⡠⠔⠈⠁⠙⡗⡤⣷⡀ - ⡜⠈⠚⠁⣬⠓⠒⢼⠅ ⣠⡇ ⣧ ⡀⢹ ⠸⡄ - ⡸ ⠘⢸⢀⠐⢃ ⡰⠋⡇ ⢠ ⡿⣆ ⣧⡈⡇⠆⢻ - ⢰⠃ ⢀⡇⠼⠉ ⢸⡤⠤⣶⡖⠒⠺⢄⡀⢀⠎⡆⣸⣥⠬⠧⢴⣿⠉⠁⠸⡀⣇ - ⠇ ⢸ ⣰⠋ ⢸⣿⣿ ⠙⢧⡴⢹⣿⣿ ⠈⣆ ⢧⢹⡄ - ⣸ ⢠ ⢸⡀ ⢻⡀ ⢸⣿⣿ ⡼⣇⢸⣿⣿ ⢀⠏ ⢸ ⠇ - ⠓⠈⢃ ⡇ ⣗⠦⣀⣿⡇ ⣀⠤⠊ ⠈⠺⢿⣃⣀⠤⠔⢸ ⣼⠑⢼ - ⢸⡀⣀⣾⣷⡀ ⢸⣯⣦⡀ ⢇⣀⣀⠐⠦⣀⠘ ⢀⣰⣿⣄ ⡟ - ⠛⠁⣿⣿⣧ ⣿⣿⣿⣿⣦⣀ ⣀⣠⣴⣿⣿⡿⠈⠢⣼⡇ - ⠈⠁⠈⠻⠈⢻⡿⠉⣿⠿⠛⡇⠒⠒⢲⠺⢿⣿⣿⠉⠻⡿⠁ ⠈⠁ -⢀⠤⠒⠦⡀ ⢀⠞⠉⠆ ⠉⠉⠉ ⡝⣍ -⡎ ⡇ ⡰⠋ ⢸ ⢡⠈⢦ -⡇ ⠸⠁ ⢀⠜⠁ ⡸ ⠘⡄⠈⢳⡀ -⡇ ⢠ ⠠⣯⣀ ⡰⡇ ⢣ ⢀⡦⠤⢄⡀ -⢱⡀ ⠈⠳⢤⣠⠖⠋⠛⠛⢷⣄⢠⣷⠁ ⠘⡾⢳⠃ ⠘⢇ - ⠙⢦⡀ ⢠⠁ ⠙⣿⣏⣀ ⣀⣴⣧⡃ ⣸ - ⠈⠉⢺⣄ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣤⣀⣠⡾⠃ - ⠣⢅⡤⣀⣀⣠⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠉⠉⠉ - ⠉⠉⠉⠁ ⠉⣿⣿⣿⣿⣿⡿⠻⣿⣿⣿⣿⠛⠉ - ⣸⣿⣿⣿ ⣿⣿⣿⡿ - ⣴⣿⣿⣿⣟ ⢠⣿⣿⣿⣿⣧ - ⢰⣿⣿⣿⣿⣿ ⢸⣿⣿⣿⣿⣿ - ⢸⣿⣿⣿⣿⡏ ⢸⣿⣿⣿⣿⣿⡀ - ⢠⣿⣿⣿⣿⣿ ⢺⣿⣿⣿⣿⣿⣿⣷ - ⣿⣿⣿⣿⣿⣿ ⠈⠉⠻⣿⣿⣿⠟ - ⠘⢿⣿⣿⣿⠏ Dori dori" +export SUDO_PROMPT="$(cowsay --random $(fortune)) +Sudo password: "