Compare commits
No commits in common. "484ffdaea8aa77dd26a7690090d1f8abb1e69af6" and "6a316e8fd3f7cd442922b66196ed9bdc42661416" have entirely different histories.
484ffdaea8
...
6a316e8fd3
2 changed files with 2 additions and 294 deletions
31
README.md
31
README.md
|
|
@ -49,8 +49,8 @@ This installer sets up a full console-like gaming experience on your KDE Plasma
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/28allday/super-alt-S-cachy-deckmode.git
|
git clone https://git.no-signal.uk/nosignal/super-alt-s.git
|
||||||
cd super-alt-S-cachy-deckmode
|
cd super-alt-s
|
||||||
chmod +x super-alt-s.sh
|
chmod +x super-alt-s.sh
|
||||||
./super-alt-s.sh
|
./super-alt-s.sh
|
||||||
```
|
```
|
||||||
|
|
@ -65,33 +65,6 @@ The installer is interactive and will walk you through each step, asking before
|
||||||
| Return to Desktop | **Super+Alt+R** (from Gaming Mode) |
|
| Return to Desktop | **Super+Alt+R** (from Gaming Mode) |
|
||||||
| Return to Desktop (fallback) | Steam > Power > Exit to Desktop |
|
| Return to Desktop (fallback) | Steam > Power > Exit to Desktop |
|
||||||
|
|
||||||
## Uninstall
|
|
||||||
|
|
||||||
**Return to the desktop first** (Super+Alt+R) — the uninstaller refuses to run from inside Gaming Mode, because it deletes the scripts the session needs to switch back.
|
|
||||||
|
|
||||||
From the cloned repo:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod +x uninstall.sh
|
|
||||||
./uninstall.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Run it as your normal user (not root) — it uses sudo where needed. Use `--dry-run` to see what would be removed without changing anything, and `--yes` to skip the confirmation prompt.
|
|
||||||
|
|
||||||
The uninstaller removes everything listed under [What gets installed](#what-gets-installed) below — the switching scripts, the Gaming Mode Wayland session, the Super+Alt+S shortcut, the display manager autologin drop-in, and all sudoers/polkit/udev/performance config. It also offers (optional, default no) to remove the two AUR packages that exist only for Gaming Mode (`gamescope-session-git`, `gamescope-session-steam-git`), your `autologin` group membership, and the `gaming-mode.conf` config file.
|
|
||||||
|
|
||||||
Deliberately **left in place**, with how to revert each:
|
|
||||||
|
|
||||||
| What | Why it's kept | To revert manually |
|
|
||||||
|---|---|---|
|
|
||||||
| Steam, gamescope, mangohud, gamemode, Vulkan drivers, python-evdev | Useful on their own; may predate this script | `sudo pacman -Rns <package>` |
|
|
||||||
| Proton-GE in `~/.local/share/Steam/compatibilitytools.d/` | It's your Steam data | Delete the `GE-Proton*` folder |
|
|
||||||
| `video`, `input`, `wheel` group memberships | Commonly needed outside gaming | `sudo gpasswd -d $USER <group>` |
|
|
||||||
| `nvidia-drm.modeset=1` kernel parameter (NVIDIA only) | Harmless (often beneficial) on the desktop; bootloader edits are risky to automate | Restore the timestamped backup the installer made (`/etc/default/grub.backup.*`, `/etc/default/limine.backup.*`, or `/boot/loader/entries/*.backup.*`), then regenerate your bootloader config |
|
|
||||||
| `[multilib]` pacman repo | Steam and other 32-bit software need it | Restore `/etc/pacman.conf.backup.*` or comment the `[multilib]` block out |
|
|
||||||
|
|
||||||
After uninstalling, log out and back in (or reboot) to clear session environment variables and refresh the login screen's session list. If you use NetworkManager as your main network service, restart it (`sudo systemctl restart NetworkManager`) so it picks up its stock config again.
|
|
||||||
|
|
||||||
## What gets installed
|
## What gets installed
|
||||||
|
|
||||||
### Packages (via pacman + AUR)
|
### Packages (via pacman + AUR)
|
||||||
|
|
|
||||||
265
uninstall.sh
265
uninstall.sh
|
|
@ -1,265 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
set -Euo pipefail
|
|
||||||
|
|
||||||
# Uninstaller for Super Alt S - Gaming Mode for KDE Plasma.
|
|
||||||
# Removes everything super-alt-s.sh installs, EXCEPT:
|
|
||||||
# - pacman/AUR packages (steam, gamescope, drivers, ...) - offered as an
|
|
||||||
# optional step for the two session-only AUR packages
|
|
||||||
# - Proton-GE in ~/.local/share/Steam/compatibilitytools.d (your Steam data)
|
|
||||||
# - video/input/wheel group memberships (commonly needed outside gaming)
|
|
||||||
# - NVIDIA nvidia-drm.modeset=1 kernel parameter (harmless on the desktop;
|
|
||||||
# bootloader backups from install are at *.backup.<timestamp>)
|
|
||||||
# - the multilib pacman repo
|
|
||||||
# See README "Uninstall" for how to revert those manually.
|
|
||||||
|
|
||||||
UNINSTALL_VERSION="13.1-KDE"
|
|
||||||
|
|
||||||
ASSUME_YES=0
|
|
||||||
DRY_RUN=0
|
|
||||||
for arg in "$@"; do
|
|
||||||
case "$arg" in
|
|
||||||
-y|--yes) ASSUME_YES=1 ;;
|
|
||||||
-n|--dry-run) DRY_RUN=1 ;;
|
|
||||||
-h|--help)
|
|
||||||
echo "Usage: ./uninstall.sh [--yes] [--dry-run]"
|
|
||||||
echo " --yes don't ask for confirmation (optional steps are still skipped)"
|
|
||||||
echo " --dry-run show what would be removed without changing anything"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*) echo "Unknown option: $arg (try --help)" >&2; exit 1 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
info(){ echo "[*] $*"; }
|
|
||||||
warn(){ echo "[!] $*"; }
|
|
||||||
err(){ echo "[!] $*" >&2; }
|
|
||||||
|
|
||||||
run() {
|
|
||||||
if [[ $DRY_RUN -eq 1 ]]; then
|
|
||||||
echo " would run: $*"
|
|
||||||
else
|
|
||||||
"$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
confirm() {
|
|
||||||
local prompt="$1"
|
|
||||||
[[ $ASSUME_YES -eq 1 ]] && return 0
|
|
||||||
read -p "$prompt [Y/n]: " -n 1 -r
|
|
||||||
echo
|
|
||||||
[[ ! $REPLY =~ ^[Nn]$ ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Optional steps default to NO and are never auto-answered by --yes.
|
|
||||||
confirm_optional() {
|
|
||||||
local prompt="$1"
|
|
||||||
read -p "$prompt [y/N]: " -n 1 -r
|
|
||||||
echo
|
|
||||||
[[ $REPLY =~ ^[Yy]$ ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $EUID -eq 0 ]]; then
|
|
||||||
err "Run this as your normal user, not root - it needs your \$HOME for user config."
|
|
||||||
err "It will use sudo for system files."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Refuse to run from inside Gaming Mode: the uninstall deletes the very
|
|
||||||
# scripts the session needs to switch back to the desktop.
|
|
||||||
if [[ -f /tmp/.gaming-session-active ]] || [[ "${XDG_CURRENT_DESKTOP:-}" == *gamescope* ]]; then
|
|
||||||
err "You appear to be in Gaming Mode. Return to the desktop first (Super+Alt+R"
|
|
||||||
err "or Steam > Power > Exit to Desktop), then run this again."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The installer only runs on KDE Plasma. If KDE isn't here, any matching
|
|
||||||
# files likely belong to a different gaming-mode tool that shares these
|
|
||||||
# filenames (e.g. DeckShift on Omarchy) - removing them would break it.
|
|
||||||
if ! command -v plasmashell >/dev/null 2>&1 && ! command -v kwin_wayland >/dev/null 2>&1; then
|
|
||||||
warn "KDE Plasma not found on this system."
|
|
||||||
warn "super-alt-s.sh only installs on KDE - any gaming-mode files found here"
|
|
||||||
warn "probably belong to a different tool (e.g. DeckShift on Omarchy) and"
|
|
||||||
warn "removing them would break it."
|
|
||||||
if ! confirm_optional "Continue anyway?"; then
|
|
||||||
info "Aborted - nothing was changed."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
SYSTEM_FILES=(
|
|
||||||
# Switching + session scripts
|
|
||||||
/usr/local/bin/switch-to-gaming
|
|
||||||
/usr/local/bin/switch-to-desktop
|
|
||||||
/usr/local/bin/gamescope-session-nm-wrapper
|
|
||||||
/usr/local/bin/gaming-keybind-monitor
|
|
||||||
/usr/local/bin/gaming-session-switch
|
|
||||||
/usr/local/bin/gamescope-nm-start
|
|
||||||
/usr/local/bin/gamescope-nm-stop
|
|
||||||
/usr/local/bin/steam-library-mount
|
|
||||||
/usr/lib/os-session-select
|
|
||||||
/usr/local/lib/gamescope-nvidia/gamescope
|
|
||||||
# Session + shortcut entries
|
|
||||||
/usr/share/wayland-sessions/gamescope-session-steam-nm.desktop
|
|
||||||
/usr/share/applications/switch-to-gaming.desktop
|
|
||||||
# Display manager drop-ins (both DMs, plus the stale zz- name from <=12.x)
|
|
||||||
/etc/sddm.conf.d/zzz-gaming-session.conf
|
|
||||||
/etc/sddm.conf.d/zz-gaming-session.conf
|
|
||||||
/etc/plasmalogin.conf.d/zzz-gaming-session.conf
|
|
||||||
/etc/plasmalogin.conf.d/zz-gaming-session.conf
|
|
||||||
# Sudoers
|
|
||||||
/etc/sudoers.d/gaming-session-switch
|
|
||||||
/etc/sudoers.d/gaming-mode-sysctl
|
|
||||||
# Performance + audio tuning
|
|
||||||
/etc/udev/rules.d/99-gaming-performance.rules
|
|
||||||
/etc/security/limits.d/99-gaming-memlock.conf
|
|
||||||
/etc/pipewire/pipewire.conf.d/10-gaming-latency.conf
|
|
||||||
/etc/environment.d/99-shader-cache.conf
|
|
||||||
/etc/environment.d/90-nvidia-gamescope.conf
|
|
||||||
# Polkit
|
|
||||||
/etc/polkit-1/rules.d/50-gamescope-networkmanager.rules
|
|
||||||
/etc/polkit-1/rules.d/50-udisks-gaming.rules
|
|
||||||
# NetworkManager coexistence config
|
|
||||||
/etc/NetworkManager/conf.d/10-iwd-backend.conf
|
|
||||||
/etc/NetworkManager/conf.d/20-unmanaged-systemd.conf
|
|
||||||
)
|
|
||||||
|
|
||||||
USER_FILES=(
|
|
||||||
"$HOME/.config/environment.d/gamescope-session-plus.conf"
|
|
||||||
"$HOME/.config/environment.d/90-fcitx-wayland.conf"
|
|
||||||
)
|
|
||||||
|
|
||||||
echo "=============================================="
|
|
||||||
echo " Super Alt S - Gaming Mode UNINSTALLER v$UNINSTALL_VERSION"
|
|
||||||
echo "=============================================="
|
|
||||||
echo
|
|
||||||
echo "This removes the Gaming Mode session, the Super+Alt+S shortcut, and all"
|
|
||||||
echo "system/user config installed by super-alt-s.sh. Packages, Proton-GE and"
|
|
||||||
echo "your Steam library are left alone."
|
|
||||||
[[ $DRY_RUN -eq 1 ]] && echo && echo "DRY RUN - nothing will be changed."
|
|
||||||
echo
|
|
||||||
|
|
||||||
if ! confirm "Proceed with uninstall?"; then
|
|
||||||
info "Aborted - nothing was changed."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Needed even for --dry-run: file-existence checks use `sudo test` because
|
|
||||||
# /etc/sudoers.d and /etc/polkit-1/rules.d aren't world-readable.
|
|
||||||
sudo -v || { err "sudo access required"; exit 1; }
|
|
||||||
|
|
||||||
info "Stopping Gaming Mode background processes (if any)..."
|
|
||||||
run pkill -f gaming-keybind-monitor 2>/dev/null || true
|
|
||||||
run pkill -f steam-library-mount 2>/dev/null || true
|
|
||||||
|
|
||||||
info "Unmasking sleep/suspend targets (Gaming Mode masks them at runtime)..."
|
|
||||||
run sudo systemctl unmask --runtime sleep.target suspend.target hibernate.target hybrid-sleep.target 2>/dev/null || true
|
|
||||||
|
|
||||||
info "Removing system files..."
|
|
||||||
removed=0
|
|
||||||
for f in "${SYSTEM_FILES[@]}"; do
|
|
||||||
if sudo test -e "$f" 2>/dev/null; then
|
|
||||||
info " removing $f"
|
|
||||||
run sudo rm -f "$f"
|
|
||||||
removed=$((removed+1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# Directory only ever holds the NVIDIA gamescope wrapper
|
|
||||||
if sudo test -d /usr/local/lib/gamescope-nvidia 2>/dev/null; then
|
|
||||||
run sudo rmdir --ignore-fail-on-non-empty /usr/local/lib/gamescope-nvidia
|
|
||||||
fi
|
|
||||||
info "Removed $removed system file(s)"
|
|
||||||
|
|
||||||
info "Removing user config files..."
|
|
||||||
for f in "${USER_FILES[@]}"; do
|
|
||||||
if [[ -e "$f" ]]; then
|
|
||||||
info " removing $f"
|
|
||||||
run rm -f "$f"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove the Super+Alt+S shortcut section from KDE's global shortcuts
|
|
||||||
shortcuts_file="$HOME/.config/kglobalshortcutsrc"
|
|
||||||
if [[ -f "$shortcuts_file" ]] && grep -q '^\[switch-to-gaming\.desktop\]' "$shortcuts_file"; then
|
|
||||||
info "Removing Super+Alt+S shortcut from kglobalshortcutsrc..."
|
|
||||||
if [[ $DRY_RUN -eq 1 ]]; then
|
|
||||||
echo " would remove [switch-to-gaming.desktop] section from $shortcuts_file"
|
|
||||||
else
|
|
||||||
tmp_shortcuts=$(mktemp)
|
|
||||||
awk 'BEGIN{skip=0} /^\[/{skip=($0=="[switch-to-gaming.desktop]")} !skip' \
|
|
||||||
"$shortcuts_file" > "$tmp_shortcuts" && mv "$tmp_shortcuts" "$shortcuts_file"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Restore the KDE Screen Reader shortcut the installer cleared - only if it
|
|
||||||
# still holds the exact value we wrote, so user customisations are untouched.
|
|
||||||
if [[ -f "$shortcuts_file" ]] && grep -q 'Toggle Screen Reader On and Off=none,none,' "$shortcuts_file"; then
|
|
||||||
info "Restoring default Screen Reader shortcut (Meta+Alt+S)..."
|
|
||||||
run sed -i 's|Toggle Screen Reader On and Off=none,none,|Toggle Screen Reader On and Off=Meta+Alt+S,Meta+Alt+S,|' "$shortcuts_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Tell KDE to reload shortcuts if it's running
|
|
||||||
if [[ $DRY_RUN -eq 0 ]]; then
|
|
||||||
command -v dbus-send >/dev/null 2>&1 && \
|
|
||||||
dbus-send --type=signal --dest=org.kde.kglobalaccel /kglobalaccel org.kde.KGlobalAccel.yourShortcutsChanged 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
info "Reloading udev rules..."
|
|
||||||
run sudo udevadm control --reload-rules 2>/dev/null || true
|
|
||||||
|
|
||||||
info "Restarting polkit to drop removed rules..."
|
|
||||||
run sudo systemctl restart polkit.service 2>/dev/null || true
|
|
||||||
|
|
||||||
run rm -f /tmp/.gaming-session-active
|
|
||||||
|
|
||||||
# Optional: the two AUR packages that exist only for this Gaming Mode.
|
|
||||||
# steam/gamescope/mangohud/gamemode/drivers are useful on their own, so they
|
|
||||||
# are never offered for removal here.
|
|
||||||
session_pkgs=()
|
|
||||||
for pkg in gamescope-session-git gamescope-session-steam-git; do
|
|
||||||
pacman -Qi "$pkg" &>/dev/null && session_pkgs+=("$pkg")
|
|
||||||
done
|
|
||||||
if [[ ${#session_pkgs[@]} -gt 0 && $DRY_RUN -eq 0 ]]; then
|
|
||||||
echo
|
|
||||||
echo "The following AUR packages were installed only for Gaming Mode:"
|
|
||||||
printf ' - %s\n' "${session_pkgs[@]}"
|
|
||||||
if confirm_optional "Remove them now with pacman -Rns?"; then
|
|
||||||
sudo pacman -Rns "${session_pkgs[@]}" || warn "Package removal failed - remove manually with: sudo pacman -Rns ${session_pkgs[*]}"
|
|
||||||
else
|
|
||||||
info "Keeping packages (remove later with: sudo pacman -Rns ${session_pkgs[*]})"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Optional: the autologin group membership added for SDDM session switching.
|
|
||||||
if groups 2>/dev/null | grep -qw autologin && [[ $DRY_RUN -eq 0 ]]; then
|
|
||||||
echo
|
|
||||||
if confirm_optional "Remove $USER from the 'autologin' group (added for SDDM session switching)?"; then
|
|
||||||
sudo gpasswd -d "$USER" autologin || warn "Failed - remove manually with: sudo gpasswd -d $USER autologin"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Optional: the Gaming Mode config file, if one was created.
|
|
||||||
for conf in /etc/gaming-mode.conf "$HOME/.gaming-mode.conf"; do
|
|
||||||
if [[ -f "$conf" && $DRY_RUN -eq 0 ]]; then
|
|
||||||
if confirm_optional "Remove config file $conf?"; then
|
|
||||||
sudo rm -f "$conf"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "=============================================="
|
|
||||||
echo " Uninstall complete"
|
|
||||||
echo "=============================================="
|
|
||||||
echo
|
|
||||||
echo "Left in place (see README 'Uninstall' for how to revert):"
|
|
||||||
echo " - Packages: steam, gamescope, mangohud, gamemode, Vulkan drivers, python-evdev"
|
|
||||||
echo " - Proton-GE in ~/.local/share/Steam/compatibilitytools.d/"
|
|
||||||
echo " - Group memberships: video, input, wheel"
|
|
||||||
echo " - NVIDIA only: nvidia-drm.modeset=1 kernel parameter"
|
|
||||||
echo " - The [multilib] pacman repo"
|
|
||||||
echo
|
|
||||||
echo "NetworkManager's stock config is restored - if you use NetworkManager as"
|
|
||||||
echo "your main network service, restart it: sudo systemctl restart NetworkManager"
|
|
||||||
echo
|
|
||||||
echo "Log out and back in (or reboot) to finish - this clears session"
|
|
||||||
echo "environment variables and refreshes the login screen's session list."
|
|
||||||
Loading…
Add table
Reference in a new issue