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 theme detection fails with gsettings Missing on 0.8.1 #126

Open
Luh-code opened this issue Nov 22, 2024 · 0 comments
Open

Linux theme detection fails with gsettings Missing on 0.8.1 #126

Luh-code opened this issue Nov 22, 2024 · 0 comments

Comments

@Luh-code
Copy link

Luh-code commented Nov 22, 2024

Description:

On some Linux installations, theme detection fails due to the absence of gsettings. This issue was observed starting from version 0.8.1 but not in 0.8.0. I suspect this isn't a new bug but rather an existing one that now logs properly due to the introduction of slf4j-simple in #123.

For more information, please see the related issue on this repository.

Steps to Reproduce:

  1. Use a Linux system without gsettings installed
  2. Run an application using version 0.8.1
  3. Observe the logs indicating theme detection failure

Actual Behavior:
Theme detection fails with the following error:
java.io.IOException: Cannot run program "gsettings": error=2, No such file or directory

Expected Behavior:

  • The application should gracefully handle the absence of gsettings or even provide an alternative theme detection method

Environment:

  • OS: NixOS 24.11.20241105.411656 (Vicuna)
  • Kernel: Linux 6.11.5-zen1
  • WM: Hyprland
  • Java Version: 21

Additional Context:

  • Version 0.8.0 does not produce this issue; reverting to it resolves the problem.
  • Error logs suggest the issue stems from jSystemThemeDetector
  • Example logs from my system when trying to run this assignment:
> Task :Main.main()
[main] ERROR com.jthemedetecor.GnomeThemeDetector - Couldn't detect Linux OS theme
java.io.IOException: Cannot run program "gsettings": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.jthemedetecor.GnomeThemeDetector.isDark(GnomeThemeDetector.java:57)
	at fopbot.GuiPanel.<init>(GuiPanel.java:87)
	at fopbot.KarelWorld.setVisible(KarelWorld.java:363)
	at fopbot.World.setVisible(World.java:28)
	at h03.Main.main(Main.java:17)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 9 more
[main] ERROR com.jthemedetecor.GnomeThemeDetector - Couldn't detect Linux OS theme
Caused by: java.io.IOException: error=2, No such file or directory

java.io.IOException: Cannot run program "gsettings": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.jthemedetecor.GnomeThemeDetector.isDark(GnomeThemeDetector.java:57)
	at com.jthemedetecor.GnomeThemeDetector$DetectorThread.<init>(GnomeThemeDetector.java:111)
	at com.jthemedetecor.GnomeThemeDetector.registerListener(GnomeThemeDetector.java:85)
	at fopbot.GuiPanel.<init>(GuiPanel.java:108)
	at fopbot.KarelWorld.setVisible(KarelWorld.java:363)
	at fopbot.World.setVisible(World.java:28)
	at h03.Main.main(Main.java:17)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 11 more
[GTK Theme Detector Thread] ERROR com.jthemedetecor.GnomeThemeDetector - Couldn't start monitoring process 
java.io.IOException: Cannot run program "gsettings": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at java.base/java.lang.Runtime.exec(Runtime.java:681)
	at java.base/java.lang.Runtime.exec(Runtime.java:491)
	at java.base/java.lang.Runtime.exec(Runtime.java:366)
	at com.jthemedetecor.GnomeThemeDetector$DetectorThread.run(GnomeThemeDetector.java:121)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 5 more

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
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

1 participant