Bdgisme
Bdgisme

Reputation: 223

DPMS standby timer countdown

I'm hoping to be able to use conky to display a timer showing the amount of time remaining until the display goes to standby. For example, if standby is set to 1200 seconds (20 min) and I'd like conky to show "10 minutes until screen is deactivated" or something similar. Any idea where to retrieve the current time until standby? Raspbian on an RPI4.

Upvotes: 1

Views: 593

Answers (1)

meuh
meuh

Reputation: 12255

Assuming X11, there are not many programs that provide this info, but xssstate -t (package suckless-tools) will show the time left (in millisecs) until the screen-saver starts. This is not necessarily the same as the dpms time, but you could always set them both to the same value (xset s 300 dpms 300).

Alternatively, xssstate -i shows the current idle time (in millisecs), and you can calculate the time left yourself (xset q lists the set dpms values).

This command uses the XScreenSaverQueryInfo() function. I don't know if there is a more DPMS-specific one.

Upvotes: 2

Related Questions