docs(windows): simplify installation guide

This commit is contained in:
Jan De Dobbeleer 2021-11-28 15:21:27 +01:00 committed by Jan De Dobbeleer
parent a2be3faefe
commit 64a9e65e74
5 changed files with 20 additions and 53 deletions

View file

@ -8,7 +8,7 @@ functionality, going through the additional steps below will help you get starte
We downloaded all the themes and set `jandedobbeleer.omp.json` as the one to use.
However, there are [a lot more][themes] to be discovered and maybe there are some you like better.
## Override the theme settings
### Override the theme settings
Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you
want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through all

View file

@ -10,7 +10,7 @@ brew install oh-my-posh
This installs two things:
- `oh-my-posh` - Executable, added to `/usr/local/bin`
- `themes` - The latest Oh My Posh themes
- `themes` - The latest Oh My Posh [themes][themes]
If you want to use a standard theme, you can find them in `$(brew --prefix oh-my-posh)/themes`, referencing them as such
will always keep them compatible with the binary when updating Oh My Posh.
@ -33,3 +33,4 @@ The guides below assume you copied the theme called `jandedobbeleer.omp.json` to
When using brew, you can find this one at `$(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json`.
[brew]: https://brew.sh
[themes]: https://ohmyposh.dev/docs/themes

View file

@ -2,8 +2,7 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
:::tip
If you have no idea which shell you're currently using, Oh My Posh has a utility switch that can tell that to you (not relevant
for the Powershell module).
If you have no idea which shell you're currently using, Oh My Posh has a utility switch that can tell that to you.
:::
```bash

View file

@ -42,19 +42,19 @@ scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/downl
</TabItem>
<TabItem value="powershell">
:::warning
The PowerShell module only installs the Oh My Posh execuatble inside PowerShell, to use Oh My posh outside of PowerShell,
add the following folder to your `$PATH`:
```powershell
"$((Get-Item (Get-Module oh-my-posh).ModuleBase).Parent.FullName)"
```
:::
```powershell
Install-Module oh-my-posh -Scope CurrentUser
```
:::warning
The PowerShell module only installs the Oh My Posh executable inside PowerShell, to use Oh My posh outside of PowerShell
(bash, cmd, ...), add the following folder to your `$PATH`:
```powershell
$env:POSH_PATH
```
:::
</TabItem>
<TabItem value="chocolatey">
@ -71,10 +71,10 @@ choco install oh-my-posh
This installs a couple of things:
- `oh-my-posh.exe` - Windows executable, added to your `$PATH`
- `oh-my-posh.exe` - Windows executable
- `themes` - The latest Oh My Posh [themes][themes]
For the `$PATH` to reload, a reboot is advised.
For the `$PATH` to reload, a restart of your shell session is advised.
## Update
@ -146,8 +146,8 @@ when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="powershell">
You can find the themes PowerShell installs inside the `"$((Get-Module oh-my-posh).ModuleBase)\themes\"` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `"$((Get-Module oh-my-posh).ModuleBase)\themes\jandedobbeleer.omp.json"`
You can find the themes PowerShell installs inside the `$env:POSH_THEMES_PATH` folder.
To use `jandedobbeleer.omp.json` for example, you can refer to it using `"$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"`
when setting the prompt using the `--config` flag.
</TabItem>
@ -161,39 +161,6 @@ when setting the prompt using the `--config` flag.
</Tabs>
The guides below assume you copied the theme called `jandedobbeleer.omp.json` to your user's `$HOME` folder.
Based on the installation method used, you can find this theme at the following location:
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'powershell', value: 'powershell', },
{ label: 'chocolatey', value: 'chocolatey'},
]
}>
<TabItem value="winget">
`~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
</TabItem>
<TabItem value="scoop">
`"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`
</TabItem>
<TabItem value="powershell">
`"$((Get-Module oh-my-posh).ModuleBase)\themes\jandedobbeleer.omp.json"`
</TabItem>
<TabItem value="chocolatey">
`~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json`
</TabItem>
</Tabs>
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [linux](linux) installation guide.

View file

@ -1,6 +1,6 @@
$artifactPath = "$((Get-Item $MyInvocation.MyCommand.ScriptBlock.Module.ModuleBase).Parent.FullName)"
$env:POSH_THEMES_PATH = $artifactPath + "/themes"
$env:PATH = "$artifactPath;$env:PATH"
$env:POSH_PATH = "$((Get-Item $MyInvocation.MyCommand.ScriptBlock.Module.ModuleBase).Parent.FullName)"
$env:POSH_THEMES_PATH = $env:POSH_PATH + "/themes"
$env:PATH = "$env:POSH_PATH;$env:PATH"
function Get-PoshDownloadUrl {
param(