一个命令行,用于保存和恢复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第三方库


热门话题
我可以用C++代码使用java代码吗?   java使用JSR303在派生类中提供更具体的约束   java在这个查找唯一路径数算法中我做错了什么?   java如何为2个不同的服务提供商使用2个不同的SSL证书?   java在Gridview上绘制文本   java使用连接for循环构建字符串名   java StringBuilder拆分无法处理某些文件   java事件关注EditText   Java Web Start“找不到URL的缓存资源”   java程序从命令行运行的速度比在Eclipse中慢   java为什么HttpServletRequest会截断#字符上的url输入?   java自定义折叠工具栏平滑标题大小调整   使用Mockito对安卓 java中调用另一个静态函数的函数进行单元测试   http在java客户机中使用cachecontrol头   java如何使用。是否使用Delimiter从输入文件中排除标点符号和数字?   使用上下文作为参数/参数的java   java更有效地从Jar中提取文件   java为多个JButton提供相同的actionListener