Hello everyone,
I’m using EndeavourOS with Hyperland on my old 2015 121-bit MacBook Pro. I’ve configured the lock screen and I use the shortcut SUPER + L to lock and then put my computer to sleep.
I’m using HyperLock and Hyperidle.
My problem is this: when I lock my computer, the HyperLock screen appears and sleep mode works, but after a few seconds, it wakes up for no apparent reason.
After some research, I think the LID0 service is causing this. I disabled it, and that worked. I also created the file “/etc/systemd/system/fix-macbook-lid.service” to permanently disable it, which also worked. However, when I close my 2015 MacBook, the Apple logo lights up, and I think the computer is waking up.
Is there a solution to make sleep mode work correctly when I close my computer? And do I have the right solution?
So, for your help
// “/etc/systemd/system/fix-macbook-lid.service”
GNU nano 9.0 /etc/systemd/system/fix-macbook-lid.service
[Unit]
Description=Disable Wake-by-Lid (LID)
After=multi-user.target
[Service]
Type=oneshot
This command checks if LID0 is ‘enabled’ and disables it if it is
ExecStart=/bin/sh -c “grep -q ‘LID0.*enabled’ /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup”
RemainAfterExit=yes
[Installer]
WantedBy=multi-user.target
// hypridle.conf
general {
lock_cmd = pidof hyprlock || hyprlock
before_sleep_cmd = loginctl lock-session
after_sleep_cmd = hyprctl dispatch dpms on
}
# 1. Verrouiller l'écran après 2 minutes (120s)
listener {
timeout = 120
on-timeout = loginctl lock-session
}
# 2. Éteindre l'écran après 2.5 minutes (150s) - Optionnel mais conseillé
listener {
timeout = 150
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
# 3. Mise en veille totale après 3 minutes (180s)
listener {
timeout = 180
on-timeout = systemctl suspend
}
// hyprland.conf
bind = SUPER, L, exec, loginctl lock-session && sleep 1.5 && systemctl suspend