Skip to content

Commit

Permalink
docs(installation): add chocolatey
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanKilleen authored and JanDeDobbeleer committed Sep 14, 2021
1 parent 86b3e1c commit 2dfa6a5
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions docs/docs/install-windows.mdx
Expand Up @@ -22,6 +22,7 @@ While Oh My Posh works on the standard terminal, we advise using the [Windows Te
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
Expand Down Expand Up @@ -57,6 +58,27 @@ If you want to use a standard theme, you can find them in `~\scoop\apps\oh-my-po
referencing them as such
will always keep them compatible with the binary when updating Oh My Posh.

</TabItem>
<TabItem value="chocolatey">

:::info
The chocolatey package is managed by [Curtis Carter][cc]. In case of problems, please create an issue [here][cc-choco].
:::

```powershell
choco install oh-my-posh
```

This installs a couple of things:

- `oh-my-posh.exe` - Windows executable, added to your `$PATH`
- `oh-my-posh-wsl` - Linux executable, added to your `$PATH` for use in the WSL
- `themes` - The latest Oh My Posh themes

If you want to use a standard theme, you can find them in `~\AppData\Local\Programs\oh-my-posh\themes\`,
referencing them as such
will always keep them compatible with the binary when updating Oh My Posh.

</TabItem>
</Tabs>

Expand All @@ -72,6 +94,7 @@ For the `$PATH` to reload, a reboot is advised.
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
Expand Down Expand Up @@ -101,6 +124,20 @@ Get-ChildItem -Path "$(scoop prefix oh-my-posh)\themes\*" -Include '*.omp.json'
}
```

</TabItem>
<TabItem value="chocolatey">

```powershell
Get-ChildItem -Path "~\AppData\Local\Programs\oh-my-posh\themes\*" -Include '*.omp.json' | Sort-Object Name | ForEach-Object -Process {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1m$($_.BaseName)$esc[0m"
Write-Host ""
oh-my-posh --config $($_.FullName) --pwd $PWD
Write-Host ""
}
```

</TabItem>
</Tabs>

Expand All @@ -112,6 +149,7 @@ Get-ChildItem -Path "$(scoop prefix oh-my-posh)\themes\*" -Include '*.omp.json'
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
Expand All @@ -127,6 +165,13 @@ winget upgrade JanDeDobbeleer.OhMyPosh
scoop update oh-my-posh
```

</TabItem>
<TabItem value="chocolatey">

```powershell
choco upgrade oh-my-posh
```

</TabItem>
</Tabs>

Expand All @@ -138,6 +183,7 @@ scoop update oh-my-posh
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
Expand All @@ -153,6 +199,13 @@ You can find the themes scoop installs inside the `"$(scoop prefix oh-my-posh)\t
To use `jandedobbeleer.omp.json` for example, you can refer to it using `"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`
when setting the prompt using the `--config` flag.

</TabItem>
<TabItem value="chocolatey">

You can find the themes winget installs inside the `~\AppData\Local\Programs\oh-my-posh\themes\` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
when setting the prompt using the `--config` flag.

</TabItem>
</Tabs>

Expand All @@ -165,6 +218,7 @@ Based on the installation method used, you can find this theme at the following
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
Expand All @@ -176,6 +230,11 @@ Based on the installation method used, you can find this theme at the following

`"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`

</TabItem>
<TabItem value="chocolatey">

`~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`

</TabItem>
</Tabs>

Expand Down Expand Up @@ -203,3 +262,5 @@ Inside the WSL, replace `~` with the following path: `/mnt/c/Users/<WINDOWSUSERN
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh
[cc]: https://github.com/digitalcoyote
[cc-choco]: https://github.com/digitalcoyote/chocolatey-packages/tree/master/oh-my-posh

0 comments on commit 2dfa6a5

Please sign in to comment.