docs(installation): add chocolatey

This commit is contained in:
Sean Killeen 2021-09-08 13:19:58 -04:00 committed by Jan De Dobbeleer
parent 86b3e1cc62
commit 2dfa6a5a98
No known key found for this signature in database
GPG key ID: F6CC273CE5BA9AEE

View file

@ -22,6 +22,7 @@ While Oh My Posh works on the standard terminal, we advise using the [Windows Te
values={[ values={[
{ label: 'winget', value: 'winget', }, { label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', }, { label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
] ]
}> }>
<TabItem value="winget"> <TabItem value="winget">
@ -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 referencing them as such
will always keep them compatible with the binary when updating Oh My Posh. 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> </TabItem>
</Tabs> </Tabs>
@ -72,6 +94,7 @@ For the `$PATH` to reload, a reboot is advised.
values={[ values={[
{ label: 'winget', value: 'winget', }, { label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', }, { label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
] ]
}> }>
<TabItem value="winget"> <TabItem value="winget">
@ -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> </TabItem>
</Tabs> </Tabs>
@ -112,6 +149,7 @@ Get-ChildItem -Path "$(scoop prefix oh-my-posh)\themes\*" -Include '*.omp.json'
values={[ values={[
{ label: 'winget', value: 'winget', }, { label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', }, { label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
] ]
}> }>
<TabItem value="winget"> <TabItem value="winget">
@ -127,6 +165,13 @@ winget upgrade JanDeDobbeleer.OhMyPosh
scoop update oh-my-posh scoop update oh-my-posh
``` ```
</TabItem>
<TabItem value="chocolatey">
```powershell
choco upgrade oh-my-posh
```
</TabItem> </TabItem>
</Tabs> </Tabs>
@ -138,6 +183,7 @@ scoop update oh-my-posh
values={[ values={[
{ label: 'winget', value: 'winget', }, { label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', }, { label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
] ]
}> }>
<TabItem value="winget"> <TabItem value="winget">
@ -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"` 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. 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> </TabItem>
</Tabs> </Tabs>
@ -165,6 +218,7 @@ Based on the installation method used, you can find this theme at the following
values={[ values={[
{ label: 'winget', value: 'winget', }, { label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', }, { label: 'scoop', value: 'scoop', },
{ label: 'chocolatey', value: 'chocolatey'},
] ]
}> }>
<TabItem value="winget"> <TabItem value="winget">
@ -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"` `"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`
</TabItem>
<TabItem value="chocolatey">
`~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
</TabItem> </TabItem>
</Tabs> </Tabs>
@ -203,3 +262,5 @@ Inside the WSL, replace `~` with the following path: `/mnt/c/Users/<WINDOWSUSERN
[scoop]: https://scoop.sh/ [scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal [wt]: https://github.com/microsoft/terminal
[powershell]: https://www.powershellgallery.com/packages/oh-my-posh [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