在Gnome中的不同工作区中打开应用程序 [英] Open applications in different workspaces in Gnome

查看:153
本文介绍了在Gnome中的不同工作区中打开应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于我是一个懒惰的混蛋,我试图编写一个Bash脚本,该脚本可立即在不同桌面上打开一些日常应用程序.该脚本应在Gnome中工作. 到目前为止,我已经写过了:

Given I'm a lazy bastard, I tried to write a Bash script that opens at once some daily apps in different desktops. This script should work in Gnome. I've written that so far:

#!/bin/bash
firefox &
thunderbird &
/usr/bin/netbeans --locale en &
amsn &
gnome-terminal &
sleep 2
wmctrl -r firefox -t 0 && wmctrl -r netbeans -t 1 && wmctrl -r gnome-terminal -t 2 && wmctrl -r amsn -t 6 && wmctrl -r thunderbird -t 7

但是,它不起作用.我的应用已打开,但不会分配给我指定的桌面:(.

But, it doesn't work. My apps open, but they won't be assigned to the desktops I specify :(.

我将sleep的值更改为15. netbeans分配正确,其余的打开在我从...执行脚本的工作区中.

I changed the value of sleep to 15... only firefox & netbeans are assigned correctly, the rest opens in the workspace where I execute the script from...

推荐答案

感谢Akira的评论,我终于成功实现了它(脚本在启动时就像一个符咒一样运行),这里是新代码:

Thanks to Akira comment, I finally succeeded at making it work (the script runs at startup like a charm) Here is the new code:

#!/bin/bash
wmctrl -n 8

firefox &
thunderbird &
/usr/bin/netbeans --locale en &
amsn &
gnome-terminal &
sleep 15

wmctrl -r firefox -t 0
wmctrl -r netbeans -t 1 
wmctrl -r terminal -t 2 
wmctrl -r amsn -t 6 
wmctrl -r thunderbird -t 7

#focus on terminal
wmctrl -a terminal 

这篇关于在Gnome中的不同工作区中打开应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆