Skip to content

Linux theme detection fails with gsettings Missing on 0.8.1 #126

@luh-05

Description

@luh-05

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions