From 56fa32119570bf02ce1cb88cc89dc56f49f0cc63 Mon Sep 17 00:00:00 2001 From: Ken Gilmer Date: Mon, 3 Feb 2025 18:17:43 -0800 Subject: [PATCH] fix: workaround trixie bug which causes desktop sessions to fail. Addresses https://github.com/regolith-linux/regolith-desktop/issues/1104 --- usr/bin/regolith-session-trixie-wayland | 33 +++++++++++++++++++ usr/bin/regolith-session-trixie-x11 | 33 +++++++++++++++++++ .../wayland-sessions/regolith-wayland.desktop | 2 +- usr/share/xsessions/regolith-x11.desktop | 2 +- 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100755 usr/bin/regolith-session-trixie-wayland create mode 100755 usr/bin/regolith-session-trixie-x11 diff --git a/usr/bin/regolith-session-trixie-wayland b/usr/bin/regolith-session-trixie-wayland new file mode 100755 index 0000000..fdae3ab --- /dev/null +++ b/usr/bin/regolith-session-trixie-wayland @@ -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 diff --git a/usr/bin/regolith-session-trixie-x11 b/usr/bin/regolith-session-trixie-x11 new file mode 100755 index 0000000..d648668 --- /dev/null +++ b/usr/bin/regolith-session-trixie-x11 @@ -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 diff --git a/usr/share/wayland-sessions/regolith-wayland.desktop b/usr/share/wayland-sessions/regolith-wayland.desktop index a81d3a1..7704684 100644 --- a/usr/share/wayland-sessions/regolith-wayland.desktop +++ b/usr/share/wayland-sessions/regolith-wayland.desktop @@ -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 diff --git a/usr/share/xsessions/regolith-x11.desktop b/usr/share/xsessions/regolith-x11.desktop index b428630..8c4142d 100644 --- a/usr/share/xsessions/regolith-x11.desktop +++ b/usr/share/xsessions/regolith-x11.desktop @@ -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