i3窗口管理器的运行或提升应用程序启动程序。
raiseorlaunch的Python项目详细描述
raiseorlaunch
为i3 window manager运行或引发应用程序启动程序。
功能
- 如果提供的应用程序正在运行,请将其焦点放在窗口上,否则 运行它
- 为要比较的窗口类、实例和/或标题提供正则表达式 在运行Windows时
- 可选地启用不区分大小写的比较
- (可选)提供用于启动和运行的工作区
- (可选)提供运行应用程序的初始工作区
- (可选)使用草稿行启动和运行
- (可选)提供提升和运行的图标
- 工作区自动后退和前进(如果启用)保持功能性
- 可选地在匹配的窗口中循环(这将中断 如果多个窗口匹配,则工作区自动返回 给定的属性)
- 可选择在目标工作区全屏显示
- 创建的窗口将始终移动到预期的工作区。这个
修复未实现的应用程序的行为
启动通知。默认情况下,这适用于创建的Windows
在2秒内。超时可配置为
-l/--event-time-limit
安装
存储库
raiseorlaunch在PyPI, 这样你就可以
pip install raiseorlaunch
对于Arch Linux用户,也可以在 AUR。
手动
依赖关系
- Python3或Python3
- i3ipc-python
安装
直接用setup.py安装它会创建一个脚本入口点 这增加了大约150毫秒的延迟。这是不能接受的 申请。
如果先创建一个轮子,然后安装 (需要wheel和 pip):
python setup.py bdist_wheel pip install ./dist/raiseorlaunch-${VERSION}-py3-none-any.whl
不安装运行
您也可以在不安装raiseorlaunch的情况下运行它:
python -m raiseorlaunch ${ARGUMENTS}
或:
./raiseorlaunch/__main__.py ${ARGUMENTS}
用法和选项
usage: raiseorlaunch [-h] [-c WM_CLASS] [-s WM_INSTANCE] [-t WM_TITLE]
[-e COMMAND] [-w WORKSPACE | -W TARGET_WORKSPACE | -r]
[-m CON_MARK] [-l EVENT_TIME_LIMIT] [-i] [-C] [-f] [-d]
[-v]
A run-or-raise-application-launcher for i3 window manager.
optional arguments:
-h, --help show this help message and exit
-c WM_CLASS, --class WM_CLASS
the window class regex
-s WM_INSTANCE, --instance WM_INSTANCE
the window instance regex
-t WM_TITLE, --title WM_TITLE
the window title regex
-e COMMAND, --exec COMMAND
command to run with exec. If omitted, -c, -s or -t
will be used (lower-case). Careful: The command will
not be checked prior to execution!
-w WORKSPACE, --workspace WORKSPACE
workspace to use
-W TARGET_WORKSPACE, --target-workspace TARGET_WORKSPACE, --init-workspace TARGET_WORKSPACE
target workspace
-r, --scratch use scratchpad
-m CON_MARK, --mark CON_MARK
con_mark to use when raising and set when launching
-l EVENT_TIME_LIMIT, --event-time-limit EVENT_TIME_LIMIT
Time limit in seconds to listen to window events after
exec. Defaults to 2
-i, --ignore-case ignore case when comparing
-C, --cycle cycle through matching windows (this will break
workspace_back_and_forth if more than one window
matches the given properties)
-f, --leave-fullscreen
Leave fullscreen on target workspace
-d, --debug display debug messages
-v, --version show program's version number and exit
示例
cli
运行或提升Firefox:
raiseorlaunch -c Firefox -s Navigator
使用工作区SL
来显示崇高的文本:
raiseorlaunch -w SL -c "^Sublime" -s sublime_text -e subl
提高或启动SpeedCrunch并使用草稿行:
raiseorlaunch -r -c SpeedCrunch
使用脚本启动应用程序:
raiseorlaunch -r -c SpeedCrunch -e "--no-startup-id /path/to/my-cool-script.sh"
用图标wiki
升起车窗。如果找不到,
执行命令并标记与提供的
财产。将等待新窗口的时间限制设置为3秒:
raiseorlaunch -c Firefox -s Navigator -e "firefox --new-window https://wiki.archlinux.org/" -m wiki -l 3
I3 bindsym
在i3配置中,您可以定义这样的bindsym:
bindsym ${KEYS} exec --no-startup-id raiseorlaunch ${ARGUMENTS}
例如
bindsym $mod+s exec --no-startup-id raiseorlaunch -w SL -c "^Sublime" -s sublime_text -e subl
用于绑定$mod+s
以提升或启动升华文本。
引号
调用exec
时不会引用该命令。制造
一定要正确地转义所有需要的引号。对于简单命令
没必要做任何事。
已知问题
键绑定在激发时会窃取焦点。这可能会对 监听和隐藏焦点事件的应用程序。这是因为 how X works。
示例:
当使用启用“隐藏在失去焦点”的Guake终端时, raiseorlaunch的行为就像底层窗口被聚焦一样。