From 830412dc0aa464bb624a7d3a6066f4dc6f2195a9 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Thu, 3 Apr 2025 11:20:35 +0100 Subject: [PATCH] sec1: only use setxkbmap if DISPLAY is set --- bashrc.d/local/stbbri-sec-1.bash | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/bashrc.d/local/stbbri-sec-1.bash b/bashrc.d/local/stbbri-sec-1.bash index 02d8e30..a98388e 100644 --- a/bashrc.d/local/stbbri-sec-1.bash +++ b/bashrc.d/local/stbbri-sec-1.bash @@ -3,11 +3,13 @@ if [ -x /usr/bin/dircolors ]; then alias grep='grep --color=auto' fi -# For some reason there are occasional problems, where quote marks (") -# don't type properly. Setting this fixes it. (This time around.) -# Idea taken from -# http://www.straightrunning.com/XmingNotes/trouble.php#sect-15 -setxkbmap gb -variant extd +if [ -n "$DISPLAY" ] ; then + # For some reason there are occasional problems, where quote marks (") + # don't type properly. Setting this fixes it. (This time around.) + # Idea taken from + # http://www.straightrunning.com/XmingNotes/trouble.php#sect-15 + setxkbmap gb -variant extd +fi addpath $HOME/.local/bin @@ -57,11 +59,13 @@ alias cleanursr='if [ "$NEXUS_TOP" == "" ] ; then echo NEXUS_TOP not set ; else alias r="ranger" -PATH="$HOME/perl5/bin${PATH:+:${PATH}}"; export PATH; -PERL5LIB="$HOME/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; -PERL_LOCAL_LIB_ROOT="$HOME/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; -PERL_MB_OPT="--install_base \"$HOME/perl5\""; export PERL_MB_OPT; -PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"; export PERL_MM_OPT; +if [ -d "$HOME/perl5" ] ; then + PATH="$HOME/perl5/bin${PATH:+:${PATH}}"; export PATH; + PERL5LIB="$HOME/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; + PERL_LOCAL_LIB_ROOT="$HOME/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; + PERL_MB_OPT="--install_base \"$HOME/perl5\""; export PERL_MB_OPT; + PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"; export PERL_MM_OPT; +fi GPG_TTY=$(tty) export GPG_TTY