一个命令行,用于保存和恢复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。在

待办事项:

TODO

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在Android Studio中使用while循环显示包含textview对象的数据   创建名为“userController”的bean时发生java错误:通过字段“userService”表示未满足的依赖关系   java PDFBox PDFImageWrite。writeImage未正确处理所有字符   java无法识别代码中的nzec错误   无法更改java TabLayout字体   在Java中使用子字符串删除部分字符串   Java中的listener addPropertyChangeListener方法   java可以同时拖动多个对象   java如何将数组中的值添加到向量中   java为什么在Camel 3.7.3中无法正确计算属性?   与后端问题不同的机器中的java客户端资源   带字符串的java分割字节数组?   java On_选项_项目_选择的方法说明   java如何在画布的父画中画一个圆?   连接超时和打开连接数的java Netty通道配置   java mysql中如何防止向数据库中插入重复数据   升级到macOS Big Sur后,java无法启动Neo4j控制台应用程序   在Java中使用XSLT将XML转换为HTMLString的ajax   java无法使用Apache POI获取Excel工作表中的数据