kde-globals-loader

1.0.3 • Public • Published

KDE Globals Loader

This module can find paths to the KDE global config files and get their contents as objects. Obviously, it is Linux-only.

Usage

This module has two functions:

  • getGlobals() gets all globals values as an object.
  • getGlobalsPath() gets the path to the globals config file, to be read and parsed as an .ini file

Examples

Active color scheme name and values

require("kde-globals-loader").getGlobals().then(data => {
  console.log("Your current color scheme is "
    + data.General.ColorScheme
    + ". It has the following RGB color values:"
  );
  console.log("Window background: " + data["Colors:Window"].BackgroundNormal);
  console.log("View background: " + data["Colors:View"].BackgroundNormal);
  console.log("View foreground: " + data["Colors:View"].ForegroundNormal);
});

Text font size and name

require("kde-globals-loader").getGlobals().then(data => {
  let font = data.General.font.split(",");
  console.log(`You're using the font "${font[0]}" at ${font[1]}pt size`);
});

Globals file location

require("kde-globals-loader").getGlobalsPath().then(path => {
  console.log("Your globals are stored at " + path);
});

Package Sidebar

Install

npm i kde-globals-loader

Weekly Downloads

0

Version

1.0.3

License

GPL-3.0

Unpacked Size

3.42 kB

Total Files

4

Last publish

Collaborators

  • stxarixdust