一个命令行,用于保存和恢复X11桌面(如Gnome)的会话,并具有许多其他功能
xsession-manager的Python项目详细描述
xsession-manager
基于Python的命令行工具,用于保存和恢复X11桌面(如Gnome)的会话, 以及其他维护会话的功能。该项目目前处于早期开发阶段。在
这个项目最初是用Bash
编写的。但现在我在Python
中完全重写了它
这显然使它更加灵活、可扩展。在
此项目依赖于wmctrl,这就是为什么必须事先安装它。在
安装
安装依赖项
- 软呢帽33
dnf install python3-devel python3-tkinter wmctrl
通过PyPi
安装xsession-manager ^{pr2}$通过源代码安装xsession manager
cd the_root_of_source_code
python3 setup.py install
常见用法
- 将正在运行的windows另存为x会话
xsm -s
- 关闭正在运行的窗口,但有多个窗口的应用除外。最好让用户手动关闭,有些应用程序,比如JetBrain的IDEs可能有自己的会话。在
xsm -c
- 关闭运行的窗口包括那些具有多个窗口的应用程序。在
xsm -c -im
- 恢复保存的x会话
xsm -r
- 根据保存的x会话将正在运行的窗口移动到其工作区
xsm -ma
- 列出保存的x个会话
xsm -l
- 查看保存的x会话的详细信息
xsm -t xsession-default
用法:
usage: xsm [-h] [-s [SAVE]] [-c [CLOSE_ALL ...]] [-im] [-r [RESTORE]] [-ri RESTORING_INTERVAL] [-pr [PR]] [-l] [-t DETAIL]
[-x EXCLUDE [EXCLUDE ...]] [-i INCLUDE [INCLUDE ...]] [-ma [MOVE_AUTOMATICALLY]]
optional arguments:
-h, --help show this help message and exit
-s [SAVE], --save [SAVE]
Save the current session. Save to the default session if not specified a session name.
-c [CLOSE_ALL ...], --close-all [CLOSE_ALL ...]
Close the windows gracefully. Close all windows if only -c/--close-all is present. You can specify
arguments to tell me which windows should be closed, that is <window_id>, <pid>, <app_name> or
<title_name> exactly the same as -x.
-im, --including-apps-with-multiple-windows
Close the windows gracefully including apps with multiple windows
-r [RESTORE], --restore [RESTORE]
Restore a session gracefully. Restore the default session if not specified a session name.
-ri RESTORING_INTERVAL, --restoring-interval RESTORING_INTERVAL
Specify the interval between restoring applications, in seconds. The default is 2 seconds.
-pr [PR] Pop up a dialog to ask user whether to restore a X session.
-l, --list List the sessions.
-t DETAIL, --detail DETAIL
Check out the details of a session.
-x EXCLUDE [EXCLUDE ...], --exclude EXCLUDE [EXCLUDE ...]
Exclude apps from the operation according to <window_id>, <pid>, <app_name> or <title_name>. Require
at least one value
-i INCLUDE [INCLUDE ...], --include INCLUDE [INCLUDE ...]
Include apps from the operation according to <window_id>, <pid>, <app_name> or <title_name>. Require
at least one value
-ma [MOVE_AUTOMATICALLY], --move-automatically [MOVE_AUTOMATICALLY]
Auto move windows to specified workspaces according to a saved session. The default session is
`xsession-default`
如果您想在登录后自动恢复以前的X会话
这里有一个解决方案。如果您使用的是Fedora,请创建一个名为auto-restore-working-state.desktop
的文件,Exec
应该是:
xsm -pr
然后将此文件放入~/.config/autostart
。在
待办事项:
- 项目
标签: