add alternative desktop environment for Steam-Deck

This commit is contained in:
user 2023-06-08 19:33:47 +02:00
parent 7d450de7e0
commit 0985cc0bca
6 changed files with 12 additions and 36 deletions

View file

@ -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

View file

@ -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)"

View file

@ -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

View file

@ -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

View file

@ -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

6
steam-deck/grub.d/40_steamos Executable file
View file

@ -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)"