Skip to content

Commit

Permalink
fix: on first lanch of sway session, call load_look() function to set…
Browse files Browse the repository at this point in the history
…up environment
  • Loading branch information
Regolith Linux committed Aug 14, 2023
1 parent 110edc8 commit b8c6564
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
regolith-session (0.9.0ubuntu1) UNRELEASED; urgency=medium

* add error handling in case that Xres/trawl look path is invalid
* fix: on first lanch of sway session, call load_look() function to setup environment

-- Regolith Linux <[email protected]> Sun, 13 Aug 2023 18:52:29 -0700

regolith-session (0.9.0) focal; urgency=medium

* feat: if a look is not set in xres/trawl, load the most recently installed look instead of default
Expand Down
4 changes: 1 addition & 3 deletions usr/bin/regolith-look
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ refresh() {
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
WM_RELOAD="swaymsg reload"
load_sway_resources
swaymsg -t send_tick '{"status": "reload_pending"}'
swaymsg -t send_tick '{"status": "reload_pending"}'
else
load_i3_resources
fi

# Determine if Look loader script is available
LOADER_PATH="$($RESOURCE_GETTER regolith.look.loader)"
echo "Loader Path: $LOADER_PATH"
if [ -n "$LOADER_PATH" ]; then
# Load the look-specific script that has a function called load_look()
source "$LOADER_PATH"
# Call look function to update UI
echo "Executing look loader script: $LOADER_PATH"
load_look

# restart window manager after merging Xresources
Expand Down
14 changes: 13 additions & 1 deletion usr/bin/regolith-session-wayland
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ load_regolith_trawlres

trawl_sway_cleanup

UPDATE_FLAG_DIR="$HOME/.config/regolith3/flags"
if [ ! -e "$UPDATE_FLAG_DIR" ]; then
# flag file has not been created, meaning this is first session load
# in this case, we need to configure some desktop settings from the look
LOADER_PATH="$($RESOURCE_GETTER regolith.look.loader)"
if [ -n "$LOADER_PATH" ]; then
# Load the look-specific script that has a function called load_look()
source "$LOADER_PATH"
# Call look function to update UI
load_look
fi
fi

# Register with gnome-session so that it does not kill the whole session thinking it is dead.
if [ -n "$DESKTOP_AUTOSTART_ID" ]; then
dbus-send --print-reply --session --dest=org.gnome.SessionManager "/org/gnome/SessionManager" org.gnome.SessionManager.RegisterClient "string:Regolith" "string:$DESKTOP_AUTOSTART_ID"
fi


# Import environment variables from environment.d
while read -r l; do
eval export $l
Expand Down

0 comments on commit b8c6564

Please sign in to comment.