Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: on first lanch of sway session, call load_look() function to set env #22

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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