我已经尝试过如下:
1. Turn off: export DISPLAY=:0.0 && xset dpms force off
2. Turn on: export DISPLAY=:0.0 && xset -dpms
哪个可行,但这是一个临时解决方案,目前还不能解决我的问题。当我重新启动系统时,它会一次又一次地启动相同的自动关闭模式。
我现在如何才能使用SSH远程将其永久关闭?
重要的:
- KIOSK (ATM machine will use this option)
- 24/7 advertising display/slides will use this
可选说明:本指南遵循http://v2kblog.blogspot.com/2008/08/disabling-monitor-power-saver.html,但永久解决方案无效。
#!/ bin / bash 导出DISPLAY =:0.0 如果[$#-eq 0]; 然后 回声用法:$(basename $ 0)“ on | off | status” 1号出口 是 如果[$ 1 =“ off”]; 然后 echo -en“关闭显示器...” xset dpms强制关闭 echo -en“完成。\ n检查:” xset -q | grep“监视器是” elif [$ 1 =“ on”]; 然后 echo -en“正在打开监视器...” xset dpms强制开启 echo -en“完成。\ n检查:” xset -q | grep“监视器是” elif [$ 1 =“ status”]; 然后 xset q | sed -n's / ^ [] * //监视器是p 别的 回声用法:$(basename $ 0)“ on | off | status” 是
将该脚本保存/usr/bin
为,命名为switch_dpms
,然后使用即可执行chmod 664 /usr/bin/switch_dpm
。
现在,您需要做的就是将其添加到cron作业中。因此,请使用以下命令打开您的crontab文件:
crontab -e
并将其添加到底部:
@reboot /usr/bin/switch_dpms off
每次重新启动它会变成dpms
对off
,你也可以把它on
做的命令行/usr/bin/switch_dpms on
或检查其状态/usr/bin/switch_dpms status
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句