Color decorating Konsole for root logons

Hello!

The only thing I find interesting in Gnome is that the whole window decoration changes for their terminal when I su/sudo to root, as seen on this Fedora 41 Workstation live session on VBox:

Note, when there are multiple tabs in window, window decoration (not only tab) depends on whether the active tab is root or not.

Note2: This functionality seems to be missing/disabled in Manjaro Gnome.

Is there a way to get this functionality in KDE’s Konsole?

If you use run0, which was introduced into systemd as an alternative way of elevating privileges earlier this year, then the background color of your terminal (eg. Konsole) will change:

Screenshot_20241105_203157

I don’t know if there is a way to change the color of the entire window though.

2 Likes

Fedora does not use Gnome Terminal by default.
By default it isn’t even installed.

What they use and what you see there is ptyxis.

I know nothing about how to configure this behavior - probably look for answers on Fedora forums and wikis.

On top of that and If I recall correctly, Manjaro Gnome uses zsh in the user session by default
while Fedora default is bash.

I have no idea.

1 Like

Liquid Prompt https://liquidprompt.readthedocs.io/en/latest/install.html

Here’s my current prompt:

Screenshot_20241111_124916

A very simple example, of course…But it works for me!

1 Like

I mean …

Konsole default prompt already does that.

(At least for bash … is it different for zsh?)

It would seem that OP is looking for something that changes the window decorations.

3 Likes

Yes…Liquid Prompt can be much more, it is so. BTW, from zsh config, you can switch to bash.

How exactly does your special prompt affect the window decorations?

Your screenshot does not show that.

Your screenshot shows the prompt text changing (to red) when you enter su.

This is not what the thread is asking for … and it is already what happens without Liquid Prompt … or any special configuration. Just regular bash will turn red if you enter su.

(So I dont understand what you are trying to show, especially in relation to Liquid Prompt)

Uh. Yes.
Again, this has nothing to do with anything said here. Of course one can change their shell.

(As I have, and always would on a modern install, because zsh is silly.)

1 Like

Discover says
Ptyxis

can be installed from
Flathub

if you desire…

I use starship now and had sick complicated custom scripted prompts in the past. That is not what I asked about. I have red root prompt since the first shells supported ANSI sequences in prompts…
image

I think it may also be achieved by meddling with final prompt color change on any shell/console, however this method interferes with many ncurses apps.

Hey, it is even in extra/ptyxis and the intended behaviour is out-of-the-box. Unfortunately, has unbearable GTK3 interface and lack of split windows.

Now have to inspect the source about how they detect current user inside shell, even if deeply nested.

My gut says they inspect deepmost child’s EUID of a specific tab.

Yes, it’s available and it is like this out of the box - it’s geared towards working with containers - which I know next to nothing about.

You clearly didn’t want anything GTK.

How to persuade Konsole or another terminal program to behave similarly I don’t know.

Good luck with that!

Please do tell if you find a way.