Harden HDMI recovery and add tested user installer release tooling

This commit is contained in:
admin committed 2026-09-23 09:16:57 +02:00
1 parent 73e727ef4c
commit d963224cb7
17 files changed
+903 -646

No files matched your search

+19 -15
View File
@@ -1,24 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
if (( EUID == 0 )); then
printf 'Run as the desktop user, without sudo.\n' >&2
exit 1
fi
BIN_DIR="$HOME/.local/bin"
SYSTEMD_DIR="$HOME/.config/systemd/user"
systemctl --user disable --now revive-monitor-drm-watch.service 2>/dev/null || true
rm -f "$SYSTEMD_DIR/revive-monitor-drm-watch.service"
rm -f "$BIN_DIR/revive-monitor-fix"
rm -f "$BIN_DIR/revive-monitor-drm-watch"
SYSTEMD_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
LIB_DIR="$HOME/.local/lib/hyprland-hdmi-revive"
SERVICE=revive-monitor-drm-watch.service
[[ "$SYSTEMD_DIR" == /* ]] || { printf 'XDG_CONFIG_HOME must be absolute\n' >&2; exit 1; }
systemctl --user show-environment >/dev/null
# Stop must succeed before removing a running service's files.
if systemctl --user cat "$SERVICE" >/dev/null 2>&1; then
systemctl --user disable --now "$SERVICE"
fi
rm -f -- "$SYSTEMD_DIR/$SERVICE" "$BIN_DIR/revive-monitor-fix" "$BIN_DIR/revive-monitor-drm-watch" "$LIB_DIR/common.sh"
rmdir -- "$LIB_DIR" 2>/dev/null || true
systemctl --user daemon-reload
systemctl --user reset-failed
# Never reset failure information for unrelated user services.
systemctl --user reset-failed "$SERVICE" 2>/dev/null || true
cat <<'MSG'
Removed the user service and installed scripts.
Not removed automatically:
~/.config/revive-monitor/config.env
/etc/sudoers.d/revive-monitor-chvt
Remove those manually if you no longer need them.
Preserved config.env and /etc/sudoers.d/revive-monitor-chvt.
Remove the Hyprland startup hook and sudoers entry manually if no longer needed.
MSG