sddm / sddm

QML based X11 and Wayland display manager
GNU General Public License v2.0
1.86k stars 327 forks source link

Enhancement: Support themes installed in two file system locations #1561

Open travier opened 2 years ago

travier commented 2 years ago

Add support for using themes installed in two different file system locations instead of a single one right now.

The objective is to be able to define the two following locations:

This is especially useful on Linux distributions where /usr is mounted read only such as Fedora Kinoite.

Will help fix: https://bugs.kde.org/show_bug.cgi?id=454509

Thanks!

marcdeop commented 1 year ago

Perhaps even better if there is a setting so distros can configure this kind of stuff :-)

travier commented 1 year ago

This is the idea. There is currently only one option in the settings (https://github.com/sddm/sddm/blob/develop/data/man/sddm.conf.rst.in#L81) and would either need to make that a list or to add a "System Themes" / "User Themes" option.

aleixpol commented 1 year ago

How about we make Current accept being an absolute path?

I don't see how we benefit from the ThemeDir + Current distrinction.

Vogtinator commented 1 year ago

How about we make Current accept being an absolute path?

I don't see how we benefit from the ThemeDir + Current distrinction.

Could be done, but IMO sddm should have a default location for themes outside of /usr. If that's not provided somehow, this is entirely up to the user or configuration tool, which is IMO the wrong place.

aleixpol commented 1 year ago

What I mean is that it feels wrong to ask SDDM to be figuring out at runtime where to get the theme from.

If the users want to have sddm use a theme located elsewhere, they should be able to just inform which directory it's on.

Vogtinator commented 1 year ago

What I mean is that it feels wrong to ask SDDM to be figuring out at runtime where to get the theme from.

Yeah, and ideally SDDM provides a location OOTB where all configuration tools (I guess just sddm-kcm, can anything else install themes?) can look for it and write to.

If the users want to have sddm use a theme located elsewhere, they should be able to just inform which directory it's on.

In theory that could mislead users (or worse, tools) to select some location inside $HOME, which can be insecure.

IMO doing it like SessionDir in PR #1543 and allowing multiple directories to be specified (with one being inside /var, /usr/local/ or maybe /etc) is the most straightforward and obvious option.

travier commented 1 year ago

IMO doing it like SessionDir in PR #1543 and allowing multiple directories to be specified (with one being inside /var, /usr/local/ or maybe /etc) is the most straightforward and obvious option.

Definitely agree with this approach with the paths from my first comment.

aleixpol commented 1 year ago

In theory that could mislead users (or worse, tools) to select some location inside $HOME, which can be insecure.

Having a ThemeDir can also mislead users to thinking they should be using home. I don't see why we need to make it more complex than it needs to be.

bayazidbh commented 1 year ago

Since SDDM will be joining KDE and KDE Plasma 6 is in development, might this be a good chance to implement or otherwise change where the SDDM themes are located?

Terraphice commented 1 year ago

+1

boredsquirrel commented 2 months ago

There is /etc/sddm.conf. Placing an override file /etc/sddm.conf.d/themedirchange.conf with ThemeDir=/var/lib/sddm/themes is also possible.

I dont think it is necessary to change code here, as Distros could change that ThemeDir, or did I forget something?

But placing the themes in /var/lib/sddm by default would make more sense I think.

>> man hier
 /usr   This directory is usually mounted from a separate partition.  It should hold only shareable, read-only data, so that it can be mounted by various machines running Linux.

Note: KDE sddm-kcm works without issues when using a different ThemeDir

https://pagure.io/fedora-kde/SIG/issue/534

https://pagure.io/fedora-kde/SIG/issue/282

travier commented 2 months ago

The theme provided by the distribution must be placed in /usr, which is sometimes read only on some distributions.

This change would let users/admins install additional themes not included / packaged by a distribution in another (writable) location.

It is needed.

Vogtinator commented 2 months ago

There is /etc/sddm.conf. Placing an override file /etc/sddm.conf.d/themedirchange.conf with ThemeDir=/var/lib/sddm/themes is also possible. I dont think it is necessary to change code here, as Distros could change that ThemeDir, or did I forget something?

Correct. If something wants to install a new theme into a different location, it can just set ThemeDir appropriately.

There's only one slight issue: theme.conf.user. That's read from the theme directory, so for changing settings for a theme in /usr, it would have to be copied somewhere else first... That's possible to fix separately though.

travier commented 2 months ago

https://github.com/sddm/sddm/pull/1739 looks mostly ready. Then we can teach the KCM to copy and install themes to the new place.