This is bugging me like crazy. I have tried about a hundred different ways of making my monitors turn off/idle but no matter what I do, the furthest I can get is successfully getting my main monitor to idle but my second monitor will instantly come back on 2 seconds after going black.
Here's the script that works for my main monitor (DP-1) but the second monitor (HDMI-A-2) goes black for 2 seconds then comes back on (also tried it without the killall -SIGUSR1 swayidle with the same result):
swayidle -w -d \
timeout 300 '~/.config/hypr/scripts/lock.sh' \
timeout 360 'hyprctl dispatch dpms off DP-1 && hyprctl dispatch dpms off HDMI-A-2 && sleep 1 && killall -SIGUSR1 swayidle' \
resume '
hyprctl monitors | grep HDMI
ret=$?
if [ $ret -eq 0 ]
then
hyprctl dispatch dpms on DP-1
else
hyprctl dispatch dpms off HDMI-A-2
fi
' \
before-sleep '~/.config/hypr/scripts/lock.sh' \
lock '~/.config/hypr/scripts/lock.sh'
I've also tried a number of suggestions from various Reddit threads and Github issues which everyone else said worked for them but of course failed for me. Such as:
There is one error in the output that appears when the second monitor turns itself back on automatically after the 2 seconds of idle: [main.c:626] Screencopy failed. I'm not sure what's causing it. BTW I ensured that the little eye icon, which indicates the idle inhibitor, on the top waybar is disabled (eye with a cross through it - the default)
If anyone has been able to successfully get swayidle working, please help me. This is so ridiculously annoying. There's no reason it shouldn't work. For some extra context, my main monitor is connected via Display Port and my secondary monitor via HDMI. That shouldn't be an issue though as one of the suggestions I tried was posted by someone with that exact same setup and it worked for him.
This is bugging me like crazy. I have tried about a hundred different ways of making my monitors turn off/idle but no matter what I do, the furthest I can get is successfully getting my main monitor to idle but my second monitor will instantly come back on 2 seconds after going black.
Here's the script that works for my main monitor (DP-1) but the second monitor (HDMI-A-2) goes black for 2 seconds then comes back on (also tried it without the
killall -SIGUSR1 swayidle
with the same result):I've also tried a number of suggestions from various Reddit threads and Github issues which everyone else said worked for them but of course failed for me. Such as:
There is one error in the output that appears when the second monitor turns itself back on automatically after the 2 seconds of idle:
[main.c:626] Screencopy failed
. I'm not sure what's causing it. BTW I ensured that the little eye icon, which indicates the idle inhibitor, on the top waybar is disabled (eye with a cross through it - the default)If anyone has been able to successfully get swayidle working, please help me. This is so ridiculously annoying. There's no reason it shouldn't work. For some extra context, my main monitor is connected via Display Port and my secondary monitor via HDMI. That shouldn't be an issue though as one of the suggestions I tried was posted by someone with that exact same setup and it worked for him.