From 5e1849d82ec16434d4b3bc9cbf547123e4c7a67c Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sun, 7 Aug 2022 11:30:01 +0200 Subject: [PATCH] docs: clarify use of --config --- website/docs/installation/customize.mdx | 40 +++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/website/docs/installation/customize.mdx b/website/docs/installation/customize.mdx index 262d1def..71bf91fe 100644 --- a/website/docs/installation/customize.mdx +++ b/website/docs/installation/customize.mdx @@ -8,8 +8,43 @@ import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem" The standard initialization sets Oh My Posh' [default theme][default-theme]. This configuration is downloaded -and kept up-to-date with Oh My Posh' version every time the shell starts. To change/alter the configuration, you need to -add the `--config` command-line option to change the configuration to use a specific file. +and kept up-to-date with Oh My Posh' version every time the shell starts. + +To set a new config/theme you need +to change the `--config` option of the `oh-my-posh init ` line in your `profile` or `.rc` script +(see [prompt][prompt]) and point it to the location of a predefined [theme][themes] or custom configuration on your file system. + + + + +When using the Windows installer (winget or Store install), you can make use of the `$POSH_THEMES` environment variable +that points to all [themes][themes] on your file system. + +For example, to use the [jandedobbeleer][jandedobbeleer] theme, alter the init line like this (`powershell`): + +```powershell +oh-my-posh init pwsh --config "$env:POSH_THEMES/jandedobbeleer.omp.json" | Invoke-Expression +``` + + + + +When using homebrew, all themes are installed alongside Oh My Posh in `$(brew --prefix oh-my-posh)/themes`. +To use any of the themes, use the following syntax (`zsh`): + +```bash +eval "$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json)" +``` + + + ### Get inspiration @@ -162,6 +197,7 @@ segments section covers how to configure each available segment. [themes]: themes.md [configuration]: configuration/overview.mdx +[prompt]: prompt.mdx [default-theme]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/default.omp.json [jandedobbeleer]: /docs/themes#jandedobbeleer [json-schema]: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json