NoSignal-OS/os updates/deckshift-login/gaming-session-switch
28allday 19fd794b6b NoSignal — fully-offline Arch → Hyprland desktop installer
Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a
fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop:
matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU
detection, and a curated "os updates" layer (keybind cheatsheet, settings
panels, system polish, on-box management skill). See README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:03:10 +01:00

49 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
# gaming-session-switch — DeckShift-compatible session-switch helper, patched
# for password-at-boot. Same path + same {gaming|desktop} interface as
# DeckShift's original (the existing sudoers rule and switch-to-gaming /
# switch-to-desktop / os-session-select callers all keep working).
#
# DeckShift's original keeps a PERMANENT SDDM autologin drop-in and only flips
# its Session= line, so the machine never shows a password screen. This version
# writes the drop-in fresh on every switch and arms a one-shot marker in /run;
# sddm-autologin-gate (ExecStartPre on sddm.service) consumes the marker so the
# autologin applies to THAT restart only. Cold boots, crashes, and manual SDDM
# restarts find no marker and get the normal password greeter.
set -u
CONF="/etc/sddm.conf.d/zz-gaming-session.conf"
MARKER="/run/deckshift-session-switch"
if [[ $EUID -ne 0 ]]; then
echo "Error: must run as root (callers use: sudo -n $0 ...)" >&2
exit 1
fi
# The desktop user comes from sudo (all DeckShift callers invoke via sudo -n).
USER_NAME="${SUDO_USER:-}"
if [[ -z "$USER_NAME" ]]; then
USER_NAME=$(loginctl list-sessions --no-legend 2>/dev/null | awk '$3 != "sddm" && $3 != "" { print $3; exit }')
fi
if [[ -z "$USER_NAME" ]]; then
echo "Error: cannot determine the user to autologin" >&2
exit 1
fi
case "${1:-}" in
gaming) SESSION="gamescope-session-steam-nm" ;;
desktop) SESSION="hyprland-uwsm" ;;
*)
echo "Usage: $0 {gaming|desktop}" >&2
exit 1
;;
esac
cat > "$CONF" << EOF
[Autologin]
User=${USER_NAME}
Session=${SESSION}
Relogin=false
EOF
touch "$MARKER"
echo "Session set to: $1 mode (one-shot autologin armed)"