如何在 Ubuntu 20.04 中合上蓋子時關閉外部顯示器

如何在 Ubuntu 20.04 中合上蓋子時關閉外部顯示器

我相信有很多問題是反過來問的。然而,對我來說,在關閉筆記型電腦的蓋子時,外部顯示器仍在運行,當我關閉筆記型電腦的蓋子時,我希望它停止繼續運行。
Ubuntu 版本:20.04.1
我做了以下事情,但是它們似乎都不起作用:

  1. 編輯/etc/systemd/logind.conf為以下內容:
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
  1. lid-close-ac-action將dconf-editor 中的選項更改/org/gnome/settings-daemon/plugins/powersuspend

    編輯:
  2. lid-close-suspend-with-external-monitor將dconf-editor 中的選項更改為true.

答案1

您需要三種配置:

  • dconf-editor org.gnome.settings-daemon.plugins.power設定中lid-close-suspend-with-external-monitor啟用
  • 在文件中將/etc/UPower/UPower.conf參數更改IgnoreLidtrue(以 結尾IgnoreLid=true
  • /etc/systemd/logind.conf在你需要的文件中HandleLidSwitchDocked=suspend

答案2

我認為還有一個額外的設定。
根據您正在運行的內容,在命令列上嘗試:

gsettings set com.canonical.unity.settings-daemon.plugins.power lid-close-suspend-with-external-monitor true

或者

gsettings set org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor true

或兩者兼而有之,如果你不確定...

相關內容