Bug 455143 - Feature Request: Expanded JSON Layout Configuration
Summary: Feature Request: Expanded JSON Layout Configuration
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: split-view (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-10 23:17 UTC by shellsmoke
Modified: 2024-07-08 17:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Konsole Session Generated example JSON (49.85 KB, image/png)
2022-06-10 23:17 UTC, shellsmoke
Details
attachment-32408-0.html (8.24 KB, text/html)
2022-06-12 17:38 UTC, tcanabrava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shellsmoke 2022-06-10 23:17:04 UTC
Created attachment 149605 [details]
Konsole Session Generated example JSON

It appears that currently, Konsole only supports the number and orientation of window splits in a JSON file format with the --layout commandline option. While most of the features requested below can be controlled for automation purposes with dbus, using dbus commands requires a steeper learning curve for the end user, creates issues with portability between systems, and can cause issues with script readability (one user writes a bash script one way, while other people might write it another). There are additional security concerns with the runCommand and sendText dbus methods, though Konsole already supports executing commands in a new session with the '-e' option. These issues can be alleviated by exposing more of Konsole's configuration and commandline options via JSON.

My suggestion/feature request is to expand the JSON configuration to encompass the following:
Publicly exposed DBus methods and properties for the 'org.kde.konsole' endpoint:
- org.kde.konsole.Session.setTitle
- org.kde.konsole.Session.setTabTitleFormat
- - There are two Title and TabTitleFormat properties controlled by the above two methods. I've accounted for this in my example below
- org.kde.konsole.Session.setProfile
- org.kde.konsole.Session.sendText
- org.kde.konsole.Session.runCommand
Split pane sizing with either "HEIGHTxWIDTH" or separate HEIGHT and WIDTH properties.
Window configurations such as window size and view-enabled plugins.

The JSON formatting should be easy and simple to read and configure, and KDE Konsole documentation should be updated to include its usage. To assist in ease of formatting and standardization, I propose having all splits be separated by their left-right (horizontal) top-bottom (vertical) orientation (current behavior) to include the first split (Konsole Session 1. Not current behavior, as there is just a first '"Orientation": "Horizontal"' for the beginning of the first split). Additionally, all Konsole window settings, such as Window size, should be declared at the top of the JSON config file.

An example of what this JSON configuration file might look like is below:

{
	"WindowSize" : "Maximized",
	"Plugins": ["SSHManager", "Plugin2"],
	"Splits": [  
		{ 
			# First Split on far left
			# session 1
			"Orientation": "Horizontal",  
			"SessionRestoreId": 0,
			"TabTitleLocal": "Local Tab Title"
		},  
		{  
			# Second split to right
			"Orientation": "Vertical",  
			"Widgets": [  
				{  
					# Top
					# session 2
					"SessionRestoreId": 0,
					"TabTitleFormatLocal": "%d : %n"
				},  
				{ 
					# Bottom
					# session 3
					"SessionRestoreId": 0,
					"TabTitleFormatRemote": "%U%H"
				}  
			]  
		},  
		{  
			# Third split to right
			# session 4
			"SessionRestoreId": 0, 
			"TabTitleRemote": "Remote Tab Title",
			"Profile": "KonsoleProfile1"
		},  
		{  
			# Fourth Split to far right
			"Orientation": "Vertical",  
			"Widgets": [  
				{  
					# top
					# session 5
					"SessionRestoreId": 0,
					"SendText": "# echo send text"
				},  
				{  
					# middle
					# session 6
					"SessionRestoreId": 0,
					"RunCommand": "echo run command"
				},  
				{  
					# bottom
					# session 7
					"SessionRestoreId": 0,
					"PaneSize": "64x30"
				}  
			]  
		}  
	]  
}
A Screenshot of the resulting Konsole window from the example configuration I'm suggesting would look like the attached screenshot
Comment 1 tcanabrava 2022-06-12 17:38:13 UTC
Created attachment 149645 [details]
attachment-32408-0.html

This is a really nice idea. I’ll implement this week, thanks for the heads
up.

On Sat, 11 Jun 2022 at 01:17 shellsmoke <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=455143
>
>             Bug ID: 455143
>            Summary: Feature Request: Expanded JSON Layout Configuration
>            Product: konsole
>            Version: unspecified
>           Platform: Other
>                 OS: Linux
>             Status: REPORTED
>           Severity: wishlist
>           Priority: NOR
>          Component: split-view
>           Assignee: konsole-devel@kde.org
>           Reporter: smokeintheshell@gmail.com
>   Target Milestone: ---
>
> Created attachment 149605 [details]
>   --> https://bugs.kde.org/attachment.cgi?id=149605&action=edit
> Konsole Session Generated example JSON
>
> It appears that currently, Konsole only supports the number and
> orientation of
> window splits in a JSON file format with the --layout commandline option.
> While
> most of the features requested below can be controlled for automation
> purposes
> with dbus, using dbus commands requires a steeper learning curve for the
> end
> user, creates issues with portability between systems, and can cause issues
> with script readability (one user writes a bash script one way, while other
> people might write it another). There are additional security concerns
> with the
> runCommand and sendText dbus methods, though Konsole already supports
> executing
> commands in a new session with the '-e' option. These issues can be
> alleviated
> by exposing more of Konsole's configuration and commandline options via
> JSON.
>
> My suggestion/feature request is to expand the JSON configuration to
> encompass
> the following:
> Publicly exposed DBus methods and properties for the 'org.kde.konsole'
> endpoint:
> - org.kde.konsole.Session.setTitle
> - org.kde.konsole.Session.setTabTitleFormat
> - - There are two Title and TabTitleFormat properties controlled by the
> above
> two methods. I've accounted for this in my example below
> - org.kde.konsole.Session.setProfile
> - org.kde.konsole.Session.sendText
> - org.kde.konsole.Session.runCommand
> Split pane sizing with either "HEIGHTxWIDTH" or separate HEIGHT and WIDTH
> properties.
> Window configurations such as window size and view-enabled plugins.
>
> The JSON formatting should be easy and simple to read and configure, and
> KDE
> Konsole documentation should be updated to include its usage. To assist in
> ease
> of formatting and standardization, I propose having all splits be
> separated by
> their left-right (horizontal) top-bottom (vertical) orientation (current
> behavior) to include the first split (Konsole Session 1. Not current
> behavior,
> as there is just a first '"Orientation": "Horizontal"' for the beginning
> of the
> first split). Additionally, all Konsole window settings, such as Window
> size,
> should be declared at the top of the JSON config file.
>
> An example of what this JSON configuration file might look like is below:
>
> {
>         "WindowSize" : "Maximized",
>         "Plugins": ["SSHManager", "Plugin2"],
>         "Splits": [
>                 {
>                         # First Split on far left
>                         # session 1
>                         "Orientation": "Horizontal",
>                         "SessionRestoreId": 0,
>                         "TabTitleLocal": "Local Tab Title"
>                 },
>                 {
>                         # Second split to right
>                         "Orientation": "Vertical",
>                         "Widgets": [
>                                 {
>                                         # Top
>                                         # session 2
>                                         "SessionRestoreId": 0,
>                                         "TabTitleFormatLocal": "%d : %n"
>                                 },
>                                 {
>                                         # Bottom
>                                         # session 3
>                                         "SessionRestoreId": 0,
>                                         "TabTitleFormatRemote": "%U%H"
>                                 }
>                         ]
>                 },
>                 {
>                         # Third split to right
>                         # session 4
>                         "SessionRestoreId": 0,
>                         "TabTitleRemote": "Remote Tab Title",
>                         "Profile": "KonsoleProfile1"
>                 },
>                 {
>                         # Fourth Split to far right
>                         "Orientation": "Vertical",
>                         "Widgets": [
>                                 {
>                                         # top
>                                         # session 5
>                                         "SessionRestoreId": 0,
>                                         "SendText": "# echo send text"
>                                 },
>                                 {
>                                         # middle
>                                         # session 6
>                                         "SessionRestoreId": 0,
>                                         "RunCommand": "echo run command"
>                                 },
>                                 {
>                                         # bottom
>                                         # session 7
>                                         "SessionRestoreId": 0,
>                                         "PaneSize": "64x30"
>                                 }
>                         ]
>                 }
>         ]
> }
> A Screenshot of the resulting Konsole window from the example
> configuration I'm
> suggesting would look like the attached screenshot
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Comment 2 shellsmoke 2022-07-15 16:52:18 UTC
(In reply to tcanabrava from comment #1)
> Created attachment 149645 [details]
> attachment-32408-0.html
> 
> This is a really nice idea. I’ll implement this week, thanks for the heads
> up.
> 
> On Sat, 11 Jun 2022 at 01:17 shellsmoke <bugzilla_noreply@kde.org> wrote:
> 
> > https://bugs.kde.org/show_bug.cgi?id=455143
> >
> >             Bug ID: 455143
> >            Summary: Feature Request: Expanded JSON Layout Configuration
> >            Product: konsole
> >            Version: unspecified
> >           Platform: Other
> >                 OS: Linux
> >             Status: REPORTED
> >           Severity: wishlist
> >           Priority: NOR
> >          Component: split-view
> >           Assignee: konsole-devel@kde.org
> >           Reporter: smokeintheshell@gmail.com
> >   Target Milestone: ---
> >
> > Created attachment 149605 [details]
> >   --> https://bugs.kde.org/attachment.cgi?id=149605&action=edit
> > Konsole Session Generated example JSON
> >
> > It appears that currently, Konsole only supports the number and
> > orientation of
> > window splits in a JSON file format with the --layout commandline option.
> > While
> > most of the features requested below can be controlled for automation
> > purposes
> > with dbus, using dbus commands requires a steeper learning curve for the
> > end
> > user, creates issues with portability between systems, and can cause issues
> > with script readability (one user writes a bash script one way, while other
> > people might write it another). There are additional security concerns
> > with the
> > runCommand and sendText dbus methods, though Konsole already supports
> > executing
> > commands in a new session with the '-e' option. These issues can be
> > alleviated
> > by exposing more of Konsole's configuration and commandline options via
> > JSON.
> >
> > My suggestion/feature request is to expand the JSON configuration to
> > encompass
> > the following:
> > Publicly exposed DBus methods and properties for the 'org.kde.konsole'
> > endpoint:
> > - org.kde.konsole.Session.setTitle
> > - org.kde.konsole.Session.setTabTitleFormat
> > - - There are two Title and TabTitleFormat properties controlled by the
> > above
> > two methods. I've accounted for this in my example below
> > - org.kde.konsole.Session.setProfile
> > - org.kde.konsole.Session.sendText
> > - org.kde.konsole.Session.runCommand
> > Split pane sizing with either "HEIGHTxWIDTH" or separate HEIGHT and WIDTH
> > properties.
> > Window configurations such as window size and view-enabled plugins.
> >
> > The JSON formatting should be easy and simple to read and configure, and
> > KDE
> > Konsole documentation should be updated to include its usage. To assist in
> > ease
> > of formatting and standardization, I propose having all splits be
> > separated by
> > their left-right (horizontal) top-bottom (vertical) orientation (current
> > behavior) to include the first split (Konsole Session 1. Not current
> > behavior,
> > as there is just a first '"Orientation": "Horizontal"' for the beginning
> > of the
> > first split). Additionally, all Konsole window settings, such as Window
> > size,
> > should be declared at the top of the JSON config file.
> >
> > An example of what this JSON configuration file might look like is below:
> >
> > {
> >         "WindowSize" : "Maximized",
> >         "Plugins": ["SSHManager", "Plugin2"],
> >         "Splits": [
> >                 {
> >                         # First Split on far left
> >                         # session 1
> >                         "Orientation": "Horizontal",
> >                         "SessionRestoreId": 0,
> >                         "TabTitleLocal": "Local Tab Title"
> >                 },
> >                 {
> >                         # Second split to right
> >                         "Orientation": "Vertical",
> >                         "Widgets": [
> >                                 {
> >                                         # Top
> >                                         # session 2
> >                                         "SessionRestoreId": 0,
> >                                         "TabTitleFormatLocal": "%d : %n"
> >                                 },
> >                                 {
> >                                         # Bottom
> >                                         # session 3
> >                                         "SessionRestoreId": 0,
> >                                         "TabTitleFormatRemote": "%U%H"
> >                                 }
> >                         ]
> >                 },
> >                 {
> >                         # Third split to right
> >                         # session 4
> >                         "SessionRestoreId": 0,
> >                         "TabTitleRemote": "Remote Tab Title",
> >                         "Profile": "KonsoleProfile1"
> >                 },
> >                 {
> >                         # Fourth Split to far right
> >                         "Orientation": "Vertical",
> >                         "Widgets": [
> >                                 {
> >                                         # top
> >                                         # session 5
> >                                         "SessionRestoreId": 0,
> >                                         "SendText": "# echo send text"
> >                                 },
> >                                 {
> >                                         # middle
> >                                         # session 6
> >                                         "SessionRestoreId": 0,
> >                                         "RunCommand": "echo run command"
> >                                 },
> >                                 {
> >                                         # bottom
> >                                         # session 7
> >                                         "SessionRestoreId": 0,
> >                                         "PaneSize": "64x30"
> >                                 }
> >                         ]
> >                 }
> >         ]
> > }
> > A Screenshot of the resulting Konsole window from the example
> > configuration I'm
> > suggesting would look like the attached screenshot
> >
> > --
> > You are receiving this mail because:
> > You are the assignee for the bug.
(In reply to shellsmoke from comment #0)
> Created attachment 149605 [details]
> Konsole Session Generated example JSON
> 
> It appears that currently, Konsole only supports the number and orientation
> of window splits in a JSON file format with the --layout commandline option.
> While most of the features requested below can be controlled for automation
> purposes with dbus, using dbus commands requires a steeper learning curve
> for the end user, creates issues with portability between systems, and can
> cause issues with script readability (one user writes a bash script one way,
> while other people might write it another). There are additional security
> concerns with the runCommand and sendText dbus methods, though Konsole
> already supports executing commands in a new session with the '-e' option.
> These issues can be alleviated by exposing more of Konsole's configuration
> and commandline options via JSON.
> 
> My suggestion/feature request is to expand the JSON configuration to
> encompass the following:
> Publicly exposed DBus methods and properties for the 'org.kde.konsole'
> endpoint:
> - org.kde.konsole.Session.setTitle
> - org.kde.konsole.Session.setTabTitleFormat
> - - There are two Title and TabTitleFormat properties controlled by the
> above two methods. I've accounted for this in my example below
> - org.kde.konsole.Session.setProfile
> - org.kde.konsole.Session.sendText
> - org.kde.konsole.Session.runCommand
> Split pane sizing with either "HEIGHTxWIDTH" or separate HEIGHT and WIDTH
> properties.
> Window configurations such as window size and view-enabled plugins.
> 
> The JSON formatting should be easy and simple to read and configure, and KDE
> Konsole documentation should be updated to include its usage. To assist in
> ease of formatting and standardization, I propose having all splits be
> separated by their left-right (horizontal) top-bottom (vertical) orientation
> (current behavior) to include the first split (Konsole Session 1. Not
> current behavior, as there is just a first '"Orientation": "Horizontal"' for
> the beginning of the first split). Additionally, all Konsole window
> settings, such as Window size, should be declared at the top of the JSON
> config file.
> 
> An example of what this JSON configuration file might look like is below:
> 
> {
> 	"WindowSize" : "Maximized",
> 	"Plugins": ["SSHManager", "Plugin2"],
> 	"Splits": [  
> 		{ 
> 			# First Split on far left
> 			# session 1
> 			"Orientation": "Horizontal",  
> 			"SessionRestoreId": 0,
> 			"TabTitleLocal": "Local Tab Title"
> 		},  
> 		{  
> 			# Second split to right
> 			"Orientation": "Vertical",  
> 			"Widgets": [  
> 				{  
> 					# Top
> 					# session 2
> 					"SessionRestoreId": 0,
> 					"TabTitleFormatLocal": "%d : %n"
> 				},  
> 				{ 
> 					# Bottom
> 					# session 3
> 					"SessionRestoreId": 0,
> 					"TabTitleFormatRemote": "%U%H"
> 				}  
> 			]  
> 		},  
> 		{  
> 			# Third split to right
> 			# session 4
> 			"SessionRestoreId": 0, 
> 			"TabTitleRemote": "Remote Tab Title",
> 			"Profile": "KonsoleProfile1"
> 		},  
> 		{  
> 			# Fourth Split to far right
> 			"Orientation": "Vertical",  
> 			"Widgets": [  
> 				{  
> 					# top
> 					# session 5
> 					"SessionRestoreId": 0,
> 					"SendText": "# echo send text"
> 				},  
> 				{  
> 					# middle
> 					# session 6
> 					"SessionRestoreId": 0,
> 					"RunCommand": "echo run command"
> 				},  
> 				{  
> 					# bottom
> 					# session 7
> 					"SessionRestoreId": 0,
> 					"PaneSize": "64x30"
> 				}  
> 			]  
> 		}  
> 	]  
> }
> A Screenshot of the resulting Konsole window from the example configuration
> I'm suggesting would look like the attached screenshot


Awesome, I would be happy to help in testing test once implemented.
Comment 3 TraceyC 2024-07-08 17:51:13 UTC
I've seen various people online wish for "iTerm2 on Linux". This feature would bring Konsole a feature present in Tilix that is along those lines.