New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using custom CSS for GTK applications #3901
Comments
Under flatpak, |
I tested this with XFCE and https://flathub.org/apps/details/org.gnome.gedit, changing the appearance on the fly works. XFCE doesn't need to read |
That means, that we should place configs (or symlinks to gtk-3.0 folder?) in every application folder. That's very inconvenient, maybe there is another way? |
As I wrote above: I tested this under XFCE (4.14) with Maybe you can find inspiration in: https://gitlab.xfce.org/xfce/xfconf |
Yes, theme changing does indeed work, if the themes are separate packages (for example changing from Breeze to Adwaita), however, my issue was about custom CSS, placed in ~ |
Use |
This seems to be working. Could we have this and |
You would have to ask for it to be added to the freedesktop runtime (which also the GNOME and KDE runtimes are based on): |
Since the addition of |
The Gtk version that is used for every flatpak app is maintained by the freedesktop runtime: |
But how does that relates to the choice of where to propose the default filesystem permission? |
By default, a flatpak app has only read/write access to If portals are not supported or can't be used, the
|
I understand, but we have two runtimes: GNOME/GTK and FreeDesktop one. Since |
Both, the GNOME and the KDE runtime, are based on the freedesktop runtime and inherit its permissions. |
I created this: |
As one commented over on freedesktop-sdk gitlab, setting permissions on runtime seems not possible as of now, so created this: |
It worked almost perfectly for me; it didn't override the default Windows decorations, and there is still the Breeze windows decoration. |
Run: flatpak -u override --filesystem=xdg-config/gtk-3.0
flatpak -u override --filesystem=xdg-config/gtk-4.0
user_confdir="${XDG_CONFIG_HOME:-$HOME/.config}"
for dir in ${HOME}/.var/app/*; do
flat_confdir3="${dir}/config/gtk-3.0"
flat_confdir4="${dir}/config/gtk-4.0"
mkdir -p "$flat_confdir3"
mkdir -p "$flat_confdir4"
ln -s "${user_confdir}/gtk-3.0/settings.ini" "${flat_confdir3}"/
ln -s "${user_confdir}/gtk-3.0/gtk.css" "${flat_confdir3}"/
ln -s "${user_confdir}/gtk-4.0/settings.ini" "${flat_confdir4}"/
ln -s "${user_confdir}/gtk-4.0/gtk.css" "${flat_confdir4}"/
done also for prefer dark theme: for dir in ${HOME}/.var/app/*; do flatpak run --command=bash<<<"gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'" "${dir##*/}"; done |
@Flashwalker, could you comment your code at all? I'm hesitant to run what I don't particularly understand. |
If you do not understand the code, how can you trust the comment? |
@rusty-snake, because it gives me a much better starting-point to understanding. |
First code block just makes symlinks to yours Second code block just toggle the But it will probably be quite enough for you to: |
doesnt work |
Linux distribution and version
KDE Neon User Edition 5.19
Flatpak version
1.6.5
Description of the problem
Currently, in KDE Plasma GTK applications are trying to be consistent with the Qt applications by using the same settings, where possible (fonts, color scheme, window decorations and others). These settings are properly synced with the GTK applications, installed from repositories, however some of them are not, if the GTK application is installed using Flatpak. Those are color scheme and window decorations (appearance).
The reason for that is that both of those user preferences are synced via custom CSS files, that are placed in the
$XDG_CONFIG/gtk-3.0/
folder. In particular, colors are using custom color definitions in CSS files and windows decorations are synced via window manager rendered images and CSS files. Flatpak applications seem to ignore files in this directory.It should be also noted, that custom CSS is used only for Breeze GTK theme.
Steps to reproduce
The text was updated successfully, but these errors were encountered: