码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu设置关闭屏幕和锁定

时间:2016-07-20 09:04:57      阅读:1163      评论:0      收藏:0      [点我收藏+]

标签:

见链接: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 <seconds> (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 <function> 0 (for bash-type shells) to catch exits and apply the restoration functions.

ubuntu设置关闭屏幕和锁定

标签:

原文地址:http://www.cnblogs.com/wangzhigang/p/5686990.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!