I am trying to create a layout for Konsole much in the same way as what I have for Terminator:
A JSON file with the different splits and more importantly, the profiles and commands that are going to be used.
I have found some blog entries on how to do that using a bash script and bash script, with one invocation of Konsole per line, adding the commands and profiles as arguments; using the -e command and –profile options.
When you save a layout, however, it is saved in a JSON file. This, unfortunately, only saves the layout geometry. Any command or profile information is not saved.
What I would like to do is to be able to edit that JSON file in order to launch a Konsole session with the desired geometry, logged in to my remote machine and eventually launching an emacs-client (I have an emacs-server running on the remote host).
Is there any documentation somewhere? I have sought in a few forums, including Stackoverflow & friends and Reddit with no luck whatsover.
Any help wold be appreciated.
1 Like
Hi - I haven’t seen a documented solution of the type you’re describing. There was this blog post from @traceyc earlier this year : Konsole Layout Automation (part 1) - KDE Blogs
That mentioned a Part 2 to come that would go into how split panes could be manipulated similarly - so, on top of whatever folks here can find, it might be worth keeping an eye on that blog space for possible future posts (I follow blogs.kde.org and planet.kde.org in my RSS reader )
1 Like
I read that one.
But it’s rather the trivial solution and a tad crude. Not to mention that it does not address my main concern: Being able to specify command on each split in the same way Terminator does. Or a simple Tmux session, for that matter.
I would be willing to install Terminator, but I would rather not have too many GTK+ apps installed. I am using KDE Neon specifically to avoid having all the Gnome apps and libs that I don’t use (I’ve nothing against Gnome, I just want to avoid wasting disk space).
But thanks, in any case.
A heads up:
I found this in the manual, chapter 3 “Command Line options”
--tabs-from-file file
Create tabs as specified in the given tabs configuration file.
Note
The file has one tab per line in the following format:
Each line specifies a tab to open using up to 4 fields specifying how it is to open. Fields are delimited with ;; and a field name must have a : appended. Empty lines or lines with # at the beginning are ignored, so you can use line beginning with # to add comments.
title: a name for this tab, tab default if blank or not specified
workdir: working directory, ~ if blank or not specified
profile: a Konsole profile to use, the default if blank or not specified
command: a command to run
Each line should contain at least one of command or profile field.
Example: title: %n;; command: /usr/bin/top ;; profile: Shell
Even though it covers tabs, not layouts, and it (seems to) be a plain text file, I do think that the same syntax will work in a JSON file… or it could be used in combination with one. I mean something like specifying the layout in a JSON file and the tabs in a separate plain text one. As my intention is to use them in a .desktop file, it doesn´t make a difference how many arguments it requires.
I am taking a week free from work so that I am going to experiment.
IFF I can do something meaningful, I will create a short post explaining it.