-
Notifications
You must be signed in to change notification settings - Fork 16
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
Linux & BSD support #6
Conversation
Co-authored-by: Eduardo Flores <[email protected]>
Co-authored-by: Eduardo Flores <[email protected]>
Co-authored-by: Eduardo Flores <[email protected]>
First, try XDG Desktop Portal dbus API (compatible with Flatpak sandboxing). If that does not work, fall back to checking if the theme name contains the string "dark". Checking the theme name is supported on: - Cinnamon - GNOME - KDE - MATE - Unity - XFCE Co-authored-by: Eduardo Flores <[email protected]> Co-authored-by: Corey Farwell <[email protected]>
Unfortunately it seems the KDE method is not really working. I suggest we change to the same method as KDE's implementation of the XDG Desktop Portal by reading the |
Alright, I'll get on that next 👍 |
Maybe serde_ini could help? I'm not sure. |
The calculation of the grayscale value with qGray is simply |
Added `rgb` method to Mode to implement qGray.
Done, could you test it before we merge @Be-ing? |
I just enabled GitHub Actions for CI. Mentioning in case you want to merge/rebase to pick that up here |
It now checks `BackgroundNormal` under `Colors:Window`.
I have no preference between rebasing/merging/squashing. Do whatever you'd like! |
Closes #1 |
I tested this on KDE Plasma 5.23.4 on Fedora 34 switching between several color schemes and it works! Great job! |
By the way, I've been improving the code, looks way better. I'll try to upload the commit tonight so you can review it in the morning. unless you're a night owl 🦉 |
@frewsxcv shall we make a new release now that this is merged? |
How about we wait until we have #10 ready? |
#10 may take some time to polish and implement on all platforms. I don't think we need to hold back a release for that. Version numbers are cheap. :) |
Alright then! 👍🏼 |
0.2.0 released! |
and remove unused code. Before, the sync and async APIs had completely separate implementations. When Linux support was first added in rust-dark-light#6 the XDG Desktop Portal color-scheme API was new and not yet widely supported, so fallbacks were needed. Now, the portal API is more widely supported so the fallbacks are not needed. In my testing, the portal works on: KDE Plasma GNOME Cinnamon Xfce MATE does not currently support the portal API. Selecting MATE's GTK themes from Xfce's settings also does not change what xdg-desktop-portal-gtk reports. I am not sure, but I think that may be due to missing metadata in MATE's GTK themes. The old implementation never worked on MATE anyway because MATE's dark themes don't have "dark" in their name, so there's no regression removing it.
Before, the sync and async APIs had completely separate implementations. When Linux support was first added in rust-dark-light#6 the XDG Desktop Portal color-scheme API was new and not yet widely supported, so fallbacks were needed. Now, the portal API is more widely supported so the fallbacks are not needed. In my testing, the portal works on: KDE Plasma GNOME Cinnamon Xfce MATE does not currently support the portal API. Selecting MATE's GTK themes from Xfce's settings also does not change what xdg-desktop-portal-gtk reports. I am not sure, but I think that may be due to missing metadata in MATE's GTK themes. The old implementation never worked on MATE anyway because MATE's dark themes don't have "dark" in their name, so there's no regression removing it.
Before, the sync and async APIs had completely separate implementations. When Linux support was first added in rust-dark-light#6 the XDG Desktop Portal color-scheme API was new and not yet widely supported, so fallbacks were needed. Now, the portal API is more widely supported so the fallbacks are not needed. In my testing, the portal works on: KDE Plasma GNOME Cinnamon Xfce MATE does not currently support the portal API. Selecting MATE's GTK themes from Xfce's settings also does not change what xdg-desktop-portal-gtk reports. I am not sure, but I think that may be due to missing metadata in MATE's GTK themes. The old implementation never worked on MATE anyway because MATE's dark themes don't have "dark" in their name, so there's no regression removing it.
Before, the sync and async APIs had completely separate implementations. When Linux support was first added in rust-dark-light#6 the XDG Desktop Portal color-scheme API was new and not yet widely supported, so fallbacks were needed. Now, the portal API is more widely supported so the fallbacks are not needed. In my testing, the portal works on: KDE Plasma GNOME Cinnamon Xfce MATE does not currently support the portal API. Selecting MATE's GTK themes from Xfce's settings also does not change what xdg-desktop-portal-gtk reports. I am not sure, but I think that may be due to missing metadata in MATE's GTK themes. The old implementation never worked on MATE anyway because MATE's dark themes don't have "dark" in their name, so there's no regression removing it.
Before, the sync and async APIs had completely separate implementations. When Linux support was first added in #6 the XDG Desktop Portal color-scheme API was new and not yet widely supported, so fallbacks were needed. Now, the portal API is more widely supported so the fallbacks are not needed. In my testing, the portal works on: KDE Plasma GNOME Cinnamon Xfce MATE does not currently support the portal API. Selecting MATE's GTK themes from Xfce's settings also does not change what xdg-desktop-portal-gtk reports. I am not sure, but I think that may be due to missing metadata in MATE's GTK themes. The old implementation never worked on MATE anyway because MATE's dark themes don't have "dark" in their name, so there's no regression removing it.
This is #4 squashed and with a few small commits split out, plus updating README.md, formatting changes, and fixing a few clippy warnings.