Code Monkey home page Code Monkey logo

xdg-v's Introduction

XDG

This module implements the XDG Base Directory Specification (the newest version, currently version 0.8) by the Free Desktop organisation (freedesktop.org). The full specification can be found on https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html.

The specification specifies where applications should look for files, depending on their use-case. All these locations can be set using environment variables.

Install

$ v install yochem.xdg

Usage

Module documentation can be found on the GitHub Pages of this repo: https://yochem.nl/xdg-v/. But here is a table with the XDG variables and their defaults.

Environment Variable V Default return value
$XDG_CACHE_HOME cache_home() '$HOME/.cache'
$XDG_CONFIG_HOME config_home() '$HOME/.config'
$XDG_DATA_HOME data_home() '$HOME/.local/share'
$XDG_STATE_HOME state_home() '$HOME/.local/state'
$XDG_CONFIG_DIRS config_dirs() ['/etc/xdg']
$XDG_DATA_DIRS data_dirs() ['/usr/local/share', '/usr/share']
$XDG_RUNTIME_DIR runtime_dir() none

pathlib branch

I'm currently working on a pathlib module in vlib, see vlang/v#16782. For now, this repo has a pathlib branch to show how that would look. This branch will be the default when vlang/v#16782 is finished and merged.

License

MIT.

xdg-v's People

Contributors

yochem avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.