From b8c6564adaef44cac575014d5ec14871a5f4eec8 Mon Sep 17 00:00:00 2001 From: Regolith Linux Date: Sun, 13 Aug 2023 18:52:21 -0700 Subject: [PATCH] fix: on first lanch of sway session, call load_look() function to setup environment --- debian/changelog | 7 +++++++ usr/bin/regolith-look | 4 +--- usr/bin/regolith-session-wayland | 14 +++++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index e93e062..bdd3ffb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/usr/bin/regolith-look b/usr/bin/regolith-look index 777849f..e2c6d3f 100755 --- a/usr/bin/regolith-look +++ b/usr/bin/regolith-look @@ -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 diff --git a/usr/bin/regolith-session-wayland b/usr/bin/regolith-session-wayland index 9e58409..ad1f7ff 100755 --- a/usr/bin/regolith-session-wayland +++ b/usr/bin/regolith-session-wayland @@ -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