Skip to content

Commit

Permalink
feat(deck): End X11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Apr 22, 2024
1 parent a8675e9 commit 21e5f14
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 61 deletions.
14 changes: 2 additions & 12 deletions system_files/deck/kinoite/usr/bin/startplasma-steamos-oneshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@ set -e

die() { echo >&2 "!! $*"; exit 1; }

source /etc/default/desktop-wayland

SENTINEL_FILE="steamos-session-select"
if ${DESKTOP_WAYLAND}; then
SENTINEL_VALUE="wayland"
else
SENTINEL_VALUE="x11"
fi
SENTINEL_VALUE="wayland"

# If we proceed, execute this
if ${DESKTOP_WAYLAND}; then
CHAINED_SESSION="/usr/bin/startplasma-wayland"
else
CHAINED_SESSION="/usr/bin/startplasma-x11"
fi
CHAINED_SESSION="/usr/bin/startplasma-wayland"

# If we decide the sentinel is consumed, execute this command instead and fail
RESTORE_SESSION=(steamos-session-select) # No arguments restores the session
Expand Down
32 changes: 5 additions & 27 deletions system_files/deck/shared/usr/bin/steamos-session-select
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set -e

die() { echo >&2 "!! $*"; exit 1; }

source /etc/default/desktop-wayland

IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)

Expand All @@ -18,22 +16,14 @@ SENTINEL_FILE="steamos-session-select"
CHECK_FILE="/etc/sddm.conf.d/steamos.conf"

session="${1:-gamescope}"
if ${DESKTOP_WAYLAND}; then
session_type="wayland"
else
session_type="x11"
fi
session_type="wayland"

session_launcher=""
create_sentinel=""

if [[ "$2" == "--sentinel-created" ]]; then
SENTINEL_CREATED=1
if ${DESKTOP_WAYLAND}; then
session_type="wayland"
else
session_type="x11"
fi
session_type="wayland"
fi

# Update config sentinel
Expand All @@ -49,11 +39,7 @@ if [[ -z $SENTINEL_CREATED ]]; then
if [[ -f "steamos-session-type" ]]; then
cp steamos-session-type "$SENTINEL_FILE"
else
if ${DESKTOP_WAYLAND}; then
echo "wayland" > "$SENTINEL_FILE"
else
echo "x11" > "$SENTINEL_FILE"
fi
echo "wayland" > "$SENTINEL_FILE"
fi
cat "$SENTINEL_FILE"
)
Expand Down Expand Up @@ -86,17 +72,9 @@ case "$session" in
;;
desktop|plasma)
if [[ ${BASE_IMAGE_NAME} == 'kinoite' ]]; then
if ${DESKTOP_WAYLAND}; then
session_launcher="plasma-steamos-wayland-oneshot.desktop"
else
session_launcher="plasma-steamos-oneshot.desktop"
fi
session_launcher="plasma-steamos-wayland-oneshot.desktop"
elif [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then
if ${DESKTOP_WAYLAND}; then
session_launcher="gnome-wayland-oneshot.desktop"
else
session_launcher="gnome-xorg-oneshot.desktop"
fi
session_launcher="gnome-wayland-oneshot.desktop"
fi
create_sentinel=1
;;
Expand Down
1 change: 0 additions & 1 deletion system_files/deck/shared/usr/etc/default/desktop-wayland

This file was deleted.

14 changes: 2 additions & 12 deletions system_files/deck/shared/usr/libexec/bazzite-autologin
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/bash

source /etc/default/desktop-wayland

IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)

Expand All @@ -22,16 +20,8 @@ fi
if [[ ! -f ${DESKTOP_AUTOLOGIN} && -f $HOME/.local/share/Steam/ubuntu12_32/steamui.so ]]; then
sed -i 's/.*Session=.*/Session=gamescope-session.desktop/g' ${SDDM_CONF}
elif [[ ${BASE_IMAGE_NAME} =~ "kinoite" ]]; then
if ${DESKTOP_WAYLAND}; then
sed -i 's/.*Session=.*/Session=plasma.desktop/g' ${SDDM_CONF}
else
sed -i 's/.*Session=.*/Session=plasmax11.desktop/g' ${SDDM_CONF}
fi
sed -i 's/.*Session=.*/Session=plasma.desktop/g' ${SDDM_CONF}
elif [[ ${BASE_IMAGE_NAME} =~ "silverblue" ]]; then
if ${DESKTOP_WAYLAND}; then
sed -i 's/.*Session=.*/Session=gnome-wayland.desktop/g' ${SDDM_CONF}
else
sed -i 's/.*Session=.*/Session=gnome-xorg.desktop/g' ${SDDM_CONF}
fi
sed -i 's/.*Session=.*/Session=gnome-wayland.desktop/g' ${SDDM_CONF}
fi
sed -i 's/.*User=.*/User='${USER}'/g' ${SDDM_CONF}
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ restore-input-remapper:

alias _toggle-wayland := _toggle_wayland

_toggle_wayland:
#!/usr/bin/bash
source /etc/default/desktop-wayland
if ${DESKTOP_WAYLAND}; then
sudo sed -i 's/true/false/g' /etc/default/desktop-wayland
else
sudo sed -i 's/false/true/g' /etc/default/desktop-wayland
fi

_toggle-autologin:
#!/usr/bin/bash
DESKTOP_AUTOLOGIN="/etc/bazzite/desktop_autologin"
Expand Down

0 comments on commit 21e5f14

Please sign in to comment.