From 67a808016d50bce8b116b1560e0e4348f441fc04 Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Sun, 23 Jun 2019 01:12:24 -0500
Subject: [PATCH] Change the order of XDGs and firestarterrc

---
 README.md   |  2 +-
 firestarter | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 658d7b3..abdadeb 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ Every first uncommented line is a "check" command that must succeed in order for
 
 Any file that does *not* have the initial "crunchdot" is executed normally. You can keep shell scripts or symlinks in here and they will be executed without issue.
 
-After all these programs have been started, firestarter starts XDG autostart applications and executes `~/.firestarterrc` if it exists.
+After all these programs have been started, firestarter executes `~/.firestarterrc` if it exists and then starts XDG autostart applications.
 
 ## Logging
 
diff --git a/firestarter b/firestarter
index ffa5691..41e4f17 100755
--- a/firestarter
+++ b/firestarter
@@ -499,6 +499,11 @@ step_postexecute() {
 			read -t 1 -u 1023
 		done
 	fi
+	# Execute a user script if it exists
+	if [ -r "$_firestarterrc" ] && [ -z "$_dryrun" ]; then
+		log "Executing .firestarterrc"
+		"$_firestarterrc"
+	fi
 	# Start XDG autostarters, if they exist
 	if [ -z "$_dryrun" ]; then
 		if has dex; then
@@ -511,11 +516,6 @@ step_postexecute() {
 			err "Could not find an XDG autostarter"
 		fi
 	fi
-	# Source in a user script if it exists
-	if [ -r "$_firestarterrc" ] && [ -z "$_dryrun" ]; then
-		log "Sourcing .firestarterrc"
-		"$_firestarterrc"
-	fi
 }
 step_wait() {
 	[ -n "$_dryrun" ] && exit 0