๐Ÿ“ฆ yochem / xdg-v

XDG Base Directory specification implementation in V (Vlang)

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching
vvlangvlang-modulevlang-package
๐Ÿ“ฅ Clone https://github.com/yochem/xdg-v.git
HTTPS git clone https://github.com/yochem/xdg-v.git
SSH git clone git@github.com:yochem/xdg-v.git
CLI gh repo clone yochem/xdg-v
Yochem van Rosmalen Yochem van Rosmalen Add docs link to README d1b5d4f 2 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitattributes
๐Ÿ“„ .gitignore
๐Ÿ“„ README.md
๐Ÿ“„ v.mod
๐Ÿ“„ xdg_test.v
๐Ÿ“„ xdg.v
๐Ÿ“„ README.md

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 https://github.com/vlang/v/pull/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.