Created
June 4, 2020 23:37
-
-
Save slanterns/e5b891afaa9683a2f46e3c3cd0fa763d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 2 -Modules posh-git | |
function Write-Theme { | |
param( | |
[bool] | |
$lastCommandFailed, | |
[string] | |
$with | |
) | |
# Writes the drive portion | |
$drive = $pwd.Path + '>' | |
$prompt += Write-Prompt -Object $drive -ForegroundColor $sl.Colors.DriveForegroundColor | |
$status = Get-VCSStatus | |
if ($status) { | |
$prompt += Write-Prompt -Object " git:(" -ForegroundColor $sl.Colors.PromptHighlightColor | |
$prompt += Write-Prompt -Object "$($status.Branch)" -ForegroundColor $sl.Colors.WithForegroundColor | |
$prompt += Write-Prompt -Object ")" -ForegroundColor $sl.Colors.PromptHighlightColor | |
if ($status.Working.Length -gt 0) { | |
$prompt += Write-Prompt -Object (" " + $sl.PromptSymbols.GitDirtyIndicator) -ForegroundColor $sl.Colors.GitDefaultColor | |
} | |
} | |
$prompt += ' ' | |
$prompt | |
} | |
$sl = $global:ThemeSettings #local settings | |
$sl.PromptSymbols.PromptIndicator = [char]::ConvertFromUtf32(0x279C) | |
$sl.Colors.PromptSymbolColor = [ConsoleColor]::Green | |
$sl.Colors.PromptHighlightColor = [ConsoleColor]::Blue | |
$sl.Colors.DriveForegroundColor = [ConsoleColor]::Cyan | |
$sl.Colors.WithForegroundColor = [ConsoleColor]::Red | |
$sl.PromptSymbols.GitDirtyIndicator = [char]::ConvertFromUtf32(10007) | |
$sl.Colors.GitDefaultColor = [ConsoleColor]::Yellow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment