Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bin/omarchy-launch-walker.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is running first.

# Ensure elephant is running before launching walker
if ! pgrep -x elephant > /dev/null; then
setsid uwsm-app -- elephant &
fi

# Ensure walker service is running
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
setsid uwsm-app -- walker --gapplication-service &
fi

exec walker --width 644 --maxheight 300 --minheight 300 "$@"
9 changes: 8 additions & 1 deletion bin/omarchy-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [[ -z $COMMAND ]]; then
fi

if ! command -v snapper &>/dev/null; then
exit 127 # omarchy-update can use this to just ignore if snapper is not available
exit 127
fi

case "$COMMAND" in
Expand All @@ -29,6 +29,13 @@ create)
echo
;;
restore)
echo "⚠️ Snapshot restore will restore the ROOT filesystem only."
echo "⚠️ Your /home directory will NOT be affected."
echo ""
echo "If you need to restore /home:"
echo "1. Boot into the snapshot from limine menu"
echo "2. /home is NOT included in the snapshot restore"
echo ""
sudo limine-snapper-restore
;;
esac
34 changes: 17 additions & 17 deletions default/hypr/apps.conf
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# App-specific tweaks
source = ~/.local/share/omarchy/default/hypr/apps/1password.conf
source = ~/.local/share/omarchy/default/hypr/apps/bitwarden.conf
source = ~/.local/share/omarchy/default/hypr/apps/browser.conf
source = ~/.local/share/omarchy/default/hypr/apps/hyprshot.conf
source = ~/.local/share/omarchy/default/hypr/apps/localsend.conf
source = ~/.local/share/omarchy/default/hypr/apps/pip.conf
source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf
source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf
source = ~/.local/share/omarchy/default/hypr/apps/steam.conf
source = ~/.local/share/omarchy/default/hypr/apps/geforce.conf
source = ~/.local/share/omarchy/default/hypr/apps/moonlight.conf
source = ~/.local/share/omarchy/default/hypr/apps/system.conf
source = ~/.local/share/omarchy/default/hypr/apps/telegram.conf
source = ~/.local/share/omarchy/default/hypr/apps/typora.conf
source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf
source = ~/.local/share/omarchy/default/hypr/apps/walker.conf
source = ~/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/1password.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/bitwarden.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/browser.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/hyprshot.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/localsend.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/pip.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/qemu.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/retroarch.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/steam.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/geforce.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/moonlight.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/system.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/telegram.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/typora.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/terminals.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/walker.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These source = paths are hard-coded to /home/kuro, which will break Hyprland config loading for every other username. Please revert to a user-relative path (e.g., ~/.local/share/... or $HOME/.local/share/...) so the default config is portable.

Suggested change
source = /home/kuro/.local/share/omarchy/default/hypr/apps/1password.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/bitwarden.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/browser.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/hyprshot.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/localsend.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/pip.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/qemu.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/retroarch.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/steam.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/geforce.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/moonlight.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/system.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/telegram.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/typora.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/terminals.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/walker.conf
source = /home/kuro/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf
source = ~/.local/share/omarchy/default/hypr/apps/1password.conf
source = ~/.local/share/omarchy/default/hypr/apps/bitwarden.conf
source = ~/.local/share/omarchy/default/hypr/apps/browser.conf
source = ~/.local/share/omarchy/default/hypr/apps/hyprshot.conf
source = ~/.local/share/omarchy/default/hypr/apps/localsend.conf
source = ~/.local/share/omarchy/default/hypr/apps/pip.conf
source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf
source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf
source = ~/.local/share/omarchy/default/hypr/apps/steam.conf
source = ~/.local/share/omarchy/default/hypr/apps/geforce.conf
source = ~/.local/share/omarchy/default/hypr/apps/moonlight.conf
source = ~/.local/share/omarchy/default/hypr/apps/system.conf
source = ~/.local/share/omarchy/default/hypr/apps/telegram.conf
source = ~/.local/share/omarchy/default/hypr/apps/typora.conf
source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf
source = ~/.local/share/omarchy/default/hypr/apps/walker.conf
source = ~/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf

Copilot uses AI. Check for mistakes.
3 changes: 3 additions & 0 deletions install/config/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ run_logged $OMARCHY_INSTALL/config/hardware/usb-autosuspend.sh
run_logged $OMARCHY_INSTALL/config/hardware/ignore-power-button.sh
run_logged $OMARCHY_INSTALL/config/hardware/nvidia.sh
run_logged $OMARCHY_INSTALL/config/hardware/vulkan.sh
run_logged $OMARCHY_INSTALL/config/supergfxd-nvidia-fix.sh
run_logged $OMARCHY_INSTALL/config/nvidia-suspend-fix.sh
run_logged $OMARCHY_INSTALL/config/boot-permissions-fix.sh
Comment on lines +40 to +42
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says only two files are changed for the supergfxd NVIDIA fix, but this commit also adds/executes other fixes (NVIDIA suspend, /boot permissions, snapper messaging, Hyprland config changes, etc.). Please update the PR description/scope so reviewers understand the full impact and can validate each behavior change.

Copilot uses AI. Check for mistakes.

run_logged $OMARCHY_INSTALL/config/hardware/intel/video-acceleration.sh
run_logged $OMARCHY_INSTALL/config/hardware/intel/lpmd.sh
Expand Down
29 changes: 29 additions & 0 deletions install/config/boot-permissions-fix.sh
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..."
Comment on lines +1 to +7
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is placed under install/config, but it isn’t referenced from the installer entrypoints (no calls found from install/config/all.sh or other install scripts). If it’s intended to run during install, it needs to be added to the install flow; otherwise it won’t ever be applied automatically.

Copilot uses AI. Check for mistakes.

# 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
# Parse fstab properly (check second field for /boot mountpoint)
if ! awk '!/^[[:space:]]*#/ && NF >= 2 && $2 == "/boot" { found=1; exit } END { exit !found }' /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!"
49 changes: 49 additions & 0 deletions install/config/nvidia-suspend-fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

# Fix NVIDIA + hyprlock suspend freeze issue
# See: https://github.com/basecamp/omarchy/issues/5277

echo "Applying NVIDIA suspend fix..."
Comment on lines +1 to +6
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is placed under install/config, but it isn’t referenced from the installer entrypoints (no calls found from install/config/all.sh or other install scripts). If it’s meant to be applied during install, it should be wired into the install flow via run_logged (otherwise it’s currently dead code).

Copilot uses AI. Check for mistakes.

# The issue is that hyprlock holds DRM/GBM resources during suspend,
# preventing NVIDIA from entering proper suspend state

# 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 << 'SYSTEMD' | 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

[Service]
Type=oneshot
ExecStart=/usr/bin/pkill -STOP hyprlock
RemainAfterExit=yes
ExecStop=/usr/bin/pkill -CONT hyprlock
TimeoutStopSec=5
Comment on lines +25 to +28
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit uses pkill ... hyprlock without -x (exact match) or user scoping, which can signal unintended processes and affect all users’ sessions. Consider exact matching and (if possible) scoping to the active graphical user/session to avoid collateral SIGSTOP/SIGCONT.

Copilot uses AI. Check for mistakes.

[Install]
WantedBy=suspend.target hibernate.target hybrid-suspend.target
SYSTEMD

# Reload systemd daemon to recognize the new unit
sudo systemctl daemon-reload 2>/dev/null || echo "Warning: Could not reload systemd daemon"

# Enable the service using chrootable helper if available
if command -v 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

echo "✓ Created hyprlock-suspend service"
else
echo "No NVIDIA GPU detected, skipping NVIDIA-specific fixes"
fi

echo "NVIDIA suspend fix complete!"
32 changes: 32 additions & 0 deletions install/config/snapper-home-config.sh
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..."
Comment on lines +1 to +6
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is placed under install/config, but it isn’t referenced from the installer entrypoints (no calls found from install/config/all.sh or other install scripts). If it’s meant to ensure snapper configs during install, it should be wired into the install flow; otherwise it won’t run.

Copilot uses AI. Check for mistakes.

# 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"
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using grep -q "home" on snapper list-configs can produce false positives because the output includes a subvolume column (e.g., any config with subvolume /home would match even if the config name isn’t home). This can cause the script to skip creating the required home config and later commands that assume -c home to fail. Prefer matching the config name column explicitly (e.g., grep -qE '^home[[:space:]]').

Copilot uses AI. Check for mistakes.
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 +16 to +20
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above: grep -q "home" can match the subvolume column rather than the config name, so the check can incorrectly think the home config exists. Match the config name column explicitly (e.g., ^home[[:space:]]).

Copilot uses AI. Check for mistakes.
else
echo "/home is not on a separate subvolume, skipping /home snapper config"
fi

Comment on lines +3 to +24
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script creates a Snapper "home" config, which conflicts with the repo’s established behavior of snapshotting only root (see install/login/limine-snapper.sh:53-57 and migrations/1776927490.sh which deletes the home config). Creating /home snapshots again can reintroduce the accidental user-data rollback the project is trying to avoid; consider removing the /home config creation or gating it behind an explicit opt-in setting.

Suggested change
# 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 -qE '^home[[:space:]]'; 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 -qE '^home[[:space:]]'; 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
# Ensure snapper configuration matches the project's root-only snapshot policy
# /home snapshotting is intentionally not auto-created to avoid user-data rollback
echo "Ensuring snapper root config is created..."
echo "Skipping snapper /home config creation; this system snapshots only root."

Copilot uses AI. Check for mistakes.
# 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
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, grep -q "root" is not constrained to the config name column of snapper list-configs. It’s safer to match the config name explicitly (e.g., grep -qE '^root[[:space:]]') to avoid accidental matches with other configs/columns.

Copilot uses AI. Check for mistakes.
fi

echo "Snapper config check complete!"
37 changes: 37 additions & 0 deletions install/config/supergfxd-nvidia-fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Fix NVIDIA GPU detection when supergfxd is blacklisting modules
# See: https://github.com/basecamp/omarchy/issues/5408

echo "Fixing NVIDIA GPU detection..."
Comment on lines +1 to +6
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script appears to be intended as part of the installer (“New installer script”), but it isn’t referenced anywhere in the install flow (no calls found from install/config/all.sh or other install scripts). If it should run automatically during install, it needs to be wired into the installer (e.g., added to install/config/all.sh via run_logged).

Copilot uses AI. Check for mistakes.

SUPERGFXD_CONF="/etc/modprobe.d/supergfxd.conf"

# Check for persisted NVIDIA blacklists from supergfxd regardless of service state
if grep -Eq '^[[:space:]]*blacklist[[:space:]]+nvidia([_-][[:alnum:]_]+)?([[:space:]]|$)' "$SUPERGFXD_CONF" 2>/dev/null; then
echo "Found nvidia blacklist from supergfxd!"
echo "Disabling supergfxd to enable NVIDIA..."

# Disable supergfxd if active or enabled
if systemctl is-active --quiet supergfxd 2>/dev/null || systemctl is-enabled --quiet supergfxd 2>/dev/null; then
sudo systemctl disable --now supergfxd 2>/dev/null || true
fi

sudo rm -f "$SUPERGFXD_CONF" 2>/dev/null || true

# Regenerate initramfs
sudo mkinitcpio -P 2>/dev/null || true

echo "✓ Removed supergfxd NVIDIA blacklist"
echo "⚠️ Please reboot for changes to take effect"
else
echo "No supergfxd NVIDIA blacklist found, no action needed"
fi

# Also ensure NVIDIA modules are not blocked elsewhere
if ls /etc/modprobe.d/*nvidia*.conf 2>/dev/null | grep -v supergfxd | grep -q .; then
echo "Warning: Other nvidia blacklist files found:"
ls /etc/modprobe.d/*nvidia*.conf 2>/dev/null | grep -v supergfxd
fi

echo "NVIDIA GPU detection fix complete!"
30 changes: 30 additions & 0 deletions migrations/1777007500.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/title focus on the supergfxd/NVIDIA detection fix, but this PR also adds migrations for /boot permissions, snapper, snapshot restore messaging, and hyprlock suspend behavior. Please update the PR description to cover these additional changes or split them into separate PRs so the scope matches the stated intent.

Copilot uses AI. Check for mistakes.

# 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

# Guard notify-send for environments without GUI/DBUS
if command -v notify-send >/dev/null 2>&1 && [[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
notify-send "Boot permissions fixed" "Security improvement applied to /boot" || true
fi

exit 0
38 changes: 38 additions & 0 deletions migrations/1777007501.sh
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

# Ensure root 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 || true
sudo cp $OMARCHY_PATH/default/snapper/root /etc/snapper/configs/root 2>/dev/null || true
fi

echo "Snapper config fix complete!"
22 changes: 22 additions & 0 deletions migrations/1777007502.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Configure snapshot restore messaging for /home exclusion
# See: https://github.com/basecamp/omarchy/issues/5361

echo "Configuring snapshot restore messaging..."

# The issue is that limine-snapper-restore might restore /home along with root
# This script adds warning output to omarchy-snapshot to inform users

# Update omarchy-snapshot with /home exclusion warning
if [[ -f /usr/local/bin/omarchy-snapshot ]]; then
if ! grep -q "will NOT be affected" /usr/local/bin/omarchy-snapshot 2>/dev/null; then
echo "Warning: /usr/local/bin/omarchy-snapshot not updated (may already have warning)"
fi
fi

Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration claims to "configure" /home-exclusion messaging, but it never actually updates the target script; it only prints a warning and then reports success. If the goal is to update existing installs, the migration should patch/replace the installed omarchy-snapshot (or ensure it points at the updated $OMARCHY_PATH/bin/omarchy-snapshot) instead of being a no-op.

Suggested change
# This script adds warning output to omarchy-snapshot to inform users
# Update omarchy-snapshot with /home exclusion warning
if [[ -f /usr/local/bin/omarchy-snapshot ]]; then
if ! grep -q "will NOT be affected" /usr/local/bin/omarchy-snapshot 2>/dev/null; then
echo "Warning: /usr/local/bin/omarchy-snapshot not updated (may already have warning)"
fi
fi
# This migration must update the installed omarchy-snapshot so existing installs
# receive the warning output as intended.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SOURCE_SNAPSHOT="$REPO_ROOT/bin/omarchy-snapshot"
TARGET_SNAPSHOT="/usr/local/bin/omarchy-snapshot"
if [[ ! -f "$SOURCE_SNAPSHOT" ]]; then
echo "Error: updated snapshot script not found at $SOURCE_SNAPSHOT"
exit 1
fi
if [[ ! -d "$(dirname "$TARGET_SNAPSHOT")" ]]; then
echo "Error: target directory $(dirname "$TARGET_SNAPSHOT") does not exist"
exit 1
fi
if ! install -m 0755 "$SOURCE_SNAPSHOT" "$TARGET_SNAPSHOT"; then
echo "Error: failed to update $TARGET_SNAPSHOT"
exit 1
fi
if ! grep -q "will NOT be affected" "$TARGET_SNAPSHOT" 2>/dev/null; then
echo "Error: $TARGET_SNAPSHOT was updated, but the /home exclusion warning is still missing"
exit 1
fi

Copilot uses AI. Check for mistakes.
echo ""
echo "✅ Snapshot restore warning configured"
echo "⚠️ Remember: Snapshot restore only affects ROOT filesystem"
echo "⚠️ Your /home directory will NOT be affected"
echo ""
45 changes: 45 additions & 0 deletions migrations/1777007503.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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 << 'SYSTEMD' | 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

[Service]
Type=oneshot
ExecStart=/usr/bin/pkill -STOP hyprlock
RemainAfterExit=yes
ExecStop=/usr/bin/pkill -CONT hyprlock
TimeoutStopSec=5

[Install]
WantedBy=suspend.target hibernate.target hybrid-suspend.target
SYSTEMD

Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After writing systemd unit files elsewhere, the codebase typically runs systemctl daemon-reload (e.g. install/config/hardware/dell/fix-xps-haptic-touchpad.sh:34, install/config/docker.sh:32) before enabling/starting. This migration writes /etc/systemd/system/hyprlock-suspend.service and enables it without a daemon-reload, which can prevent systemd from picking it up immediately in the current session. Consider adding sudo systemctl daemon-reload before enabling the service.

Suggested change
sudo systemctl daemon-reload

Copilot uses AI. Check for mistakes.
# Reload systemd daemon to recognize the new unit
sudo systemctl daemon-reload

# Enable the service using chrootable helper if available
if command -v 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"
Comment on lines +12 to +38
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit uses pkill ... hyprlock without -x (exact match) or any user scoping. This can signal unintended processes whose name merely contains “hyprlock”, and it will affect all users’ sessions. Consider using exact matching (and ideally scoping to the active session/user) to avoid collateral SIGSTOP/SIGCONT.

Suggested change
# Create a systemd service to stop hyprlock before suspend
# The - prefix makes pkill non-fatal when hyprlock isn't running
cat << 'SYSTEMD' | 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
[Service]
Type=oneshot
ExecStart=-/usr/bin/pkill -STOP hyprlock
RemainAfterExit=yes
ExecStop=-/usr/bin/pkill -CONT hyprlock
TimeoutStopSec=5
[Install]
WantedBy=suspend.target hibernate.target hybrid-suspend.target
SYSTEMD
# Reload systemd daemon to recognize the new unit
sudo systemctl daemon-reload
# Enable the service using chrootable helper if available
if command -v 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"
# Create a per-user systemd service to stop hyprlock before suspend
# The - prefix makes pkill non-fatal when hyprlock isn't running
cat << 'SYSTEMD' | sudo tee /etc/systemd/system/hyprlock-suspend@.service > /dev/null
[Unit]
Description=Stop hyprlock before suspend/hibernate for user %I
Before=suspend.target hibernate.target hybrid-suspend.target
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=-/usr/bin/pkill -u %I -x -STOP hyprlock
RemainAfterExit=yes
ExecStop=-/usr/bin/pkill -u %I -x -CONT hyprlock
TimeoutStopSec=5
[Install]
WantedBy=suspend.target hibernate.target hybrid-suspend.target
SYSTEMD
target_user="${SUDO_USER:-$USER}"
# Reload systemd daemon to recognize the new unit
sudo systemctl daemon-reload
# Enable the service using chrootable helper if available
if command -v chrootable_systemctl_enable >/dev/null 2>&1; then
chrootable_systemctl_enable "hyprlock-suspend@${target_user}.service" 2>/dev/null || echo "Warning: Could not enable hyprlock-suspend service"
else
sudo systemctl enable "hyprlock-suspend@${target_user}.service" 2>/dev/null || echo "Warning: Could not enable hyprlock-suspend service"

Copilot uses AI. Check for mistakes.
fi

echo "✓ Created hyprlock-suspend service"
echo "✓ hyprlock will stop before suspend and resume after"
else
echo "No NVIDIA GPU detected, skipping NVIDIA-specific fixes"
fi
Loading
Loading