How to completely disable Sleep, Hibernate and Fast Boot in EndeavourOS KDE?

Hello friends.

I know that in Windows 10, to disable Hibernate, you had to put a command in the console, and then the Hibernate button in the start menu would disappear.

Also to deactivate Sleep and Fast Boot you had to go to settings, and deactivating it made the Sleep button disappear from the start menu.

Now that I’m using EOS, I’m wondering how this works here, because I’ve disabled Hibernate and Sleep from system settings, and the Hibernate and Sleep button are still in the start menu. Maybe those 2 buttons are cosmetic now, or are they still functional?

And does EOS have Fast Boot like Windows 10, if so how can I disable it?

Thanks in advance!


1 Like

To disable hibernate, sleep (etc.) completely, you could do:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

7 Likes

Thank you very much friend.

To learn how it works, what exactly does this command do, edit the permissions of some document, or stop these processes from being activated when starting EOS?

sleep.target => sleep process
suspend.target => suspend process
hibernate.target => hibernate process
but:
hybrid-sleep.target => is this fast boot?

This is the first time I’ve seen a “file” with a .target extension.

Thanks again and sorry!

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate

Hybrid suspend (aka hybrid sleep)
A hybrid of suspending and hibernating, sometimes called suspend to both. Saves the machine’s state into swap space, but does not power off the machine. Instead, it invokes the default suspend. Therefore, if the battery is not depleted, the system can resume instantly. If the battery is depleted, the system can be resumed from disk, which is much slower than resuming from RAM, but the machine’s state has not been lost.

1 Like

A unit configuration file whose name ends in “.target” encodes information about a target unit of systemd.

Target units are used to group units and to set synchronization points for ordering dependencies with other unit files.

Target units do not offer any additional functionality on top of the generic functionality provided by units. They merely group units, allowing a single target name to be used in Wants= and Requires= settings to establish a dependency on a set of units defined by the target, and in Before= and After= settings to establish ordering. Targets establish standardized names for synchronization points during boot and shutdown.

:eye: https://www.freedesktop.org/software/systemd/man/systemd.target.html

Also: systemctl mask

mask UNIT…
Mask one or more units, as specified on the command line. This will link these unit files to /dev/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of activation
of the unit, including enablement and manual activation. Use this option with care. This honors the --runtime option to only mask temporarily until the next reboot of the system. The --now option may be used to ensure that
the units are also stopped. This command expects valid unit names only, it does not accept unit file paths.

For some more info, please refer to:

systemctl --help
man systemctl

And also: https://wiki.archlinux.org/title/Systemctl#Basic_systemctl_usage

2 Likes

If you feel like reading more manuals:

man systemd.special

sleep.target
A special target unit that is pulled in by suspend.target, hibernate.target and hybrid-sleep.target and may be used to hook units into the sleep state logic.

etc.

1 Like

Now I understand, the “mask” is like in Gimp, it hides the selected part, so this sends those 4 files to the NULL folder, and everything there can’t be activated.

Before:

○ sleep.target - Sleep
     Loaded: loaded (/usr/lib/systemd/system/sleep.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

○ suspend.target - Suspend
     Loaded: loaded (/usr/lib/systemd/system/suspend.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

○ hibernate.target - System Hibernation
     Loaded: loaded (/usr/lib/systemd/system/hibernate.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

○ hybrid-sleep.target - Hybrid Suspend+Hibernate
     Loaded: loaded (/usr/lib/systemd/system/hybrid-sleep.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

After:

○ sleep.target
     Loaded: masked (Reason: Unit sleep.target is masked.)
     Active: inactive (dead)

○ suspend.target
     Loaded: masked (Reason: Unit suspend.target is masked.)
     Active: inactive (dead)

○ hibernate.target
     Loaded: masked (Reason: Unit hibernate.target is masked.)
     Active: inactive (dead)

○ hybrid-sleep.target
     Loaded: masked (Reason: Unit hybrid-sleep.target is masked.)
     Active: inactive (dead)

Thank you very much friends, today I learned a lot thanks to all of you!

And it works perfect, the buttons disappeared like in Windows, just as I wanted!

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.