-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix NVIDIA + hyprlock system freeze on suspend #5421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix /boot permissions security issue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The random seed file and /boot mount should not be world accessible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5377 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Fixing /boot permissions for better security..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix /boot directory permissions (should be 700) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo chmod 700 /boot 2>/dev/null || echo "Could not change /boot permissions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix random-seed file permissions if it exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -f /boot/loader/random-seed ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo chmod 600 /boot/loader/random-seed 2>/dev/null || echo "Could not change random-seed permissions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Ensure /boot is mounted with proper permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Add to fstab if not already present with correct options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! grep -q "^/boot" /etc/fstab 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Warning: /boot is not in fstab, permissions may not persist" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Disable bootctl random seed generation warnings by setting correct permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if command -v bootctl &>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run bootctl with proper environment to set correct permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo bootctl random-seed 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Boot permissions fix complete!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+29
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix /boot permissions security issue | |
| # The random seed file and /boot mount should not be world accessible | |
| # See: https://github.com/basecamp/omarchy/issues/5377 | |
| echo "Fixing /boot permissions for better security..." | |
| # Fix /boot directory permissions (should be 700) | |
| sudo chmod 700 /boot 2>/dev/null || echo "Could not change /boot permissions" | |
| # Fix random-seed file permissions if it exists | |
| if [[ -f /boot/loader/random-seed ]]; then | |
| sudo chmod 600 /boot/loader/random-seed 2>/dev/null || echo "Could not change random-seed permissions" | |
| fi | |
| # Ensure /boot is mounted with proper permissions | |
| # Add to fstab if not already present with correct options | |
| if ! grep -q "^/boot" /etc/fstab 2>/dev/null; then | |
| echo "Warning: /boot is not in fstab, permissions may not persist" | |
| fi | |
| # Disable bootctl random seed generation warnings by setting correct permissions | |
| if command -v bootctl &>/dev/null; then | |
| # Run bootctl with proper environment to set correct permissions | |
| sudo bootctl random-seed 2>/dev/null || true | |
| fi | |
| echo "Boot permissions fix complete!" | |
| # Deprecated: this script is not invoked by the installation flow. | |
| # Keep this file as an explicit no-op so the repository does not imply | |
| # that the /boot permissions fix is automatically applied during install. | |
| # See: https://github.com/basecamp/omarchy/issues/5377 | |
| echo "boot-permissions-fix.sh is not part of the installer flow and does not apply any changes." | |
| echo "Wire this fix into the installer entrypoint before reintroducing remediation here." | |
| exit 0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||
|
|
||||||||||||||||||
| # Fix NVIDIA + hyprlock suspend freeze issue | ||||||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5277 | ||||||||||||||||||
|
|
||||||||||||||||||
| echo "Applying NVIDIA suspend fix..." | ||||||||||||||||||
|
|
||||||||||||||||||
| # Get absolute path for the script | ||||||||||||||||||
| HYPRLOCK_SCRIPT="$(realpath "$(which hyprlock 2>/dev/null || echo '/usr/bin/hyprlock')" 2>/dev/null)" | ||||||||||||||||||
|
|
||||||||||||||||||
| # Check if user is on NVIDIA | ||||||||||||||||||
| if command -v nvidia-smi &>/dev/null; then | ||||||||||||||||||
| echo "NVIDIA GPU detected, applying suspend fix..." | ||||||||||||||||||
|
|
||||||||||||||||||
| # Create a systemd service to stop hyprlock before suspend | ||||||||||||||||||
|
Comment on lines
+6
to
+15
|
||||||||||||||||||
| cat << SYSTEMDEOF | sudo tee /etc/systemd/system/hyprlock-suspend.service > /dev/null | ||||||||||||||||||
| [Unit] | ||||||||||||||||||
| Description=Stop hyprlock before suspend/hibernate | ||||||||||||||||||
| Before=suspend.target hibernate.target hybrid-suspend.target | ||||||||||||||||||
| DefaultDependencies=no | ||||||||||||||||||
| After=hypridle.service | ||||||||||||||||||
|
||||||||||||||||||
| After=hypridle.service |
Copilot
AI
Apr 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkill exits non-zero when no matching process is found. As written, that would mark the unit as failed on suspend/resume when hyprlock isn’t running (and could interfere with sleep on some setups). Make these ExecStart/ExecStop commands non-fatal when hyprlock isn’t present (e.g., ignore exit status 1).
| ExecStart=/usr/bin/pkill -STOP hyprlock | |
| RemainAfterExit=yes | |
| ExecStop=/usr/bin/pkill -CONT hyprlock | |
| ExecStart=-/usr/bin/pkill -STOP hyprlock | |
| RemainAfterExit=yes | |
| ExecStop=-/usr/bin/pkill -CONT hyprlock |
Copilot
AI
Apr 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After writing a new unit file under /etc/systemd/system, this should call systemctl daemon-reload before enabling/starting it; several other installer scripts follow that pattern. Also consider using chrootable_systemctl_enable (and --now when not in chroot) to match the installer’s service-enable convention.
| sudo systemctl enable hyprlock-suspend.service 2>/dev/null || echo "Warning: Could not enable hyprlock-suspend service" | |
| sudo systemctl daemon-reload 2>/dev/null || echo "Warning: Could not reload systemd units" | |
| if type chrootable_systemctl_enable >/dev/null 2>&1; then | |
| chrootable_systemctl_enable hyprlock-suspend.service 2>/dev/null || echo "Warning: Could not enable hyprlock-suspend service" | |
| else | |
| sudo systemctl enable hyprlock-suspend.service 2>/dev/null || echo "Warning: Could not enable hyprlock-suspend service" | |
| fi |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix snapper /home config creation for chroot installations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5344 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Ensuring snapper /home config is created..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if /home is on a separate subvolume or btrfs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if mountpoint -q /home 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # /home is a separate mount point | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Creating snapper config for /home..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| elif [[ -d /home/.snapshots ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # /home has .snapshots subdirectory, ensure config exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Creating snapper config for /home subvolume..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+20
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "/home is not on a separate subvolume, skipping /home snapper config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Also ensure root snapper config exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Creating snapper config for root..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo snapper -c root create-config / 2>/dev/null || echo "Warning: Could not create root snapper config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo cp $OMARCHY_PATH/default/snapper/root /etc/snapper/configs/root 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Snapper config check complete!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+32
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix snapper /home config creation for chroot installations | |
| # See: https://github.com/basecamp/omarchy/issues/5344 | |
| echo "Ensuring snapper /home config is created..." | |
| # Check if /home is on a separate subvolume or btrfs | |
| if mountpoint -q /home 2>/dev/null; then | |
| # /home is a separate mount point | |
| if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then | |
| echo "Creating snapper config for /home..." | |
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | |
| fi | |
| elif [[ -d /home/.snapshots ]]; then | |
| # /home has .snapshots subdirectory, ensure config exists | |
| if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then | |
| echo "Creating snapper config for /home subvolume..." | |
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | |
| fi | |
| else | |
| echo "/home is not on a separate subvolume, skipping /home snapper config" | |
| fi | |
| # Also ensure root snapper config exists | |
| if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then | |
| echo "Creating snapper config for root..." | |
| sudo snapper -c root create-config / 2>/dev/null || echo "Warning: Could not create root snapper config" | |
| sudo cp $OMARCHY_PATH/default/snapper/root /etc/snapper/configs/root 2>/dev/null || true | |
| fi | |
| echo "Snapper config check complete!" | |
| # This script is intentionally unused. | |
| # It previously contained snapper configuration logic for /home and /, | |
| # but it is not referenced by the installer flow. | |
| # Keep this file as a documented placeholder until the logic is either | |
| # wired into install/config/all.sh or reintroduced in an active installer step. | |
| echo "snapper-home-config.sh is not part of the install flow; skipping." | |
| exit 0 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||
| #!/bin/bash | ||||||||||
|
|
||||||||||
| # Fix /boot permissions security issue | ||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5377 | ||||||||||
|
|
||||||||||
| echo "Fixing /boot permissions for better security..." | ||||||||||
|
Comment on lines
+1
to
+6
|
||||||||||
|
|
||||||||||
| # Fix /boot directory permissions (should be 700 for security) | ||||||||||
| sudo chmod 700 /boot 2>/dev/null || echo "Could not change /boot permissions" | ||||||||||
|
|
||||||||||
| # Fix random-seed file permissions if it exists | ||||||||||
| if [[ -f /boot/loader/random-seed ]]; then | ||||||||||
| sudo chmod 600 /boot/loader/random-seed 2>/dev/null || echo "Could not change random-seed permissions" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| # Verify the fix | ||||||||||
| if [[ $(stat -c %a /boot 2>/dev/null) == "700" ]]; then | ||||||||||
| echo "✓ /boot permissions fixed to 700" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| if [[ -f /boot/loader/random-seed ]] && [[ $(stat -c %a /boot/loader/random-seed 2>/dev/null) == "600" ]]; then | ||||||||||
| echo "✓ random-seed permissions fixed to 600" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| notify-send "Boot permissions fixed" "Security improvement applied to /boot" | ||||||||||
|
||||||||||
| notify-send "Boot permissions fixed" "Security improvement applied to /boot" | |
| if command -v notify-send >/dev/null 2>&1 && [[ -n "${DISPLAY:-}" || -n "${WAYLAND_DISPLAY:-}" || -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then | |
| notify-send "Boot permissions fixed" "Security improvement applied to /boot" || true | |
| fi |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix snapper /home config for chroot installations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5344 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Fixing snapper /home config..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if /home is on btrfs and has .snapshots | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -d /home/.snapshots ]] || mountpoint -q /home 2>/dev/null; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if /home snapper config exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ! sudo snapper list-configs 2>/dev/null | grep -q "^home"; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Creating snapper config for /home..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Copy default config | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -f /etc/snapper/configs/root ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo cp /etc/snapper/configs/root /etc/snapper/configs/home 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Modify for /home - don't create timeline snapshots | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i 's|SUBVOLUME="/"|SUBVOLUME="/home"|' /etc/snapper/configs/home 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i 's|TIMELINE_CREATE="yes"|TIMELINE_CREATE="no"|' /etc/snapper/configs/home 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "✓ Created snapper /home config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Snapper /home config already exists" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "/home is not on btrfs or separate subvolume, skipping" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+30
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix snapper /home config for chroot installations | |
| # See: https://github.com/basecamp/omarchy/issues/5344 | |
| echo "Fixing snapper /home config..." | |
| # Check if /home is on btrfs and has .snapshots | |
| if [[ -d /home/.snapshots ]] || mountpoint -q /home 2>/dev/null; then | |
| # Check if /home snapper config exists | |
| if ! sudo snapper list-configs 2>/dev/null | grep -q "^home"; then | |
| echo "Creating snapper config for /home..." | |
| sudo snapper -c home create-config /home 2>/dev/null || echo "Warning: Could not create /home snapper config" | |
| # Copy default config | |
| if [[ -f /etc/snapper/configs/root ]]; then | |
| sudo cp /etc/snapper/configs/root /etc/snapper/configs/home 2>/dev/null || true | |
| # Modify for /home - don't create timeline snapshots | |
| sudo sed -i 's|SUBVOLUME="/"|SUBVOLUME="/home"|' /etc/snapper/configs/home 2>/dev/null || true | |
| sudo sed -i 's|TIMELINE_CREATE="yes"|TIMELINE_CREATE="no"|' /etc/snapper/configs/home 2>/dev/null || true | |
| fi | |
| echo "✓ Created snapper /home config" | |
| else | |
| echo "Snapper /home config already exists" | |
| fi | |
| else | |
| echo "/home is not on btrfs or separate subvolume, skipping" | |
| fi | |
| # Fix snapper config for chroot installations | |
| # See: https://github.com/basecamp/omarchy/issues/5344 | |
| echo "Fixing snapper config..." | |
| echo "Skipping /home snapper config creation; /home snapshots are intentionally disabled" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix snapshot restore to exclude /home from restoration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5361 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Configuring snapshot restore to exclude /home..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The issue is that limine-snapper-restore might be restoring /home along with root | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # We need to document and provide a workaround | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create a wrapper script that warns users about /home | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WRAPPER="/usr/local/bin/omarchy-snapshot-restore-safe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cat > "$WRAPPER" << 'WRAPPEREOF' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Safe snapshot restore wrapper | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Warns users that /home will NOT be restored | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "⚠️ WARNING: This will restore the ROOT filesystem only." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "⚠️ Your /home directory will NOT be affected." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "To restore a snapshot:" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "1. Reboot and select the snapshot from limine menu" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "2. The snapshot will restore ONLY the root filesystem" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "If you need to restore /home from a snapshot:" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "- Boot into the snapshot" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "- Manually restore /home from .snapshots subvolumes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -t 0 ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| read -p "Continue with snapshot restore? (y/N) " -n 1 -r | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec sudo limine-snapper-restore "$@" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WRAPPEREOF | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+39
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo chmod +x "$WRAPPER" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+9
to
+42
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # We need to document and provide a workaround | |
| # Create a wrapper script that warns users about /home | |
| WRAPPER="/usr/local/bin/omarchy-snapshot-restore-safe" | |
| cat > "$WRAPPER" << 'WRAPPEREOF' | |
| #!/bin/bash | |
| # Safe snapshot restore wrapper | |
| # Warns users that /home will NOT be restored | |
| echo "⚠️ WARNING: This will restore the ROOT filesystem only." | |
| echo "⚠️ Your /home directory will NOT be affected." | |
| echo "" | |
| echo "To restore a snapshot:" | |
| echo "1. Reboot and select the snapshot from limine menu" | |
| echo "2. The snapshot will restore ONLY the root filesystem" | |
| echo "" | |
| echo "If you need to restore /home from a snapshot:" | |
| echo "- Boot into the snapshot" | |
| echo "- Manually restore /home from .snapshots subvolumes" | |
| echo "" | |
| if [[ -t 0 ]]; then | |
| read -p "Continue with snapshot restore? (y/N) " -n 1 -r | |
| echo | |
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
| exit 1 | |
| fi | |
| fi | |
| exec sudo limine-snapper-restore "$@" | |
| WRAPPEREOF | |
| sudo chmod +x "$WRAPPER" | |
| # Document the current behavior so users know /home is not part of the restore flow |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||
| #!/bin/bash | ||||||||||||||
|
|
||||||||||||||
| # Fix NVIDIA + hyprlock suspend freeze issue | ||||||||||||||
| # See: https://github.com/basecamp/omarchy/issues/5277 | ||||||||||||||
|
|
||||||||||||||
| echo "Applying NVIDIA suspend fix..." | ||||||||||||||
|
|
||||||||||||||
| # Check if user is on NVIDIA | ||||||||||||||
| if command -v nvidia-smi &>/dev/null; then | ||||||||||||||
| echo "NVIDIA GPU detected, applying suspend fix..." | ||||||||||||||
|
|
||||||||||||||
| # Create a systemd service to stop hyprlock before suspend | ||||||||||||||
| cat << SYSTEMDEOF | sudo tee /etc/systemd/system/hyprlock-suspend.service > /dev/null | ||||||||||||||
| [Unit] | ||||||||||||||
| Description=Stop hyprlock before suspend/hibernate | ||||||||||||||
| Before=suspend.target hibernate.target hybrid-suspend.target | ||||||||||||||
| DefaultDependencies=no | ||||||||||||||
| After=hypridle.service | ||||||||||||||
|
||||||||||||||
| After=hypridle.service |
Copilot
AI
Apr 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkill returns exit code 1 when no matching process exists; as written, this will cause the service to fail on suspend/resume if hyprlock isn’t running. Make the ExecStart/ExecStop non-fatal when there’s nothing to signal (e.g., ignore exit status 1) to avoid failed sleep hooks.
| ExecStart=/usr/bin/pkill -STOP hyprlock | |
| RemainAfterExit=yes | |
| ExecStop=/usr/bin/pkill -CONT hyprlock | |
| ExecStart=-/usr/bin/pkill -STOP hyprlock | |
| RemainAfterExit=yes | |
| ExecStop=-/usr/bin/pkill -CONT hyprlock |
Copilot
AI
Apr 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After writing a new unit file into /etc/systemd/system, the migration should run systemctl daemon-reload before enabling it so systemd can pick it up immediately. This matches the pattern used by other scripts in the repo when adding services/drop-ins.
| sudo systemctl daemon-reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fstab check is looking for lines that start with
/boot, but in fstab the mountpoint is typically the second column (e.g.,UUID=... /boot vfat ...). This will warn incorrectly on most systems. Match the mountpoint column instead (e.g., a regex for whitespace + /boot + whitespace).