2

I have a script that opens Konsole sessions for me to work with, it looks like:

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

Now this works fine only that I end up with one window with 16 tabs and I want to have two windows with 8 tabs each (the first block in one window, I then start another Konsole session and I'd want the second block of 8 tabs to be opened in the new session). How do I get this achieved?

2

You can control konsole using dbus scripting:

You might use something like this:

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

You can also run commands and set title:

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.