core: add CacheDir pragma

Closes #293
This commit is contained in:
outfoxxed 2025-10-12 00:14:36 -07:00
parent ea79eaceb0
commit 1e8cc2e78d
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 36 additions and 8 deletions

View file

@ -127,18 +127,21 @@ class QuickshellGlobal: public QObject {
/// Usually `~/.local/share/quickshell/by-shell/<shell-id>`
///
/// Can be overridden using `//@ pragma DataDir $BASE/path` in the root qml file, where `$BASE`
/// corrosponds to `$XDG_DATA_HOME` (usually `~/.local/share`).
/// corresponds to `$XDG_DATA_HOME` (usually `~/.local/share`).
Q_PROPERTY(QString dataDir READ dataDir CONSTANT);
/// The per-shell state directory.
///
/// Usually `~/.local/state/quickshell/by-shell/<shell-id>`
///
/// Can be overridden using `//@ pragma StateDir $BASE/path` in the root qml file, where `$BASE`
/// corrosponds to `$XDG_STATE_HOME` (usually `~/.local/state`).
/// corresponds to `$XDG_STATE_HOME` (usually `~/.local/state`).
Q_PROPERTY(QString stateDir READ stateDir CONSTANT);
/// The per-shell cache directory.
///
/// Usually `~/.cache/quickshell/by-shell/<shell-id>`
///
/// Can be overridden using `//@ pragma CacheDir $BASE/path` in the root qml file, where `$BASE`
/// corresponds to `$XDG_CACHE_HOME` (usually `~/.cache`).
Q_PROPERTY(QString cacheDir READ cacheDir CONSTANT);
// clang-format on
QML_SINGLETON;