【问题标题】:Openbox. Open different firefox profiles in specific workspaces开箱。在特定工作区中打开不同的 Firefox 配置文件
【发布时间】:2015-10-23 21:11:26
【问题描述】:

当我开始我的 openbox 会话时,我需要这样的东西:

firefox -p Profile 1 #Open in workspace 4
firefox -p profile 2 #Open in workspace 5

但我发现的所有解决方案都使用 Windows 名称 参数,而且效果不佳。 (我尝试修改我的 openbox 的 rc.xml 并使用 wmctrl 和其他几个解决方案,但都是徒劳的)

我的问题有直接的解决方案吗?谢谢!

【问题讨论】:

标签: linux firefox startup


【解决方案1】:

更新编辑的答案

这可能有点难看,但我试过了,它似乎工作...... 这有点复杂……或者你怎么看? 需要“睡眠”,因为它需要时间来启动搜索查询以便设置标题:)

1.搜索查询版本:

#!/bin/bash

firefox -P test1 --new-instance --search "profile1" &
firefox -P test2 --new-instance --search "profile2" &
sleep 3;

#profile1 to desktop 0
wmctrl -r "profile1" -t 0

#profile2 to desktop 1
 wmctrl -r "profile2" -t 1

2.使用xdotool:

#!/bin/bash

temp="";
pid="";

firefox -P test1 --new-instance &
firefox -P test2 --new-instance &
sleep 1;

#profile1 to desktop 0
pid=`ps aux | grep test1 | awk '{print $2}' | head -1`
temp=`xdotool search --all --pid $pid | tail -n -1`
xdotool set_desktop_for_window $temp 0

#profile2 to desktop 1
pid=`ps aux | grep test2 | awk '{print $2}' | head -1`
temp=`xdotool search --all --pid $pid | tail -n -1`
xdotool set_desktop_for_window $temp 1

【讨论】:

  • 我试过这种方式,但它不起作用。他们在同一个工作区中打开
  • 唯一可行的是,如果我等待几秒钟让 firefox 打开,然后更改工作区并打开不同的 firefox 配置文件
  • 我更新了。您如何看待这个解决方案?
  • 所以阅读你之前的评论,@rubensoleao,我有点明白我上面帖子中的解决方案是你已经尝试过的。我对吗? :)
  • 是的 :)。 t 我已经挖得更深了,这真的是唯一的方法!有一个名为 Devil's pie (burtonini.com/blog/computers/devilspie) 的窗口匹配实用程序,它可能有效,但对我来说太麻烦了。感谢您的帮助!
猜你喜欢
  • 2021-11-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-29
  • 1970-01-01
  • 2016-02-18
  • 2014-11-06
相关资源
最近更新 更多