Bug 307244 - Please export profile name for window rule matching
Summary: Please export profile name for window rule matching
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.9.2
Platform: Debian unstable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-23 07:13 UTC by Marc Haber
Modified: 2018-06-07 12:07 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Haber 2012-09-23 07:13:18 UTC
Hi,

I would like to have a window rule matching on all konsole windows with a given profile. Please either export the profile name for matching, for example a s window role, or allow the window role to be explicitly set in the profile setting, instead of "Main Window #1".

Greetings
Marc


Reproducible: Always
Comment 1 Jekyll Wu 2012-09-25 11:53:02 UTC
Could you give a specific example why you need the profile name for matching? Or why other criterias (like title) does not work for your need?

The first thing to consider is konsole supports mutiple tabs created from different profiles in one window. Then after switching tab, should konsole update the "window role" dynamically? Or is it technically possibe to update "window role" in the runtime after the window has been created ?
Comment 2 Jekyll Wu 2012-10-20 22:14:24 UTC
Need a concrete use case to explain your need better.
Comment 3 Yichao Yu 2013-04-16 18:43:16 UTC
The window title is sth that shows what is happening in the session while a window rule usually cares which kind of session this is. The title may contain a lot more detail info of the session and may also be very hard to match using regex in the window rules even if it does contain some info about the type of the session (therefore, the profile in use).
Since konsole already set the window role for each of it's windows, I think it is also useful to provide a way to set window role for different sessions just like the window title with a default value of e.g. MainWindow#%i where %i is a id that konsole can generate automatically for the same profile.
Comment 4 Marc Haber 2015-10-07 18:17:27 UTC
(In reply to Jekyll Wu from comment #2)
> Need a concrete use case to explain your need better.

I apologize to take three years to answer. I do have a dedicated profile called "Chat Window". I usually have only one window of that profile open, and I want this one to be in the lower left corner of the screen.

This is a workaround since the default window placement has been changed when migrating from KDE 3 to KDE 4. The old behavior was perfect for my needs, but is not available any more, so I need functions to work around this. But, otoh, I have gotten accustomed to manually moving the chat window where it belongs since I filed this bug.

Greetings
Marc
Comment 5 Ahmad Samir 2018-05-24 20:09:04 UTC
Konsole exports a KONSOLE_PROFILE_NAME environment variable, you can use that together with escape sequences[1] to set the window title to include the profile name.

[2]bug 325178 comment 2
Comment 6 Marc Haber 2018-05-25 12:30:21 UTC
That would mean that the profile name would be visible in the window title, task bar etc. That might be a technical solution, but it's ugly.

Six years after filing this bugreport, I now see that the issue was marked as "resolved" without anything happening on the code. If something happened on the code, it was not made visible in the bug report. It's a pity.
Comment 7 Marc Haber 2018-05-25 12:34:47 UTC
Also, it is likely that the modification on the window title will only happen after window rules were applied if one does that from the prompt, for example. You cannot be seriously recommenting this method - straight back from the 1980ies - as a serious solution.
Comment 8 Ahmad Samir 2018-05-25 13:24:42 UTC
(In reply to Marc Haber from comment #6)
> Six years after filing this bugreport, I now see that the issue was marked
> as "resolved" without anything happening on the code. If something happened
> on the code, it was not made visible in the bug report. It's a pity.
I changed it to "resolved: waitingforinfo", this is so that instead of leaving the report open for another six years, it'll stay closed until the OP gives feedback.

(In reply to Marc Haber from comment #7)
> Also, it is likely that the modification on the window title will only
> happen after window rules were applied if one does that from the prompt, for
> example. You cannot be seriously recommenting this method - straight back
> from the 1980ies - as a serious solution.

Actually the window title will be set as soon as you open a window with that profile.

As the reporter of this issue, you can simply reopen the report if you disagree.
Comment 9 Ahmad Samir 2018-06-07 12:07:48 UTC
FTR, some other options:
- Launch konsole with "--name NAME" and NAME will be added to the wm_class for that window
- Disable "Show window title on the title bar", then:
  - Launch konsole with "--title TITLE" and TITLE will be used as the title of that window OR
  - For a particular profile set the tab name to a static string, "tabText", that will always be used as the window title when that profile is used.