用命令关闭Ubuntu的自动关闭屏幕和锁屏
有時候linux系統是沒有圖形化界面的,為了關閉鎖屏和息屏可以用如下命令
// 關閉息屏,最后0是代表關閉鎖屏,將0替換為60代表60s后自動息屏,以此類推。 gsettings set org.gnome.desktop.session idle-delay 0// 關閉鎖屏 gsettings set org.gnome.desktop.screensaver lock-enabled false翻譯取自這篇文章
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.
轉載于: https://blog.csdn.net/xiang_shao344/article/details/84557547
總結
以上是生活随笔為你收集整理的用命令关闭Ubuntu的自动关闭屏幕和锁屏的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python报错:ImportError
- 下一篇: JVM垃圾收集策略