You are not logged in.

#1 2022-04-23 22:46:49

nick_0189
Member
Registered: 2020-12-21
Posts: 45

[SOLVED] Multiple "Sandboxed" Desktop Environments

Hello Arch Forums,

I was wondering if anyone had any tips or suggestions for running multiple desktop environments in relative isolation from each other. I normally like to use a very minimalist setup with a number of unique keybindings and a tiling window manager, but would like to have a "real" or more traditional desktop environment such as XFCE, Mate, or maybe KDE for situations where someone else wants to use my computer or in case I break something on my own environment and don't have time to fix it for a few days.

I could just `sudo pacman -S plasma-desktop brave dolphin kate etc` to get a second desktop environment, but the issue is that the two desktop environments will mess with each other. For example, Brave might try to set itself as the default application for everything, KDE applications will show up when searching with rofi, the home directory will get cluttered with applications' configuration files from KDE, the system theme might get changed on both desktops, etc. One solution would be a VM, but that could cause performance issues and it would be better to not have to install and manage everything twice.

I was thinking a user could be made for each desktop environment and that would solve the issue with cluttering the home directory. I could also symlink some of the folders such as documents and downloads between the two users' home directories. Then all desktop environment specific packages could be installed to two seperate directories where only one of those directories is added to the path depending on the desktop environment or user. Maybe chrooting might be a solution, but that seems to adding more complexity than is necessary.

Does anyone know any better ways of doing this while keeping the applications and configuration files separate from each other?

Thanks,
Nick

Last edited by nick_0189 (2022-05-05 02:42:45)

Offline

#2 2022-04-24 13:47:04

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,418
Website

Re: [SOLVED] Multiple "Sandboxed" Desktop Environments

A separate user seems the right solution. Instead of symlinking (which is not transparent to all programs) you can use bind mounts or change XDG variables to point to a shared location: https://wiki.archlinux.org/title/XDG_us … irectories

KDE applications will show up when searching with rofi

Desktop files from DEs typically have "OnlyShowIn" which is respected by application launchers including rofi. You can also symlink individual desktop files (in ~/.local/share/applications) to /dev/null.


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#3 2022-04-24 21:12:50

nick_0189
Member
Registered: 2020-12-21
Posts: 45

Re: [SOLVED] Multiple "Sandboxed" Desktop Environments

Thanks, Alad!

That works very nicely. I didn't know that was a part of the XDG specifications. Now all that needs to be done is to find a way to keep track of which applications belong to which desktop environment or both desktop environments and edit the .desktop files accordingly.

Is there an easy way to completely separate desktop specific components from each other? For example, could this be set up so that if one wanted to completely strip a desktop environment and everything associated with it from a system without touching anything else but also without leaving anything behind, he would only need to remove a single folder or package to do so?

Could this be done with meta packages? Something like this:

PKGBUILD for basic packages needed for a minimal install without desktop environment:

pkgname=bare
pkgver=1.0.0
pkgrel=1
pkgdesc="Core Packages needed for a bare system."
arch=(any)
license=(None)
url=' '
depends=(base base-devel linux-zen linux-firmware grub efibootmgr btrfs-progs wpa_supplicant dhcpcd ... ...)

PKGBUILD for packages needed for virtually any desktop environment:

pkgname=base-de-meta
pkgver=1.0.0
pkgrel=1
pkgdesc="Core Packages needed for any basic desktop environment."
arch=(any)
license=(None)
url=' '
depends=(bare xorg-server xorg-xinit gnu-free-fonts wallpapers ... ...)

PKGBUILD for packages needed for "minimalist" desktop environment:

pkgname=lde-meta
pkgver=1.0.0
pkgrel=1
pkgdesc="Meta package for a speedy and Lightweight Desktop Environment."
arch=(any)
license=(None)
url=' '
depends=(base-de-meta leftwm picom lf surf librewolf neofetch neovim pywal feh imagemagick zathura zathura-pdf-poppler lemonbar thunar pipewire mpv ncmpcpp  ... ...)

Packages needed for K desktop environment:

pkgname=kde-meta
pkgver=1.0.0
pkgrel=1
pkgdesc="Meta package for a basic K Desktop Environment."
arch=(any)
license=(None)
url=' '
depends=(base-de-meta plasma-desktop dolphin kate brave okular libreoffice-fresh dragon konsole gwenview ... ...)

Hopefully then I could use something like `pacman -Ql kde-meta | grep ".desktop"` to find all the desktop files that need to be changed and add "OnlyShowIn=KDE|leftwm" to each of them accordingly using a for loop in a bash script, and maybe even add the script to the PKGBUILDS depending on if the dependencies are in pacman's database when the "package()" function is run at the end of the PKGBUILD and if pacman's `-Ql` flag works recursively.

Thank you for your help. I think I will try that if there isn't something obviously flawed or poor practice with that and you don't see a noticeably more elegant/efficient way to do it.

Offline

Board footer

Powered by FluxBB