欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu设置始终亮屏_ubuntu设置关闭屏幕和锁定

发布时间:2023/12/10 Ubuntu 48 豆豆
生活随笔 收集整理的这篇文章主要介绍了 ubuntu设置始终亮屏_ubuntu设置关闭屏幕和锁定 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

见链接:http://askubuntu.com/questions/177348/how-do-i-disable-the-screensaver-lock

If you want to wrap your app in a script that takes care of this for you when you launch it (or GUI simply isn't an option), the best command-line solution as of Ubuntu 14.04 is:

To disable the screen blackout:

gsettings set org.gnome.desktop.session idle-delay  (0 to disable)

To disable the screen lock:

gsettings set org.gnome.desktop.screensaver lock-enabled false

You probably want to add their inverses at the end of the wrapper script to return your system to normal behavior on exit. In such a case, you want to prevent against ungraceful termination (i.e. interrupt, or SIGTERM during system shutdown), so create a function to restore normal behavior and use trap 0 (for bash-type shells) to catch exits and apply the restoration functions.

总结

以上是生活随笔为你收集整理的ubuntu设置始终亮屏_ubuntu设置关闭屏幕和锁定的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。