Skip to content

Commit

Permalink
fix: update init scripts to detect gnome-session version for GNOME 46…
Browse files Browse the repository at this point in the history
… breaking changes
  • Loading branch information
Regolith Linux committed Apr 21, 2024
1 parent 0fcc65d commit 48d552d
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 18 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
regolith-session (1.1.2) focal; urgency=medium

* fix: update init scripts to detect gnome-session version for GNOME 46 breaking changes

-- Regolith Linux <[email protected]> Sun, 21 Apr 2024 14:30:12 -0700

regolith-session (1.1.1) focal; urgency=medium

[ Soumya Ranjan Patnaik ]
Expand Down
1 change: 1 addition & 0 deletions debian/regolith-session-common.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
usr/bin/regolith-diagnostic
usr/lib/regolith/regolith-session-common.sh
usr/bin/regolith-look
usr/bin/regolith-session
3 changes: 1 addition & 2 deletions debian/regolith-session-flashback.install
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
usr/share/gnome-session/sessions/regolith.session
usr/share/xsessions
usr/share/applications/regolith.desktop
usr/bin/regolith-session
usr/bin/regolith-session-init
usr/bin/regolith-session-x11
usr/lib/systemd/user/regolith.service
usr/lib/systemd/user/regolith.target
usr/lib/systemd/user/[email protected]
40 changes: 29 additions & 11 deletions usr/bin/regolith-session
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
#!/bin/bash
# shellcheck disable=SC1091
set -Eeu -o pipefail

if [ -z "$XDG_CURRENT_DESKTOP" ]; then
export XDG_CURRENT_DESKTOP="Regolith:GNOME-Flashback:GNOME"
SESSION_TYPE=$1

if [[ "$SESSION_TYPE" == "regolith-x11" ]]; then
echo "Starting x11 Session..."

if [ -z "$XDG_CURRENT_DESKTOP" ]; then
export XDG_CURRENT_DESKTOP="Regolith:GNOME-Flashback:GNOME"
fi

SESSION_ID="regolith"
elif [[ "$SESSION_TYPE" == "regolith-wayland" ]]; then
echo "Starting Wayland Session..."

SESSION_ID="$SESSION_TYPE"
else
echo "Session type must be specified by caller: regolith-wayland, regolith-x11. Unrecognized: '$SESSION_TYPE'"
exit 1
fi

# Attempt to determine gnome-session version based on OS version
if [ -f /etc/os-release ]; then
# Determine gnome-session api based on system, since `gnome-session --version` returns ""
if [ -f /etc/os-release ]; then
source /etc/os-release

# Note: distro-support; add other type checks for non-systemd
if [[ "$VERSION_CODENAME" == "bionic" || "$VERSION_CODENAME" == "buster" ]]; then
exec gnome-session --session=regolith --disable-acceleration-check "$@"
if [[ "$ID" == "arch" ]]; then
exec gnome-session --session=$SESSION_ID --disable-acceleration-check "$@"
elif [[ "$VERSION_CODENAME" == "bionic" || "$VERSION_CODENAME" == "buster" || "$VERSION_CODENAME" == "noble" ]]; then
exec gnome-session --session=$SESSION_ID --disable-acceleration-check "$@"
else
exec gnome-session --session=regolith --disable-acceleration-check "$@"
fi
else
exec gnome-session --session=regolith --disable-acceleration-check "$@"
exec gnome-session --builtin --session=$SESSION_ID --disable-acceleration-check "$@"
fi
else
echo "No /etc/os-release, guessing gnome-session cli api..."
exec gnome-session --builtin --session=$SESSION_ID --disable-acceleration-check "$@"
fi
File renamed without changes.
2 changes: 1 addition & 1 deletion usr/share/applications/regolith.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=regolith
Comment=Productivity-focused desktop environment, Regolith
Exec=regolith-session-init
Exec=regolith-session-x11
X-GNOME-WMName=Regolith
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
Expand Down
5 changes: 3 additions & 2 deletions usr/share/wayland-sessions/regolith-sway.desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Desktop Entry]
Name=Regolith on Wayland
Name=Regolith / Wayland
Comment=Productivity focused desktop environment
Exec=/usr/bin/gnome-session --session=regolith-wayland
Exec=/usr/bin/regolith-session regolith-wayland
TryExec=/usr/bin/regolith-session
Type=Application
4 changes: 2 additions & 2 deletions usr/share/xsessions/regolith.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Regolith on X11
Name=Regolith / X11
Comment=Productivity focused desktop environment
Exec=/usr/bin/regolith-session
Exec=/usr/bin/regolith-session regolith-x11
TryExec=/usr/bin/regolith-session
Type=Application
DesktopNames=Regolith;GNOME-Flashback;GNOME

0 comments on commit 48d552d

Please sign in to comment.