Ventto / mons

POSIX Shell script to quickly manage monitors on X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running daemon causes only screen connected to desktop not wake up

breneser opened this issue · comments

Hi,

I am using Mons with i3 wm to manage multi-screen setups. I have a desktop pc with single screen and starting the daemon on X start using mons -m & in .xprofile.

Also setting dpms settings and disabling screen saver with following lines in .xinitrc

xset s off
xset dpms 300 600 1800

But when the screen goes into sleep mode I can not get it back up until I plug it out and re-plug again. How can i configure mons to resolve this issue ?

commented

@aconthea, thanks for the feedback.

Currently, there is no way to handle it.

mons based on xrandr's output, I need first to compare the output before and during the sleep mode. But I only see xrandr --auto (see below) that might block the screen or more precisely it might set the screen settings according to the current one (sleep mode) ad vitam aeternam every second.

This is the script part of the -m daemon mode option:

    if $mFlag ; then
        while true; do
            if [ "$("${XRANDR}" | grep ' connect' | wc -l)" -eq 1 ]; then
                "${XRANDR}" --auto
            fi
            sleep 1
        done
    fi

Adding extra parameters to xrandr --auto can do the job ?
I'm investigating.

@Ventto Thanks for clarifying.

I tried to run a quick test with xrandr --auto; Ran the following script as a foreground process and it doesn't cause any issues.

while true; do xrandr | grep ' connect' 2>&1 >> .log; date >> .log; xrandr --auto 2&>1 >> .log; sleep 2; done

Though when I run mons -m as foreground process the screen doesn't wake up.

Can you see any difference between ?

I am not sure if this helps, bu changing the sleep time to 2 seconds in mons solves the problem. But I am not really sure if screen ever goes to sleep, it keeps coming in about every 10 minutes displaying no signal. I think it just goes into stand by mode. This is quite confusing.

commented

Try until find an empiric value for sleep.

It might be interesting to verify the screen's status (c.f /sys/class/drm/*).
Does the sleep mode mean "connected but disabled output" ?

From xrandr's manpage:

--auto For connected but disabled outputs, this will enable them using 
their first preferred mode (or, something close  to 96dpi if they have 
no preferred mode). For disconnected but enabled outputs, this will 
disable them.
commented

I've re-produced your xset configuration with a VGA monitor.
Indeed, increasing the sleep time solved the problem.

Also, do not perform xrandr command every loop if the state is still the same (nothing happens), avoids to reduce the screen in speed and cause "no signal" message periodically.

After some research, the four DPMS modes are initially specified for CRTs but for LCDs and later there is often no difference between standby, suspend, and off.

Hey, sorry for late reply. I see you fixed the issue. Thanks a lot.