在Ubuntu系统上,gnome在启动后恢复以前的应用程序状态

分享于 

4分钟阅读

ubuntu

  繁體 雙語

问题:

以前我使用过 sudo shutdown -h now 为了关闭 macOS。在启动之后,系统将在关闭前将所有应用程序(。像 Chrome,vs 代码,pdf ) 恢复到以前的状态。

现在我使用了同样的命令 sudo shutdown -h now 为了关闭 Ubuntu,但在启动电源时,系统开始一个绝对新的状态,而不需要恢复应用程序。

macOS 使用的功能是什么? 我可以在Ubuntu上使用它?


回答 1:

它被称为会话管理"

我可以把它放在ubuntu上?

不在默认桌面中

但是你可以使用窗口会话管理器或者 Gnome窗口会话管理器扩展插件this用于 Gnome。 你将在 Gnome shell 顶部栏上获得一个指示符,你可以在其中保存和恢复会话。 从 2nd 链接( 1st 有类似的设置) 安装:

设置

  • 确保已经安装 nodejs ( 比如。 执行 node -v,如果没有输出安装它)。
  • 通过npm安装 lwsm: npm install -g linux-window-session-manager ( 在某些系统上,你可能需要使用 sudo )
  • 下载或者克隆存储库并将所有文件移动到 /home/your-user-name/.local/share/gnome-shell/extensions/lwsm@johannes.super-productivity.com

  • 有时,特别是在使用nvm时,你可能需要通过 gnome-shell-extension-prefs 配置lwsm安装( 你可以在成功安装后通过哪个lwsm找到) 扩展的路径。

安装完成后安装:


cd tmp


git clone git@github.com:johannesjo/gnome-shell-extension-window-session-manager.git


mv gnome-shell-extension-window-session-manager ~/.local/share/gnome-shell/extensions/lwsm@johannes.super-pro




回答 2:

anycase不关闭,请查看以下命令:

pm操作- 暂停或者休眠你的计算机


pm-hibernate [--help]


pm-suspend [--quirk-*] [--help]


pm-suspend-hybrid [--quirk-*] [--help]



从手册页:


These commands can be used to put the machine in a sleep state. The precise way how this


 is done can be influenced by installing executables and configuration snippets. For some


 options external programs are needed.



 These commands will usually be called by UPower or hald when triggered to do so by a


 program in a desktop session such as gnome-power-manager. Calling them from the command


 line is also possible, but it is not guaranteed that all programs in your desktop session


 keep working as expected.



 pm-suspend


 During suspend most devices are shutdown, and system state is saved in RAM. The system


 still requires power in this state. Most modern systems require 3 to 5 seconds to


 enter and leave suspend, and most laptops can stay in suspend mode for 1 to 3 days


 before exhausting their battery.



 pm-hibernate


 During hibernate the system is fully powered off, and system state is saved to disk.


 The system does not require power, and can stay in hibernate mode indefinitely. Most


 modern systems require 15 to 45 seconds to enter and leave hibernate, and entering and


 leaving hibernate takes longer when you have more memory.



 pm-suspend-hybrid


 Hybrid-suspend is the process where the system does everything it needs to hibernate,


 but suspends instead of shutting down. This means that your computer can wake up


 quicker than for normal hibernation if you do not run out of power, and you can resume


 even if you run out of power. s2both(8) is an hybrid-suspend implementation.





STA  SYS  系统  PRE  STAT  POW  
相关文章