Xdg.Directories/docs/docs/quick-use.md
Sam Therapy 4f384523a6
All checks were successful
Public Preview Builds / publish-preview (push) Successful in 40s
Add a docs site?
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2024-03-27 15:15:18 +01:00

485 B

TL;DR

Add the Xdg.Directories package to your project:

dotnet add package Xdg.Directories

Then use the BaseDirectory and UserDirectory classes to access the XDG directories:

using System;
using Xdg.Directories;

// Prints /home/$USER/.local/share
Console.Writeline(BaseDirectory.DataHome);

// Prints /home/$USER/Documents
Console.Writeline(UserDirectory.DocumentsDir);

For more information, see the API documentation.