如何让 GNOME 3 使用挂起混合?

Mar*_*lze 6 linux gnome hibernate suspend gnome3

如何让 GNOME 3 使用,pm-suspend-hybrid而不是pm-suspend在关闭盖子或从菜单中使用挂起时?

小智 2

确保它有效

首先,您需要确保pm-suspend-hybrid可以在您的计算机上运行。类型

sudo pm-suspend-hybrid
Run Code Online (Sandbox Code Playgroud)

在控制台中并注意它是否按预期工作。

黑客攻击

这与其说是一种解决方案,不如说是一种黑客手段。但这对我有用。

在控制台中执行以下命令:

ls -l /usr/sbin/pm-suspend  # it should be symlink to /usr/lib/pm-utils/bin/pm-action
sudo rm /usr/sbin/pm-suspend  # just remove this link
sudo editor /usr/sbin/pm-suspend  # create new file instead of symlink
Run Code Online (Sandbox Code Playgroud)

pm-suspend脚本的内容:

#!/bin/bash
pm-suspend-hybrid
# notice that you need to execute "pm-suspend-hybrid"
# just changing symlink is not enough
Run Code Online (Sandbox Code Playgroud)

然后赋予这个新脚本执行权:

sudo chmod +x /usr/sbin/pm-suspend
Run Code Online (Sandbox Code Playgroud)

享受!


笔记

  • 如果您的发行版不使用sudo命令,您需要成为 root 才能执行这些命令。
  • 它可能pm-suspend位于系统上的另一个路径。只需键入whereis pm-suspend即可找到正确的路径。
  • editor如果您愿意或者您的发行版没有此包装器,您可以使用您选择的任何文本编辑器。