1

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.

Bdgisme
  • 223
  • 1
  • 2
  • 5
  • Might be able to put together a little C prog to [get the idle time](https://web.archive.org/web/20140319091243/http://coderrr.wordpress.com/2008/04/20/getting-idle-time-in-unix/) and get the DPMS standby timeout value from [dpmsgettimeouts](https://linux.die.net/man/3/dpmsgettimeouts), subtract the idle time from the timeout to get the time-to-standby, and call the C prog in conky with `exec` to display the returned value. – David Yockey May 10 '20 at 00:37

1 Answers1

2

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.

meuh
  • 11,500
  • 2
  • 29
  • 45