Skip to content

Commit

Permalink
fix: workaround trixie bug which causes desktop sessions to fail. Add…
Browse files Browse the repository at this point in the history
  • Loading branch information
kgilmer committed Feb 4, 2025
1 parent 5504fdc commit 56fa321
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
33 changes: 33 additions & 0 deletions usr/bin/regolith-session-trixie-wayland
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# shellcheck disable=SC1091
set -Eeu -o pipefail

SESSION_TYPE="regolith-wayland"

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
elif [[ "$SESSION_TYPE" == "regolith-wayland" ]]; then
echo "Starting Wayland Session..."
else
echo "Session type must be specified by caller: regolith-wayland, regolith-x11. Unrecognized: '$SESSION_TYPE'"
exit 1
fi

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

if [[ "$VERSION_CODENAME" == "jammy" || "$VERSION_CODENAME" == "bookworm" ]]; then
echo "Using gnome-session built-in session"
exec gnome-session --builtin --session=$SESSION_TYPE --disable-acceleration-check "$@"
else
exec gnome-session --session=$SESSION_TYPE --disable-acceleration-check "$@"
fi
else
echo "No /etc/os-release, guessing gnome-session cli api..."
exec gnome-session --session=$SESSION_TYPE --disable-acceleration-check "$@"
fi
33 changes: 33 additions & 0 deletions usr/bin/regolith-session-trixie-x11
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# shellcheck disable=SC1091
set -Eeu -o pipefail

SESSION_TYPE="regolith-x11"

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
elif [[ "$SESSION_TYPE" == "regolith-wayland" ]]; then
echo "Starting Wayland Session..."
else
echo "Session type must be specified by caller: regolith-wayland, regolith-x11. Unrecognized: '$SESSION_TYPE'"
exit 1
fi

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

if [[ "$VERSION_CODENAME" == "jammy" || "$VERSION_CODENAME" == "bookworm" ]]; then
echo "Using gnome-session built-in session"
exec gnome-session --builtin --session=$SESSION_TYPE --disable-acceleration-check "$@"
else
exec gnome-session --session=$SESSION_TYPE --disable-acceleration-check "$@"
fi
else
echo "No /etc/os-release, guessing gnome-session cli api..."
exec gnome-session --session=$SESSION_TYPE --disable-acceleration-check "$@"
fi
2 changes: 1 addition & 1 deletion usr/share/wayland-sessions/regolith-wayland.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Regolith / Wayland
Comment=Productivity focused desktop environment
Exec=/usr/bin/regolith-session regolith-wayland
Exec=/usr/bin/regolith-session-trixie-wayland
TryExec=/usr/bin/regolith-session
Type=Application
2 changes: 1 addition & 1 deletion usr/share/xsessions/regolith-x11.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Regolith / X11
Comment=Productivity focused desktop environment
Exec=/usr/bin/regolith-session regolith-x11
Exec=/usr/bin/regolith-session-trixie-x11
TryExec=/usr/bin/regolith-session
Type=Application
DesktopNames=Regolith;GNOME-Flashback;GNOME

0 comments on commit 56fa321

Please sign in to comment.