Repository navigation
Conversation
|
Not sure about install step, but I can confirm that the hibernate work like it should be. |
|
@killeik ok, I got some problem with the hyprlock crash(not related), so I tried to reinstall and the first thing I do is to run the hibernate.sh command to test. Boot up to the linux only open a new fresh just like when reboot, others app open or the last state doesn't return. |
It's okay. The boot sequence from hibernation starts like a fresh boot. It should decrypt the disk and start the kernel. Later on, however, it finds a RAM dump on the disk and loads that instead of loading fresh.
Let's debug bash -c 'set -x ;
swapon ;
free -h ;
sudo btrfs subvolume show /swap ;
sudo btrfs inspect-internal map-swapfile /swap/swapfile ;
cat /sys/power/resume_offset ;
cat /sys/power/resume ;
cat /etc/fstab ;
cat /etc/mkinitcpio.conf.d/omarchy_resume.conf ;'And kernel logs after hibernation (they are not so small, so send them as file, maybe) For convenience, you can send them to me in DM in Discord, I'm @killeik on omarchy server |
|
After some debugging in DM, it was discovered that there was a magical Nvidia, for which the standard mode of operation on Linux is to torment the user. |
|
I've tested this on my Framework laptop / AMD Ryzen and it works great 👍 Thanks! |
|
Need to update for current branch, make the Hibernate option conditional on the swap being available, and add a migration with a gum confirm something like "Use XX GB on drive to make hibernate available?". |
While you add it. Also make a check if swap is already configured. I have an encrypted swap on my machine so |
|
My apologies. I updated my fork branch to the current active branch, accidentally deleting the changes I had added, and GitHub automatically closed the pull request because the branches started to match. By the way, I added migration and made the hibernation option in omarchy-menu optional. |
… estimate of hibernation image size
|
Tested conditional hibernation in power menu, and migration - everything works correctly. The only pitfall is that if the user manually created a swap and didn't enable the resume hook, the boot sequence will not resume from the saved hibernation image and will start fresh. I found a way to check if the hooks are enabled on the current initramfs with limine: |
|
Did you try the PR? I tried multiple PR in my own fork, and the menu does not work. I suspect this PR might break the omarchy menu system |
I've tested this PR on both of my computers and it works correctly. |
I will check tomorrow which PR that broke the app launcher then :) |
|
It was #1661 that broke the menu. I tested this. Works as it should. But it shows the lock menu that "hangs" while it waits for hibernation to be ready. Should we consider showing something else if possible? Would it be possible to have it say "Entering hibernation" instead of showing the lock screen, which you cannot type or do anything in? |
Thank you!
Neither hypridle, which invokes the lock screen before sleep or hibernation, nor hyprlock, which works as a lock screen, has any difference between sleep and hibernation. Therefore, it's not possible at this level. However, systemd has different targets: suspend.target, hibernate.target, hybrid-sleep.target, and suspend-then-hibernate.target. To do that the normal way, we would probably need to create an issue in Hyprildle/Hyprlock. |
Yeah, let's not walk down that road. But I can confirm the PR works as expected :) |
|
I am thinking about moving to OMARCHY from my customized ARCH and i think this was the script I used to enable the Swap. I used a swap file instead of a volume (i think the subvolume is the better approach). I drop my config / code as it may be helpful. My /etc/systemd/logind.conf |
|
@killeik I've been thinking if this should also enable the suspend-then-hibernate support. Unsure if we also must: References: |
|
If we want to do something like this, I suggest using
It will work if the system has or does not have hibernation mode. I'm also not sure if we really want to change HibernateDelaySec. Setting the And the
But I'm not sure if it's a good idea to talk about these improvements in this PR. My idea was just to add support for hibernation. |
|
Hi, @nielpattin! Could you test this fix? |
Bro, I have been switch to Windows 1 month ago... Might go back to Omarchy later in near future |
|
---EDIT Then all you have to do is add the following to to /etc/modprobe.d (with modconf hook active in mkinitcpio.conf). Note that nvidia-{hibernate,resume,suspend}.service must be on, nvidia-persistenced and nvidia-powerd can also be safely turned on if you want. On further note, Therefore, sleep can be changed from /etc/systemd/logind.conf:
|
|
The hyprland wiki says that setting So, who should we trust? o.O |
|
Attention NVIDIA users, hibernation DOES work with the above patches. However, hybrid-sleep (hibernation+suspend, not to be confused with suspend-then-hibernate) has certain caveats. I have an intel iGPU and nvidia dGPU. Resuming from hybrid-sleep disconnects the NVIDIA dGPU for some reason, as in cannot be used for processing during the remainder of your session and doesn't appear on btop/nvtop. I've scoured the net for hours and rebooted my PC almost 15-20 times. Could not resolve the issue. Most likely a driver issue from the posts I've seen online. Watch out for this log specifically: I will be on the look out for more info |
|
hibernation works well on my machine; x870e, 9950x3d, 96gb, 5090. |
|
Hi, I managed to get it working on desktop with nvidia gpu only. I followed this thread in nvidia forum
I'm on nvidia/580.105.08, 6.17.8-arch1-1, rtx 3070 Edit: yeeah so I actually advise against this, it's not reliable |
|
Needs a new rebase :) |
|
Just tested the script on a Lenovo Thinkpad X1 Gen 13 (intel processor) and it worked like a charm! |
|
I don't think it's convenient to have a menu option to hibernate. The most sensible default config would be to sleep then hibernate after a certain time if the laptop is running on battery. To my knowledge, that's how it works on MacOS and Windows. I modified the @woopstar config to hibernate after 24 hours if running on battery : I used the following config: # /etc/systemd/sleep.conf.d/suspend-then-hibernate.conf
[Sleep]
AllowSuspendThenHibernate=yes
HibernateDelaySec=24h# /etc/systemd/logind.conf.d/suspend-then-hibernate.conf
[Login]
HandleLidSwitch=suspend-then-hibernateAnd here is the script to set the files: #!/bin/bash
# --- logind (lid switch) ---
LOGIND_CONF_DIR="/etc/systemd/logind.conf.d"
LOGIND_CONF_FILE="$LOGIND_CONF_DIR/suspend-then-hibernate.conf"
if [[ ! -f "$LOGIND_CONF_FILE" ]]; then
sudo mkdir -p "$LOGIND_CONF_DIR"
sudo tee "$LOGIND_CONF_FILE" >/dev/null <<'EOF'
[Login]
HandleLidSwitch=suspend-then-hibernate
EOF
sudo systemctl restart systemd-logind
echo "Created $LOGIND_CONF_FILE and restarted systemd-logind"
fi
# --- sleep (hibernate delay) ---
SLEEP_CONF_DIR="/etc/systemd/sleep.conf.d"
SLEEP_CONF_FILE="$SLEEP_CONF_DIR/suspend-then-hibernate.conf"
if [[ ! -f "$SLEEP_CONF_FILE" ]]; then
sudo mkdir -p "$SLEEP_CONF_DIR"
sudo tee "$SLEEP_CONF_FILE" >/dev/null <<'EOF'
[Sleep]
AllowSuspendThenHibernate=yes
HibernateDelaySec=24h
EOF
echo "Created $SLEEP_CONF_FILE"
fi
``` |
If this was an OS for unified hardware I'd agree, but the hardware is too big to consider 24 hours sleep the only hibernation strategy. |
|
@Shirkit I don't know what you think would be a good default but waking up from hibernation is just as slow as a cold boot and you have to enter your password twice. So I wouldn't be too agressive on the timeout unless this works better and faster. |
|
It seems that dhh plans to disable even the normal sleep mode: fc04525 It seems that this MR will never be merged. This is a little frustrating, but I understand the maintainers motivation. Probably this MR should be turned into some kind of script/plugin outside the omarchy ecosystem so that people can add hibernation to their system... |
|
I'd like to have hibernation support in Omarchy, but it's not as simple as just merging this PR. I tried it when it first was posted, and there were a number of confusing issues and things that didn't work quite right. Haven't had time to get back to it yet. But normal sleep mode also has issues on a lot of machines leading to a confusing situation where the function either doesn't work or it only works partially (leaving the system in a degraded state on resume). I'd rather not offer something than offer it in a state where it's confusing/broken for some folks. |
There's a big difference in UX between cold boot and waking from hibernation though. All your state gets restored. In my opinion the the whole reason of having hibernation. Cold boot times have indeed become much shorter over the years, but not having to re-open all your work in progress is a big plus. |
A pity. Thanks for your effort though. I think your approach is close to the one I used (and documented here: https://hacktheplanet.be/spells/Linux/4-suspend-then-hibernate-in-omarchy/) and it has been working well on my Framework 13 AMD Ryzen 7040 laptop for the past few months. Perhaps we'll be able to come back to this PR in the future. |
Can't suggest an option that doesn't work much of the time
|
I like many other found this to work fine on my framework 13. But I also found that you can skip the LUKS decryption password when using the steps detailed in #1283 although this requires TPM. Would it be worth trying to get a pr for getting a TPM implementation merged? |
|
I have recently had some success on my system with getting hibernation to actually work properly and have put together a guide for others that might have a similar system to mine. OS: Specs: The whole process is documented here -> https://github.com/agworkgit/omarchy-hibernation-nvidia-fix |
|
@agworkgit this seems to break suspend-then-hibernate |
Yeah, sorry, I forgot to mention it, I mostly use just the hibernate functions as I'm on a PC and need resume after long periods away. If you want just suspend it usually works quite well out of the box but it won't power save if you're on a PC. |

Resolves: #105
/etc/fstabto mount swap file on bootHOOKS+=(resume)in/etc/mkinitcpio.conf.d/omarchy_resume.confHibernateoption to Power menuI'd love to get some feedback 😄