如何从命令行在特定桌面上启动应用程序?


22

标题说明了一切。通常,我的Desktop 1上有一个控制台窗口。我希望能够从那里启动任何应用程序,指定应在哪个桌面上显示应用程序窗口。例如,从桌面1上的控制台窗口中启动。我想以thunderbird使其窗口在桌面2上打开的方式启动。(我正在运行kubuntu 9.04)


您是说您有两台显示器并要启动到第二台显示器,还是您有两个工作区(虚拟桌面)并想启动到另一台?
Dirk Hartzer Waldeck 2011年

我有一台显示器,我想在我的四个工作区(虚拟桌面)中的任何一个上启动
MarcoS 2011年

Answers:


13

这里有一些选择。

恶魔馅饼

这是一个旧教程

wmctrl

您可以制作脚本以移至所需的工作区,然后启动您的应用程序():

#!/bin/bash
wmctrl -s 1
firefox --new-tab $@ &

或者,您可以启动您的应用程序然后将其移动。我认为这样会起作用:

#!/bin/bash
thunderbird &
wmctrl -r :ACTIVE: -t 1
# if thunderbird takes a while to launch, you may need to find the window yourself:
#wmctrl -r `wmctrl -l | grep [t]hunderbird | cut -f1` -t 1

Compiz Place插件

如果安装compizconfig-settings-manager,则可以启用和配置此功能 安装compizconfig-settings-manager

允许您为带有特定标题的窗口设置固定位置。


仅供参考,以前我wmctrl在Gnome中使用过。在Unity 11.04中,某些功能对我不起作用,但在9.04中应该会很好。虽然不确定KDE。


-1

我现在正在使用xmonad:我可以使用键盘轻松地将窗口移动到任何屏幕/桌面。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.