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

gnome-settings-daemon detection doesn't work outside of i3, GNOME, or XFCE #61

Closed
telnoratti opened this issue Oct 4, 2022 · 6 comments

Comments

@telnoratti
Copy link

I use sway, which is a Wayland based successor to i3. I still manage light/dark mode with gsettings, but Auto Dark Mode says it's not supported because it's not one of the selected desktop environments. It should work, because the associated gsettings command does indeed return information about the theme.

public static final boolean isGtk = SystemInfo.isGNOME || SystemInfo.isXfce || SystemInfo.isI3;

It appears that SystemInfo in IntelliJ has similar limitations by design. https://github.com/JetBrains/intellij-community/blob/ceb2e26bfe1707dad40b3de02871b14445d8f766/platform/util/src/com/intellij/openapi/util/SystemInfo.java#L67-L81.

I noticed a recent merged PR #54 which expanded the detection and a discussion at #50 (comment) which I think was discussing adding a xdg-desktop-portal component and separate detection.

@weisJ
Copy link
Owner

weisJ commented Oct 4, 2022

The portal implementation (#51) has indeed been worked on but stalled due to unknown limitations in the IDEA platform, which haven't been resolved yet by the looks of it.

Detecting whether the current implementation works isn't trivial as there is no unified way of checking it without running it and seeing if it doesn't fail (which I really don't want to do).

Now what I can imagine doing is adding an "I am absolutely sure my system supports the plugin, I know what I a doing" option to force the current implementation to be used. It's not ideal but the probably quickest solution.

@telnoratti
Copy link
Author

Yeah, I think the best option to check if gnome-settings-daemon is in use is to use the dbus interface. That means either trying to load your native library and see if it fails or connecting to dbus directly, which I gather is the cause of the problems in the portal implementation. The "I know what I'm doing option" sounds like a good stopgap.

I don't know exactly what direction Linux is going for this. I've been using darkman which offers some cross implementation compatibility and allows running arbitrary scripts to fix all the things that don't use a "standard" interface. I think that'll be what I have to do for the next 2-3 years at least.

@Janhouse
Copy link

Janhouse commented Nov 2, 2022

This plugin does not work with Gnome 43.
Instead of checking gtk-theme it should check for color-scheme 'prefer-dark'
https://wiki.archlinux.org/title/Dark_mode_switching#gsettings

@weisJ
Copy link
Owner

weisJ commented Dec 2, 2022

I currently don't have a lot of time for working on this plugin. I would be happy for any contributions tackling this.

@weisJ
Copy link
Owner

weisJ commented Mar 29, 2023

I have prepared a new version, which might fix this: #50 (comment)

@weisJ
Copy link
Owner

weisJ commented Sep 2, 2023

Closing this as the remaking issue with Gnome is already tracked in #72

@weisJ weisJ closed this as completed Sep 2, 2023
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

No branches or pull requests

3 participants