Start split konsole windows

Hi community,

how can I start a console on the KDE desktop via a *.desktop icon that already contains horizontally split windows (see screenshot)? The lower window should already be logged into a remote server via ssh.

How can this be done?

Greetings

Bluelupo

1 Like

I have a similar setup for a monitoring dashboard, except mine has the bottom panel split into two vertical panels.

I am not sure if this is the best way to accomplish that, but that is how I do it.

First, create a bash script. I adapted mine to split into only 2 panels and have the bottom panel run an SSH command, as you want to.

#!/usr/bin/env bash
/usr/bin/konsole &
pid=$!

sleep 1

# split into two horizontal panels
qdbus6 org.kde.konsole-$pid /konsole/MainWindow_1 org.kde.KMainWindow.activateAction split-view-top-bottom

# run command on top panel
qdbus6 org.kde.konsole-$pid /Sessions/1 org.kde.konsole.Session.runCommand "cd $HOME/code"

# run command on bottom panel
qdbus6 org.kde.konsole-$pid /Sessions/2 org.kde.konsole.Session.runCommand "ssh tunnel"

Save it somewhere. I saved mine into ~/.local/bin/monitor.sh.

Second, make sure it is executable.

$ chmod u+x ~/.local/bin/monitor.sh

Every time you run this script, there will be a security notification. If anyone knows a better way to accomplish this without that notification, please share it with us.

Third, create a .desktop file.

[Desktop Entry]
Type=Application
Name=Monitoring
Icon=dashboard-show
Exec=/home/rodrigo/.local/bin/monitor.sh
Terminal=false
Categories=System;
Hidden=false

Make sure to replace the Exec path with the one in your system. Later you can use the Menu Editor app to customize the icon and any other parameter you want.

Finally, save it into your ~/.local/share/applications directory with a .desktop extension.

For example, save it as ~/.local/share/applications/monitoring.desktop

Hope it helps. =)

1 Like