summaryrefslogtreecommitdiff
path: root/src/paths.rs
blob: c52a84e670aa938b9f4406c304a138ea165d7669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::path::PathBuf;

use crate::Result;

pub fn zap_rs_home() -> Result<PathBuf> {
    let home = std::env::var("HOME")?;
    Ok(PathBuf::from(home).join(".local/share/zap-rs"))
}

pub fn index_dir() -> Result<PathBuf> {
    Ok(zap_rs_home()?.join("index"))
}

pub fn appimages_dir() -> Result<PathBuf> {
    Ok(zap_rs_home()?.join("appimages"))
}

pub fn desktops_dir() -> Result<PathBuf> {
    Ok(zap_rs_home()?.join("desktops"))
}

pub fn icons_dir() -> Result<PathBuf> {
    Ok(zap_rs_home()?.join("icons"))
}