Native Parameter Store Access

nativeparameterstoreaccess provides access to the Windows registry and the macOS Defaults database.

License

License

Categories

Categories

Net Native Development Tools
GroupId

GroupId

com.github.tkuenneth
ArtifactId

ArtifactId

nativeparameterstoreaccess
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

Native Parameter Store Access
nativeparameterstoreaccess provides access to the Windows registry and the macOS Defaults database.
Project URL

Project URL

https://github.com/tkuenneth/nativeparameterstoreaccess
Source Code Management

Source Code Management

https://github.com/tkuenneth/nativeparameterstoreaccess

Download nativeparameterstoreaccess

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.tkuenneth/nativeparameterstoreaccess/ -->
<dependency>
    <groupId>com.github.tkuenneth</groupId>
    <artifactId>nativeparameterstoreaccess</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.tkuenneth/nativeparameterstoreaccess/
implementation 'com.github.tkuenneth:nativeparameterstoreaccess:0.1.2'
// https://jarcasting.com/artifacts/com.github.tkuenneth/nativeparameterstoreaccess/
implementation ("com.github.tkuenneth:nativeparameterstoreaccess:0.1.2")
'com.github.tkuenneth:nativeparameterstoreaccess:jar:0.1.2'
<dependency org="com.github.tkuenneth" name="nativeparameterstoreaccess" rev="0.1.2">
  <artifact name="nativeparameterstoreaccess" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.tkuenneth', module='nativeparameterstoreaccess', version='0.1.2')
)
libraryDependencies += "com.github.tkuenneth" % "nativeparameterstoreaccess" % "0.1.2"
[com.github.tkuenneth/nativeparameterstoreaccess "0.1.2"]

Dependencies

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.7.0
org.junit.jupiter : junit-jupiter-params jar 5.7.0
org.junit.jupiter : junit-jupiter-engine jar 5.7.0

Project Modules

There are no modules declared in this project.

Welcome to Native Parameter Store Acess

A small Java library to access the Windows Registry, macOS Defaults database and dconf.

Sometime you need to access the Windows Registry, the macOS Defaults database or dconf in your Java or Kotlin apps. While the Java standard class library includes the Preferences api to read and write app-specific values, you cannot use it to access system settings. That's what this tiny library is for.

Include in your project

It is very easy to add the library to your project.

Maven
<dependency>
    <groupId>com.github.tkuenneth</groupId>
    <artifactId>nativeparameterstoreaccess</artifactId>
    <version>0.1.2</version>
</dependency>
Gradle
dependencies {
  implementation("com.github.tkuenneth:nativeparameterstoreaccess:0.1.2")
}

Examples

This Kotlin example shows how to detect if the system (macOS, Linux with dconf or Windows) is using a dark theme.

fun isSystemInDarkTheme(): Boolean = when {
    IS_WINDOWS -> {
        val result = WindowsRegistry.getWindowsRegistryEntry(
                "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
                "AppsUseLightTheme")
        result == 0x0
    }
    IS_MACOS -> {
        val result = MacOSDefaults.getDefaultsEntry("AppleInterfaceStyle")
        result == "Dark"
    }
    HAS_DCONF -> {
        val result = Dconf.getDconfEntry("/org/gnome/desktop/interface/gtk-theme")
        result.toLowerCase().contains("dark")
    }
    else -> false
}

Versions

Version
0.1.2
0.1.1
0.1.0