diff --git a/files/sh/.config/sh/profile.d/.gitignore b/files/sh/.config/sh/profile.d/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/files/x11/.config/x11/xprofile b/files/x11/.config/x11/xprofile index 4d2185c..ffbe6c5 100755 --- a/files/x11/.config/x11/xprofile +++ b/files/x11/.config/x11/xprofile @@ -8,12 +8,12 @@ ## Sourced by display manager, xinit and startx. ## Load requirements. -test -r "$HOME/.profile" && . "$HOME/.profile" -: "${XDG_CONFIG_HOME:=$HOME/.config}" +test -r "${HOME}/.profile" && . "${HOME}/.profile" +: "${XDG_CONFIG_HOME:=${HOME}/.config}" ## Load resources. if command -v xrdb >/dev/null; then - xrdb "$XDG_CONFIG_HOME/x11/xresources" + xrdb "${XDG_CONFIG_HOME}/x11/xresources" fi ## If running normal OS or Qubes: Dom0, apply settings. @@ -39,26 +39,30 @@ desktop_autostart(){ touch "${TMPDIR:-/tmp}/touch-desktop-autostart" autostart_etc="${XDG_CONFIG_DIRS-/etc/xdg}/autostart" - autostart_home="${XDG_CONFIG_HOME-$HOME/.config}/autostart" + autostart_home="${XDG_CONFIG_HOME-${HOME}/.config}/autostart" - for f in "$autostart_etc"/*.desktop "$autostart_home"/*.desktop; do - test -r "$f" || continue + for f in "${autostart_etc}"/*.desktop "${autostart_home}"/*.desktop; do + test -r "${f}" || continue # shellcheck disable=SC2091 - autostart_exec="$(awk -F '=' '/^Exec=/{print $2}' "$f")" + autostart_exec="$(awk -F '=' '/^Exec=/{print ${2}}' "${f}")" command -v "${autostart_exec%% *}" >/dev/null || continue ${autostart_exec} & done } -## Source local profile. -if test -r "$HOME/.xprofile.local"; then - . "$HOME/.xprofile.local" +## Source Xorg profiles. +if test -r "${HOME}/.xprofile.local"; then + . "${HOME}/.xprofile.local" + for x11_profile in "${XDG_CONFIG_HOME}/x11/xprofile.d"/*.sh; do + # shellcheck disable=SC1090,SC1091 + ! test -r "${x11_profile}" || . "${x11_profile}" + done fi : "${wm_list:="dwm"}" -for wm in $wm_list; do - command -v "$wm" >/dev/null || break - if test "$wm" = "dwm" && command -v xsetroot >/dev/null; then +for wm in ${wm_list}; do + command -v "${wm}" >/dev/null || break + if test "${wm}" = "dwm" && command -v xsetroot >/dev/null; then desktop_autostart while true; do xsetroot -name "$(display-statusbar)" @@ -66,8 +70,8 @@ for wm in $wm_list; do done & fi # shellcheck disable=SC2093 - $wm & + ${wm} & wm_pid="$!" done -test -z "$wm_pid" || wait "$wm_pid" +test -z "${wm_pid:-}" || wait "${wm_pid}" diff --git a/files/x11/.config/x11/xprofile.d/.gitignore b/files/x11/.config/x11/xprofile.d/.gitignore new file mode 100644 index 0000000..e69de29