登录时在 gnome-terminal 中启动 tmuxinator 会话

登录时在 gnome-terminal 中启动 tmuxinator 会话

我想在登录时启动 tmuxinator 会话(Ubuntu Lucid 上的 Gnome)。我尝试了以下变体,但它们都执行并关闭终端窗口。以下内容已提供给“启动应用程序”

sleep 10; /usr/bin/gnome-terminal --execute bash -c 'cd /src/thinit;exec bundle exec mux start thinit'
sleep 10; /usr/bin/gnome-terminal --execute bash -c 'cd /src/thinit;bundle exec mux start thinit'
sleep 10; /usr/bin/gnome-terminal --execute bash -c 'cd /src/thinit;exec bundle exec mux start thinit;exec bash'

更新:

这不是一个答案,但正在接近答案。参见山顶约德尔人发布关于13u11fr09的建议的解决方案。这个问题没有得到回答的原因是,据我所知,它会打开另一个 shell 会话,而不是保持初始 shell 会话打开。在描述的用例中,这很好 - 显示帮助,然后提供 shell 提示。而这里的要求是通过启动的初始 shell 会话继续使用 tmux。

答案1

我对 tmuxinator 一无所知,所以如果说错了请原谅

你的“启动应用程序”只是一个 .desktop,通常存储在 ~/config/autostart/

您可能想尝试简化 Exec=,有多种方法

可以在 .desktop 的新行上设置启动延迟,例如。

X-GNOME-Autostart-Delay=10

另外,你可以在终端中使用以下行运行命令

Terminal=true

可能还有用的做法是考虑通过脚本运行实际命令,然后将 Exec= 行设置为

Exec=/path/to/scriptname

如果你的脚本运行良好,那么它应该在启动时正常工作

答案2

您有太多的execs,而且我不确定 bundle 和 thinit 应该是什么,但是请尝试这个:

sleep 10; /usr/bin/gnome-terminal --working-directory=/src/thinit --execute bundle exec tmux

如果您尝试首先启动 tmux 服务器,则应该执行以下操作:

sleep 10; /usr/bin/gnome-terminal --working-directory=/src/thinit --execute /bin/bash -c "tmux start; exec bundle exec tmux"

相关内容