From 1ffdd7116e2c3b4a7f9b60a70e9e1cd39889630b Mon Sep 17 00:00:00 2001 From: frosty Date: Sat, 18 May 2024 15:16:05 -0400 Subject: [PATCH] add some file checks when running commands/setting variables --- .config/X11/xprofile | 6 +++--- .config/shell/environment | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/X11/xprofile b/.config/X11/xprofile index f210eaf..0d05c26 100755 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -3,9 +3,9 @@ xrandr --dpi 96 # shellcheck disable=SC1091 -. "$XDG_DATA_HOME/screenlayout" -xwallpaper --zoom "$XDG_DATA_HOME/wallpaper" -xrdb -merge "$XDG_CONFIG_HOME/X11/xresources" +[ -f "$XDG_DATA_HOME/screenlayout" ] && . "$XDG_DATA_HOME/screenlayout" +[ -f "$XDG_DATA_HOME/wallpaper" ] && xwallpaper --zoom "$XDG_DATA_HOME/wallpaper" +[ -f "$XDG_CONFIG_HOME/X11/xresources" ] && xrdb -merge "$XDG_CONFIG_HOME/X11/xresources" xinput set-prop "SOAI USB Gaming Mouse" "libinput Accel Profile Enabled" 0 1 0 xinput set-prop "SOAI USB Gaming Mouse" "libinput Accel Speed" 0 diff --git a/.config/shell/environment b/.config/shell/environment index acda8f4..b775f2e 100644 --- a/.config/shell/environment +++ b/.config/shell/environment @@ -29,4 +29,4 @@ export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history" export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" -export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +[ -f "$XDG_CONFIG_HOME/X11/xinitrc" ] && export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"