2つの異なるウィンドウでKonsoleセッション(タブ)を開く

2つの異なるウィンドウでKonsoleセッション(タブ)を開く

私が使用するKonsoleセッションを開くスクリプトは次のとおりです。

konsole --profile $1 --new-tab -p tabtitle="k1" -e ./jpax_remote.sh cc1
konsole --profile $1 --new-tab -p tabtitle="k2" -e ./jpax_remote.sh cc2
konsole --profile $1 --new-tab -p tabtitle="k3" -e ./jpax_remote.sh cc3
konsole --profile $1 --new-tab -p tabtitle="k4" -e ./jpax_remote.sh cc4
konsole --profile $1 --new-tab -p tabtitle="k5" -e ./jpax_remote.sh cc5
konsole --profile $1 --new-tab -p tabtitle="k6" -e ./jpax_remote.sh cc6
konsole --profile $1 --new-tab -p tabtitle="k7" -e ./jpax_remote.sh cc7
konsole --profile $1 --new-tab -p tabtitle="k8" -e ./jpax_remote.sh cc8

konsole --profile $1 &
konsole --profile $1 --new-tab -p tabtitle="1s" -e ./jpax_remote.sh cc1 sh
konsole --profile $1 --new-tab -p tabtitle="2s" -e ./jpax_remote.sh cc2 sh
konsole --profile $1 --new-tab -p tabtitle="3s" -e ./jpax_remote.sh cc3 sh
konsole --profile $1 --new-tab -p tabtitle="4s" -e ./jpax_remote.sh cc4 sh
konsole --profile $1 --new-tab -p tabtitle="5s" -e ./jpax_remote.sh cc5 sh
konsole --profile $1 --new-tab -p tabtitle="6s" -e ./jpax_remote.sh cc6 sh
konsole --profile $1 --new-tab -p tabtitle="7s" -e ./jpax_remote.sh cc7 sh
konsole --profile $1 --new-tab -p tabtitle="8s" -e ./jpax_remote.sh cc8 sh

これで、これは16個のタブを持つ1つのウィンドウで終わり、それぞれ8個のタブを持つ2つのウィンドウが必要なことを除いてうまくいきます(1つのウィンドウの最初のブロック、次に別のKonsoleセッションを開始し、8つのタブの2つブロックが欲しい)))新しいセッションで開きます。これをどのように達成しますか?

ベストアンサー1

以下を使用して konsole を制御できます。dbusスクリプト:

次のものを使用できます。

konsole&sleep 0.1
qdbus org.kde.konsole-$! /Windows/1 newSession
konsole&sleep 0.1
qdbus org.kde.konsole-$! /Windows/1 newSession

コマンドを実行してタイトルを設定することもできます。

konsole&sleep 0.1
id=$(qdbus org.kde.konsole-$! /Windows/1 newSession)
qdbus org.kde.konsole-$! /Sessions/$id setTitle 1 title
qdbus org.kde.konsole-$! /Sessions/$id sendText ls$'\n'

おすすめ記事