From 0985cc0bcae74790803cd52cda182106a492012d Mon Sep 17 00:00:00 2001 From: user Date: Thu, 8 Jun 2023 19:33:47 +0200 Subject: [PATCH] add alternative desktop environment for Steam-Deck --- arch-install.sh | 3 +++ configs/grub.d/40_linux | 2 +- configs/grub.d/40_snapshots | 2 +- scripts/extract-menuentry-snapshots.py | 33 -------------------------- scripts/extract-menuentry.py | 2 +- steam-deck/grub.d/40_steamos | 6 +++++ 6 files changed, 12 insertions(+), 36 deletions(-) delete mode 100755 scripts/extract-menuentry-snapshots.py create mode 100755 steam-deck/grub.d/40_steamos diff --git a/arch-install.sh b/arch-install.sh index a00ef3e..d914ea1 100755 --- a/arch-install.sh +++ b/arch-install.sh @@ -1637,11 +1637,14 @@ elif [ "${amd}" == "deck" ]; then echo "AMD_VULKAN_ICD=RADV" >> ${mountpoint}/etc/environment cp -v /opt/${repo}/steam-deck/xorg.conf.d/* ${mountpoint}/etc/X11/xorg.conf.d/ cp -v /opt/${repo}/steam-deck/NetworkManager/conf.d/default-wifi-powersave-on.conf ${mountpoint}/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf + cp -v /opt/${repo}/steam-deck/grub.d/* ${mountpoint}/etc/grub.d/ # An open-source Linux userspace driver for Valves Steam Deck hardware. # https://open-sd.gitlab.io/opensd-docs/opensd-docs/latest/users_manual/run> arch-chroot ${mountpoint} su "${user}" -c "aurinstaller opensd-git" + arch-chroot ${mountpoint} su "${user}" -c "aurinstaller steamos-compositor-plus" #arch-chroot ${mountpoint} su "${user}" -c "systemctl --user enable opensd" + arch-chroot ${mountpoint} grub-mkconfig -o ${mountpoint}/boot/grub/grub.cfg fi if [ "${multicard}" == "y" ]; then diff --git a/configs/grub.d/40_linux b/configs/grub.d/40_linux index c621c1a..0a1170e 100755 --- a/configs/grub.d/40_linux +++ b/configs/grub.d/40_linux @@ -3,4 +3,4 @@ export GRUB_DISABLE_RECOVERY=true export GRUB_DISABLE_SUBMENU=y export GRUB_CMDLINE_LINUX_DEFAULT=$GRUB_CMDLINE_LINUX_DEFAULT_ALT -/etc/grub.d/10_linux | python /usr/bin/extract-menuentry.py +/etc/grub.d/10_linux | python /usr/bin/extract-menuentry.py "alternative desktop environment (i3)" diff --git a/configs/grub.d/40_snapshots b/configs/grub.d/40_snapshots index 47b6e58..77e949e 100755 --- a/configs/grub.d/40_snapshots +++ b/configs/grub.d/40_snapshots @@ -16,7 +16,7 @@ if [ -f "/etc/grub-snapshot" ]; then SNAPSHOT="rootflags=subvol=${SNAPSHOTNAME}" export GRUB_CMDLINE_LINUX="${SNAPSHOT} ${GRUB_CMDLINE_LINUX#* }" - /etc/grub.d/10_linux | python /usr/bin/extract-menuentry-snapshots.py ${SNAPSHOT#*@} + /etc/grub.d/10_linux | python /usr/bin/extract-menuentry.py "Snapshot ${SNAPSHOT#*@}" done echo '}' fi diff --git a/scripts/extract-menuentry-snapshots.py b/scripts/extract-menuentry-snapshots.py deleted file mode 100755 index 4285bc9..0000000 --- a/scripts/extract-menuentry-snapshots.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -import os, sys, re - -# https://askubuntu.com/questions/1155064/grub2-create-2nd-boot-entry-with-different-kernel-command-line-options-in-grub - -menuentry_start = "menuentry" - -def extract_menuentry(infile): - in_menuentry = False - for line in infile.readlines(): - if in_menuentry: - if line.strip() == "}": - in_menuentry = False - print(line.rstrip()) - pass - else: - print(line.rstrip()) - pass - pass - else: - if line.startswith(menuentry_start): - in_menuentry = True - match = re.search(r"menuentry '[^']+' (.*)", line) - print("menuentry '%s' %s" % (os.environ.get('GRUB_ALT_NAME', 'SpectreOS Linux Snapshot ({})'.format(sys.argv[1])), match.group(1))) - pass - pass - pass - pass - - -if __name__ == "__main__": - extract_menuentry(sys.stdin) - pass diff --git a/scripts/extract-menuentry.py b/scripts/extract-menuentry.py index e59306d..9a62e30 100755 --- a/scripts/extract-menuentry.py +++ b/scripts/extract-menuentry.py @@ -21,7 +21,7 @@ def extract_menuentry(infile): if line.startswith(menuentry_start): in_menuentry = True match = re.search(r"menuentry '[^']+' (.*)", line) - print("menuentry '%s' %s" % (os.environ.get('GRUB_ALT_NAME', 'SpectreOS Linux alt (i3)'), match.group(1))) + print("menuentry '%s' %s" % (os.environ.get('GRUB_ALT_NAME', 'SpectreOS Linux {}'.format(sys.argv[1])), match.group(1))) pass pass pass diff --git a/steam-deck/grub.d/40_steamos b/steam-deck/grub.d/40_steamos new file mode 100755 index 0000000..05e0d67 --- /dev/null +++ b/steam-deck/grub.d/40_steamos @@ -0,0 +1,6 @@ +#!/bin/sh +. /etc/default/grub +export GRUB_DISABLE_RECOVERY=true +export GRUB_DISABLE_SUBMENU=y +export GRUB_CMDLINE_LINUX_DEFAULT=$(echo $(echo ${GRUB_CMDLINE_LINUX_DEFAULT_ALT} | sed -e 's/autostartdesktop=.*$//') autostartdesktop=steamos) +/etc/grub.d/10_linux | python /usr/bin/extract-menuentry.py "alternative desktop environment for Steam Deck (steamos-session)"