简体   繁体   English

DPMS 待机定时器倒计时

[英]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.我希望能够使用 conky 显示一个计时器,显示在显示器进入待机状态之前剩余的时间。 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.例如,如果待机设置为 1200 秒(20 分钟),并且我希望 conky 显示“屏幕停用前 10 分钟”或类似内容。 Any idea where to retrieve the current time until standby?知道在哪里检索当前时间直到待机? Raspbian on an RPI4. RPI4 上的 Raspbian。

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.假设 X11,提供此信息的程序并不多,但xssstate -t (包suckless-tools )将显示屏幕保护程序启动前的剩余时间(以毫秒为单位)。 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 ).这不一定与 dpms 时间相同,但您始终可以将它们都设置为相同的值( 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).或者, xssstate -i显示当前空闲时间(以毫秒为单位),您可以自己计算剩余时间( xset q列出设置的 dpms 值)。

This command uses the XScreenSaverQueryInfo() function.此命令使用XScreenSaverQueryInfo() function。 I don't know if there is a more DPMS-specific one.我不知道是否有更特定于 DPMS 的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM