22
submitted 11 months ago by shadowintheday@beehaw.org to c/linux@lemmy.ml

I run different programs as different users, is it possible to have a visual indication of wether a user or another is running them ? e.g dolphin as user1, dolphin as user2, etc

top 4 comments
sorted by: hot top controversial new old
[-] ReversalHatchery@beehaw.org 5 points 11 months ago* (last edited 11 months ago)

I would be interested in a proper solution, but recently I have found a way to make custom icons for specific Konsole instances. Maybe you could use a similar approach.

I have made a copy of the program's desktop file and placed it in /usr/local/share/applications/ with a slightly different name, and given it a new icon. Then I have made a new window rule, that sets this desktop file for windows that start with a title having a specific pattern, and made Konsole to start with that title using an undocumented command argument I have found on their bug tracker.
This is very hacky and I don't like it, can't wait until it breaks, but it's all I have found.

An alternative way may be to make a symlink to Konsole and start it through this symlink, and somehow identify the window by the executable path.. but window rules don't support that. Maybe through some other way? KWin has a scripting API... hmmm..

But a problem you'll probably have to deal with when setting the title is that the program can set it's title any time, and at least some of them (including Konsole) routinely do that, in that case based on the selected tab's title. There's a setting to turn that off.. but as I have experienced, it doesn't do what I expect, if anything. Maybe by listening to title changes you can force your will, if that is possible.

[-] neshura@bookwormstory.social 3 points 11 months ago

Not sure if possible but have you checked whether the running user is an application property? If so you could maybe manage it via application or window rules.

Can't check rn because I'm away from my PC but it's worth a shot checking imo.

[-] stepanzak@iusearchlinux.fyi 3 points 11 months ago

I have no idea, but couldn't this be an XY problem or how it's called? I mean, do you really need to use apps as different users? Maybe you do, I don't know, but sometimes it's good to think about whether the problem you are trying to solve isn't just a result of another peoblem.

[-] palordrolap@kbin.social 2 points 11 months ago* (last edited 11 months ago)

To distinguish two Firefox profiles that I run simultaneously, I use different themes on each. For Firefox this might actually be the best way.

For a file manager (I assume the Dolphin you're talking about is the file manager), the closest I remember seeing is a red toolbar on the unrelated Nemo file manager when it's run as root.

If Dolphin is per-user theme-able, then you could do what I do with Firefox. If it supports other kinds of plug-in, then maybe there's one that does what you want already.

To my knowledge, windowing systems can't override the title of an application's window, and even if they could, the application could change it back again at any time, creating a race condition, or a very ugly situation where the system picks and chooses which windows are allowed to modify their titles and which ones aren't.

Therefore, I think you'd have to write your own plug-in (if they're a thing and the API permits title modifications), modify Dolphin's source code yourself or submit a feature request to Dolphin's developers, cross your fingers and wait.

this post was submitted on 30 Nov 2023
22 points (100.0% liked)

Linux

48052 readers
673 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS