Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

Latest commit

 

History

History
36 lines (24 loc) · 1.69 KB

README.md

File metadata and controls

36 lines (24 loc) · 1.69 KB

freedesktop.org for Scala

Build Status Codacy Badge

Libraries for Scala to access the standards defined by freedesktop.org (formerly X Desktop Group).

Base Directory Specification

Latest version Scaladoc

The basedir sub-project contains an implementation of the Base Directory Specification.

import org.freedesktop._

// returns path in user config directory
// ~/.config/git/config
val a: String = basedir.config("git", "config")

// creates and returns in user config directory
// ~/.config/app.conf
val b: String = basedir.config.create("app.conf")

// locates first existing in all (including global) base directories
// could be ~/.config/awesome/rc.lua
// or could be /etc/xdg/awesome/rc.lua if user does not have one
val c: Option[String] = basedir.config.locate("awesome", "rc.lua")

// same works with cache, data and runtime base directories