Skip to content
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

Merged
merged 10 commits into from
Jan 17, 2022
Merged

Linux & BSD support #6

merged 10 commits into from
Jan 17, 2022

Conversation

Be-ing
Copy link
Collaborator

@Be-ing Be-ing commented Jan 6, 2022

This is #4 squashed and with a few small commits split out, plus updating README.md, formatting changes, and fixing a few clippy warnings.

Be-ing and others added 5 commits January 6, 2022 10:00
Co-authored-by: Eduardo Flores <edfloreshz@gmail.com>
Co-authored-by: Eduardo Flores <edfloreshz@gmail.com>
Co-authored-by: Eduardo Flores <edfloreshz@gmail.com>
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 <edfloreshz@gmail.com>
Co-authored-by: Corey Farwell <coreyf@rwell.org>
@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 6, 2022

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 BackgroundNormal key under Colors:Window in $XDG_CONFIG_DIR/kdeglobals and calculating the grayscale value of that color.

@Be-ing Be-ing mentioned this pull request Jan 6, 2022
@edfloreshz
Copy link
Collaborator

Alright, I'll get on that next 👍

@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 6, 2022

Maybe serde_ini could help? I'm not sure.

@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 6, 2022

The calculation of the grayscale value with qGray is simply (r * 11 + g * 16 + b * 5)/32.

Added `rgb` method to Mode to implement qGray.
@edfloreshz
Copy link
Collaborator

Done, could you test it before we merge @Be-ing?

src/freedesktop.rs Outdated Show resolved Hide resolved
@frewsxcv
Copy link
Owner

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`.
@edfloreshz
Copy link
Collaborator

After @Be-ing's approval, we'll be ready for merge @frewsxcv, should we merge or rebase?

@frewsxcv
Copy link
Owner

I have no preference between rebasing/merging/squashing. Do whatever you'd like!

src/lib.rs Outdated Show resolved Hide resolved
@edfloreshz edfloreshz merged commit d882275 into frewsxcv:master Jan 17, 2022
@edfloreshz
Copy link
Collaborator

Closes #1

@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 17, 2022

I tested this on KDE Plasma 5.23.4 on Fedora 34 switching between several color schemes and it works! Great job!

@edfloreshz
Copy link
Collaborator

Awesome! Great job as well @Be-ing and @frewsxcv, cheers 🥂

@edfloreshz
Copy link
Collaborator

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 🦉

@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 17, 2022

@frewsxcv shall we make a new release now that this is merged?

@edfloreshz
Copy link
Collaborator

How about we wait until we have #10 ready?

@Be-ing
Copy link
Collaborator Author

Be-ing commented Jan 17, 2022

#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. :)

@edfloreshz
Copy link
Collaborator

Alright then! 👍🏼

@frewsxcv
Copy link
Owner

0.2.0 released!

@Be-ing Be-ing deleted the freedesktop branch January 18, 2022 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants