diff --git a/Themes/Agnoster.psm1 b/Themes/Agnoster.psm1 index 4e993442..8ed25681 100644 --- a/Themes/Agnoster.psm1 +++ b/Themes/Agnoster.psm1 @@ -23,7 +23,7 @@ function Write-Theme { $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor } - $user = [System.Environment]::UserName + $user = $sl.CurrentUser $computer = [System.Environment]::MachineName if (Test-NotDefaultUser($user)) { $prompt += Write-Prompt -Object "$user@$computer " -ForegroundColor $sl.Colors.SessionInfoForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor @@ -71,4 +71,4 @@ $sl.Colors.GitForegroundColor = [ConsoleColor]::Black $sl.Colors.WithForegroundColor = [ConsoleColor]::White $sl.Colors.WithBackgroundColor = [ConsoleColor]::DarkRed $sl.Colors.VirtualEnvBackgroundColor = [System.ConsoleColor]::Red -$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White \ No newline at end of file +$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White diff --git a/Themes/Darkblood.psm1 b/Themes/Darkblood.psm1 index 023e6d84..74524a89 100644 --- a/Themes/Darkblood.psm1 +++ b/Themes/Darkblood.psm1 @@ -10,7 +10,7 @@ function Write-Theme { ) $prompt = Write-Prompt -Object ([char]::ConvertFromUtf32(0x250C)) -ForegroundColor $sl.Colors.PromptSymbolColor - $user = [System.Environment]::UserName + $user = $sl.CurrentUser $prompt += Write-Segment -content $user -foregroundColor $sl.Colors.PromptForegroundColor # $prompt += "$($sl.PromptSymbols.SegmentForwardSymbol) " @@ -82,4 +82,4 @@ $sl.Colors.GitForegroundColor = [ConsoleColor]::White $sl.Colors.WithForegroundColor = [ConsoleColor]::DarkYellow $sl.Colors.WithBackgroundColor = [ConsoleColor]::Magenta $sl.Colors.VirtualEnvBackgroundColor = [System.ConsoleColor]::Magenta -$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White \ No newline at end of file +$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White diff --git a/Themes/Fish.psm1 b/Themes/Fish.psm1 index f1d4fd1b..f4bce2d6 100644 --- a/Themes/Fish.psm1 +++ b/Themes/Fish.psm1 @@ -32,7 +32,7 @@ function Write-Theme { $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor } - $user = [System.Environment]::UserName + $user = $sl.CurrentUser $computer = [System.Environment]::MachineName $path = Get-FullPath -dir $pwd if (Test-NotDefaultUser($user)) { diff --git a/Themes/Honukai.psm1 b/Themes/Honukai.psm1 index 7d28e5d3..7eb6e6f3 100644 --- a/Themes/Honukai.psm1 +++ b/Themes/Honukai.psm1 @@ -11,7 +11,7 @@ function Write-Theme { # write # and space $prompt = Write-Prompt -Object $sl.PromptSymbols.StartSymbol -ForegroundColor $sl.Colors.PromptHighlightColor # write user - $user = [System.Environment]::UserName + $user = $sl.CurrentUser if (Test-NotDefaultUser($user)) { $prompt += Write-Prompt -Object " $user" -ForegroundColor $sl.Colors.PromptHighlightColor # write at (devicename) diff --git a/Themes/Paradox.psm1 b/Themes/Paradox.psm1 index 52af431a..69e91339 100644 --- a/Themes/Paradox.psm1 +++ b/Themes/Paradox.psm1 @@ -21,7 +21,7 @@ function Write-Theme { $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor } - $user = [System.Environment]::UserName + $user = $sl.CurrentUser $computer = [System.Environment]::MachineName $path = Get-FullPath -dir $pwd if (Test-NotDefaultUser($user)) { diff --git a/Themes/PowerLine.psm1 b/Themes/PowerLine.psm1 index 3d75026f..de9471b1 100644 --- a/Themes/PowerLine.psm1 +++ b/Themes/PowerLine.psm1 @@ -23,7 +23,7 @@ function Write-Theme { $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor } - $user = [System.Environment]::UserName + $user = $sl.CurrentUser $computer = [System.Environment]::MachineName if (Test-NotDefaultUser($user)) { $prompt += Write-Prompt -Object "$user@$computer " -ForegroundColor $sl.Colors.SessionInfoForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor @@ -41,7 +41,7 @@ function Write-Theme { # Writes the drive portion $path = (Get-FullPath -dir $pwd).Replace('\', ' ' + [char]::ConvertFromUtf32(0xE0B1) + ' ') + ' ' $prompt += Write-Prompt -Object $path -ForegroundColor $sl.Colors.PromptForegroundColor -BackgroundColor $sl.Colors.PromptBackgroundColor - + $status = Get-VCSStatus if ($status) { $themeInfo = Get-VcsInfo -status ($status) @@ -72,4 +72,4 @@ $sl.Colors.GitForegroundColor = [ConsoleColor]::DarkGray $sl.Colors.WithForegroundColor = [ConsoleColor]::White $sl.Colors.WithBackgroundColor = [ConsoleColor]::DarkRed $sl.Colors.VirtualEnvBackgroundColor = [System.ConsoleColor]::Red -$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White \ No newline at end of file +$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White diff --git a/Themes/Sorin.psm1 b/Themes/Sorin.psm1 index 77c78571..0b1782b0 100644 --- a/Themes/Sorin.psm1 +++ b/Themes/Sorin.psm1 @@ -18,7 +18,7 @@ function Write-Theme { $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor } - $user = [System.Environment]::UserName + $user = $sl.CurrentUser if (Test-NotDefaultUser($user)) { $prompt += Write-Prompt -Object "$user " -ForegroundColor $sl.Colors.PromptForegroundColor } diff --git a/Themes/tehrob.psm1 b/Themes/tehrob.psm1 index f9f2a76a..eb0e15b4 100644 --- a/Themes/tehrob.psm1 +++ b/Themes/tehrob.psm1 @@ -9,7 +9,7 @@ function Write-Theme $with ) - $user = [System.Environment]::UserName + $user = $s1.CurrentUser $prompt = Write-Prompt -Object "$user " -ForegroundColor $s1.Colors.PromptForegroundColor $prompt += Write-Prompt -Object ":: " -ForegroundColor $s1.Colors.AdminIconForegroundColor $prompt += Write-Prompt -Object "$(Get-FullPath -dir $pwd) " -ForegroundColor $s1.Colors.DriveForegroundColor @@ -38,4 +38,4 @@ $s1.PromptSymbols.PromptIndicator = [char]::ConvertFromUtf32(0x00BB) # Colors $s1.Colors.PromptForegroundColor = [ConsoleColor]::White $s1.Colors.AdminIconForegroundColor = [ConsoleColor]::Blue -$s1.Colors.DriveForegroundColor = [ConsoleColor]::Green \ No newline at end of file +$s1.Colors.DriveForegroundColor = [ConsoleColor]::Green diff --git a/defaults.ps1 b/defaults.ps1 index 546987d0..64610ef4 100644 --- a/defaults.ps1 +++ b/defaults.ps1 @@ -1,9 +1,10 @@ # Oh-My-Posh default settings $global:ThemeSettings = New-Object -TypeName PSObject -Property @{ - CurrentThemeLocation = "$PSScriptRoot\Themes\Agnoster.psm1" - MyThemesLocation = (Join-Path (Split-Path -Parent $PROFILE) "PoshThemes") - ErrorCount = 0 - GitSymbols = @{ + CurrentUser = [System.Environment]::UserName + CurrentThemeLocation = "$PSScriptRoot\Themes\Agnoster.psm1" + MyThemesLocation = (Join-Path (Split-Path -Parent $PROFILE) "PoshThemes") + ErrorCount = 0 + GitSymbols = @{ BranchSymbol = [char]::ConvertFromUtf32(0xE0A0) BeforeStashSymbol = '{' BeforeIndexSymbol = '' @@ -17,25 +18,25 @@ $global:ThemeSettings = New-Object -TypeName PSObject -Property @{ BranchIdenticalStatusToSymbol = [char]::ConvertFromUtf32(0x2263) BranchAheadStatusSymbol = [char]::ConvertFromUtf32(0x2191) BranchBehindStatusSymbol = [char]::ConvertFromUtf32(0x2193) - OriginSymbols = @{ - Enabled = $false - Github = [char]::ConvertFromUtf32(0xF09B) - Bitbucket = [char]::ConvertFromUtf32(0xF171) - GitLab = [char]::ConvertFromUtf32(0xF296) + OriginSymbols = @{ + Enabled = $false + Github = [char]::ConvertFromUtf32(0xF09B) + Bitbucket = [char]::ConvertFromUtf32(0xF171) + GitLab = [char]::ConvertFromUtf32(0xF296) } } - PromptSymbols = @{ - StartSymbol = ' ' - TruncatedFolderSymbol = '..' - PromptIndicator = [char]::ConvertFromUtf32(0x25B6) - FailedCommandSymbol = [char]::ConvertFromUtf32(0x2A2F) - ElevatedSymbol = [char]::ConvertFromUtf32(0x26A1) - SegmentForwardSymbol = [char]::ConvertFromUtf32(0xE0B0) - SegmentBackwardSymbol = [char]::ConvertFromUtf32(0x26A1) - SegmentSeparatorForwardSymbol = [char]::ConvertFromUtf32(0x26A1) - SegmentSeparatorBackwardSymbol = [char]::ConvertFromUtf32(0x26A1) - PathSeparator = [System.IO.Path]::DirectorySeparatorChar - VirtualEnvSymbol = [char]::ConvertFromUtf32(0xE606) + PromptSymbols = @{ + StartSymbol = ' ' + TruncatedFolderSymbol = '..' + PromptIndicator = [char]::ConvertFromUtf32(0x25B6) + FailedCommandSymbol = [char]::ConvertFromUtf32(0x2A2F) + ElevatedSymbol = [char]::ConvertFromUtf32(0x26A1) + SegmentForwardSymbol = [char]::ConvertFromUtf32(0xE0B0) + SegmentBackwardSymbol = [char]::ConvertFromUtf32(0x26A1) + SegmentSeparatorForwardSymbol = [char]::ConvertFromUtf32(0x26A1) + SegmentSeparatorBackwardSymbol = [char]::ConvertFromUtf32(0x26A1) + PathSeparator = [System.IO.Path]::DirectorySeparatorChar + VirtualEnvSymbol = [char]::ConvertFromUtf32(0xE606) } Colors = @{ GitDefaultColor = [ConsoleColor]::DarkGreen