Linux 如何在xdg打开的情况下将应用程序推向前台
在linux上,xdg open可以启动应用程序,但在大多数情况下,理想的行为是仅在应用程序尚未运行时启动应用程序,并在应用程序已经运行时将其带到前端Linux 如何在xdg打开的情况下将应用程序推向前台,linux,ubuntu,Linux,Ubuntu,在linux上,xdg open可以启动应用程序,但在大多数情况下,理想的行为是仅在应用程序尚未运行时启动应用程序,并在应用程序已经运行时将其带到前端 xdg open可以这样做吗?是否有其他标准方法来提供此功能?正如您所看到的xdg open只是处理文件类型并在首选应用程序中打开它的包装器。如果应用程序支持或不支持“向前看”选项,则由应用程序决定 $ file /usr/bin/xdg-open /usr/bin/xdg-open: POSIX shell script, ASCII text
xdg open可以这样做吗?是否有其他标准方法来提供此功能?正如您所看到的
xdg open
只是处理文件类型并在首选应用程序中打开它的包装器。如果应用程序支持或不支持“向前看”选项,则由应用程序决定
$ file /usr/bin/xdg-open
/usr/bin/xdg-open: POSIX shell script, ASCII text executable
为了突出应用程序窗口,您可以使用其他工具,如wmctrl
、xdool
或qdbus
详情:
NAME
wmctrl - interact with a EWMH/NetWM compatible X Window Manager.
SYNOPSIS
wmctrl [ options | actions ]...
DESCRIPTION
wmctrl is a command that can be used to interact with an X Window man‐
ager that is compatible with the EWMH/NetWM specification. wmctrl can
query the window manager for information, and it can request that cer‐
tain window management actions be taken.
[...]
-a <WIN>
Switch to the desktop containing the window <WIN>, raise the
window, and give it focus.
NAME
xdotool - command-line X11 automation tool
SYNOPSIS
xdotool cmd args...
Notation: Some documentation uses [window] to denote an optional window
argument. This case means that the argument, if not present, will
default to "%1". See "WINDOW STACK" for what "%1" means.
DESCRIPTION
xdotool lets you programatically (or manually) simulate keyboard input
and mouse activity, move and resize windows, etc. It does this using
X11's XTEST extension and other Xlib functions.
There is some support for Extended Window Manager Hints (aka EWMH or
NetWM). See the "EXTENDED WINDOW MANAGER HINTS" section for more
information.
名称
wmctrl-与EWMH/NetWM兼容的X窗口管理器交互。
提要
wmctrl[选项|操作]。。。
描述
wmctrl是一个可用于与X窗口管理器交互的命令
与EWMH/NetWM规范兼容的AGR。wmctrl可以
查询窗口管理器以获取信息,它可以请求
t必须采取窗口管理措施。
[...]
-a
切换到包含该窗口的桌面,升起
窗口,并给它焦点。
名称
xdotool-命令行X11自动化工具
提要
xdotool cmd args。。。
注释:一些文档使用[window]表示可选窗口
论点这种情况意味着,如果论点不存在,将
默认设置为“%1”。有关“%1”的含义,请参见“窗口堆栈”。
描述
xdotool允许您通过编程(或手动)模拟键盘输入
和鼠标活动,移动和调整窗口大小等。它使用
X11的XTEST扩展和其他Xlib函数。
对扩展窗口管理器提示(也称为EWMH或
NetWM)。有关更多信息,请参阅“扩展窗口管理器提示”部分
信息。
好吧,你应该问这个问题,你可以在那里找到更好的答案。因为堆栈溢出是与编程相关的问题