From faf7ca45e0acfffb497abfb5d9097552797f843d Mon Sep 17 00:00:00 2001 From: Hunter Jozwiak Date: Fri, 20 Sep 2024 09:40:54 -0400 Subject: [PATCH] When using Sway, include the default distribution files for configuration. Useful for things such as importing the proper dBus environment. --- i38.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index 0522ef4..8d65a02 100755 --- a/i38.sh +++ b/i38.sh @@ -11,7 +11,8 @@ # PARTICULAR PURPOSE. See the GNU General Public License for more details. # You should have received a copy of the GNU General Public License along with this program. If not, see . - +# Flag for sway configurations +usingSway=1 # Not by default. i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/i3" i3msg="i3-msg" sensibleTerminal="i3-sensible-terminal" @@ -258,6 +259,8 @@ while getopts "${args}" i ; do case "$i" in h) help;; s) + swaySystemIncludesPath="/etc/sway/config.d" + usingSway=0 i3msg="swaymsg" i3Path="${XDG_CONFIG_HOME:-$HOME/.config}/sway" sensibleTerminal="sway --sensible-terminal" @@ -402,8 +405,18 @@ cp -rv scripts/ "${i3Path}/" | dialog --backtitle "I38" --progressbox "Moving sc cat << EOF > ${i3Path}/config # Generated by I38 (${0##*/}) https://git.stormux.org/storm/I38 # $(date '+%A, %B %d, %Y at %I:%M%p') +EOF +# If we are using Sway, we need to load in the system configuration +# Usually, this is for system specific dBus things that the distro knows how to manage; we should trust their judgment with that +if [[ $usingSway ]] && [[ -d "${swaySystemIncludesPath}" ]]; then + cat << EOF >> ${i3Path}/config +# Include your distribution Sway configuration files. +include ${swaySystemIncludesPath}/* +EOF +fi +cat << EOF >> ${i3Path}/config # i3 config file (v4) # # Please see https://i3wm.org/docs/userguide.html for a complete reference!