-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added hibernation support #1417
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
base: dev
Are you sure you want to change the base?
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. |
https://github.com/woopstar/omarchy/commits/master/ 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 hybridle, 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. |
There is an easier way to find
And I add https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Acquire_swap_file_offset |
Omarchy 3.0.2
Resolves: #105
/etc/fstab
to mount swap file on bootHOOKS+=(resume)
in/etc/mkinitcpio.conf.d/omarchy_resume.conf
Hibernate
option to Power menuI'd love to get some feedback 😄