Hi!
I have two accounts which are both mine. One for everything else and one account for things where I have to focus and don’t want to get distracted. Currently from one user, I sshfs-mount / into ~/mnt with the permissions of the other user to access my own files.
I consider if I should switch to give both users the same UID&GID. Does this sound like a good idea? I want:
To use normal KDE-GUI-Wayland stuff without problems (librewolf, codium, …)
I can be logged in to both users simultaneously and switch with Ctrl+Alt+F2/F3
The have distinct home directories (distinct app specific settings)
Two users with the same uid are not two users. They’re one user with two entries in /etc/passwd, which would probably just break things.
The proper solution here is to use a shared group and set things up so that files are naturally created owned by that group and full access for the owning group.
There are in fact programs that check for the home directory by looking up the first line corresponding to your UID in /etc/passwd. And if setting $HOME is enough, then you can probably log into another VT with a different $HOME and a different compositor config, without doing questionable things to /etc/passwd.
I know that two entries with the same UID and the same home directory work pretty boringly as an alias on a server-style machine (e.g. for simpler SSH from machines with different local usernames). Not sure if that can confuse anything GUI-oriented, but probably no.
Different home directories probably won’t break anything badly, but which parts end up shared can be surprising.
Oh, and /run/user/ directories are per-UID, not per-username.
Not an answer to your question but this reminds me very much of my current setup. Instead of two users that share files, I have two distinct specialisations that link up the appropriate files I want to share, and loads me up into two different DEs, apps, and configurations.
You might honestly want to consider specialisations. They let you change so much more about your system and helps to really isolate each configuration from the other. For me, loading up my school specialisation gives me apps that I need for school, and switches me into GNOME. Seeing the GNOME DE load up really helps get me in the zone for working.
Thanks for all the replies! I guess KDE_SESSION_UID=1001 and XDG_RUNTIME_DIR=/run/user/1001 will be issues. So I will not go that route I guess. I just replaced sshfs@127.0.0.1 with bindfs. Maybe I create a cronjob to regularly fix some permissions and just access the files directly?
But yeah, while I ended up with the same Desktop Environment, having different background images really help to mentally get into work or personal mode.