zquestz / s

Open a web search in your terminal.
MIT License
2.32k stars 114 forks source link

Where is the configuration for windows? #154

Closed younger-1 closed 3 years ago

younger-1 commented 3 years ago

I installed it in win10. I can't find which file to change to config s

zquestz commented 3 years ago

This is how the homedir is calculated. Hope this helps!

func dirWindows() (string, error) {
    // First prefer the HOME environmental variable
    if home := os.Getenv("HOME"); home != "" {
        return home, nil
    }

    // Prefer standard environment variable USERPROFILE
    if home := os.Getenv("USERPROFILE"); home != "" {
        return home, nil
    }

    drive := os.Getenv("HOMEDRIVE")
    path := os.Getenv("HOMEPATH")
    home := drive + path
    if drive == "" || path == "" {
        return "", errors.New("HOMEDRIVE, HOMEPATH, or USERPROFILE are blank")
    }

    return home, nil
}

It is within that directory in .config/s/config!