├── .gitignore ├── README.md ├── power-theme.psd1 ├── power-theme.psm1 ├── screenshots ├── customizePath.png ├── customizeTime.png ├── enableTheme.png ├── gitSupport.png └── pathToDefault.png ├── themeTemplate.ps1 └── themes ├── amuse.ps1 ├── pure.ps1 ├── robbyrussell.ps1 └── ys.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | 3 | *.swp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # power-theme 2 | 3 | a easy to use powershell theme manager 4 | 5 | ## installation 6 | 7 | ### how to install 8 | this project is currently in BETA. You need to manually clone to your local module folder. 9 | 10 | ``` 11 | git clone https://github.com/chantisnake/power-theme "$($($env:PSModulePath -split ';')[0])\power-theme" 12 | ``` 13 | 14 | In the future, [chocolatey](https://chocolatey.org/), [psGet](http://psget.net/), and install script will be supported 15 | 16 | ### dependency 17 | 18 | [posh-git](https://github.com/dahlbyk/posh-git) is required for git status, 19 | in the future there will be a feature to disable git status. 20 | 21 | [conemu](http://conemu.github.io/) and [PSReadLine](http://conemu.github.io/) is recommended for an even more gorgeous powershell 22 | 23 | ## feature 24 | 25 | * manage your theme in your `$PROFILE`, with simply `Enable-Theme ys`. 26 | * customize the theme you use with `$Global:THEME` variable 27 | * create you custom theme to contribute to the powershell community. 28 | 29 | ## screenshot 30 | 31 | ### enable the theme with one single command 32 | ![](https://github.com/chantisnake/power-theme/raw/master/screenshots/enableTheme.png) 33 | --- 34 | 35 | ### customize the displayed path 36 | ![](https://github.com/chantisnake/power-theme/raw/master/screenshots/customizePath.png) 37 | --- 38 | 39 | ### change the path back to default: just setting it to anything that can be cast to `$false` 40 | ![](https://github.com/chantisnake/power-theme/raw/master/screenshots/pathToDefault.png) 41 | --- 42 | 43 | ### customize the displayed date time, with the same rule as `Format` parameter in `Get-Date` function 44 | ![](https://github.com/chantisnake/power-theme/raw/master/screenshots/customizeTime.png) 45 | --- 46 | 47 | ### git is fully supported with the power of posh-git 48 | ![](https://github.com/chantisnake/power-theme/raw/master/screenshots/gitSupport.png) -------------------------------------------------------------------------------- /power-theme.psd1: -------------------------------------------------------------------------------- 1 | # 2 | # Module manifest for module 'power-theme' 3 | # 4 | # Generated by: zcsxo 5 | # 6 | # Generated on: 8/5/2016 7 | # 8 | 9 | @{ 10 | 11 | # Script module or binary module file associated with this manifest. 12 | RootModule = 'power-theme.psm1' 13 | 14 | # Version number of this module. 15 | ModuleVersion = '1.0' 16 | 17 | # Supported PSEditions 18 | # CompatiblePSEditions = @() 19 | 20 | # ID used to uniquely identify this module 21 | GUID = '3fdc7d19-c0f1-4ac5-931d-391db55d2539' 22 | 23 | # Author of this module 24 | Author = 'zcsxo' 25 | 26 | # Company or vendor of this module 27 | CompanyName = 'Unknown' 28 | 29 | # Copyright statement for this module 30 | Copyright = '(c) 2016 zcsxo. All rights reserved.' 31 | 32 | # Description of the functionality provided by this module 33 | Description = 'create and use powershell theme is much more easier' 34 | 35 | # Minimum version of the Windows PowerShell engine required by this module 36 | # PowerShellVersion = '' 37 | 38 | # Name of the Windows PowerShell host required by this module 39 | # PowerShellHostName = '' 40 | 41 | # Minimum version of the Windows PowerShell host required by this module 42 | # PowerShellHostVersion = '' 43 | 44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 45 | # DotNetFrameworkVersion = '' 46 | 47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. 48 | # CLRVersion = '' 49 | 50 | # Processor architecture (None, X86, Amd64) required by this module 51 | # ProcessorArchitecture = '' 52 | 53 | # Modules that must be imported into the global environment prior to importing this module 54 | RequiredModules = @() 55 | 56 | # Assemblies that must be loaded prior to importing this module 57 | # RequiredAssemblies = @() 58 | 59 | # Script files (.ps1) that are run in the caller's environment prior to importing this module. 60 | # ScriptsToProcess = @() 61 | 62 | # Type files (.ps1xml) to be loaded when importing this module 63 | # TypesToProcess = @() 64 | 65 | # Format files (.ps1xml) to be loaded when importing this module 66 | # FormatsToProcess = @() 67 | 68 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess 69 | # NestedModules = @() 70 | 71 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. 72 | FunctionsToExport = @('Enable-Theme', 'New-Theme', 'Get-ThemeDate', 'Get-ThemePath') 73 | 74 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. 75 | CmdletsToExport = @('Enable-Theme', 'New-Theme', 'Get-ThemeDate', 'Get-ThemePath') 76 | 77 | # Variables to export from this module 78 | VariablesToExport = '*' 79 | 80 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. 81 | AliasesToExport = @() 82 | 83 | # DSC resources to export from this module 84 | # DscResourcesToExport = @() 85 | 86 | # List of all modules packaged with this module 87 | # ModuleList = @() 88 | 89 | # List of all files packaged with this module 90 | # FileList = @() 91 | 92 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. 93 | PrivateData = @{ 94 | 95 | PSData = @{ 96 | 97 | # Tags applied to this module. These help with module discovery in online galleries. 98 | # Tags = @() 99 | 100 | # A URL to the license for this module. 101 | # LicenseUri = '' 102 | 103 | # A URL to the main website for this project. 104 | # ProjectUri = '' 105 | 106 | # A URL to an icon representing this module. 107 | # IconUri = '' 108 | 109 | # ReleaseNotes of this module 110 | # ReleaseNotes = '' 111 | 112 | } # End of PSData hashtable 113 | 114 | } # End of PrivateData hashtable 115 | 116 | # HelpInfo URI of this module 117 | # HelpInfoURI = '' 118 | 119 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. 120 | # DefaultCommandPrefix = '' 121 | 122 | } 123 | 124 | -------------------------------------------------------------------------------- /power-theme.psm1: -------------------------------------------------------------------------------- 1 | $global:THEME = @{ 2 | 'DateTimeFormat' = '' 3 | 'PathFormat' = '' 4 | } 5 | 6 | function Enable-Theme { 7 | param( 8 | [Parameter(Mandatory=$true, Position=0)] 9 | [string] $ThemeName 10 | ) 11 | $ThemeName = $ThemeName.ToLower(); # all the theme filename will be lower case 12 | 13 | $ThemeString = (Get-Content "$PSScriptRoot\themes\$ThemeName.ps1" -Encoding UTF8) -join "`r`n" 14 | 15 | Invoke-Expression $ThemeString # load the theme 16 | } 17 | 18 | function New-Theme { 19 | param( 20 | [Parameter(Mandatory=$true, Position=0)] 21 | [string] $ThemeName 22 | ) 23 | 24 | $ThemeName = $ThemeName.ToLower(); # all the theme filename will be lower case 25 | $ThemeFileFullName = Join-Path -Path $PSScriptRoot -ChildPath "themes\$ThemeName.ps1" # get the full path of the theme file 26 | 27 | # validate theme name 28 | if (Test-Path $ThemeFileFullName) { 29 | Write-Error 'Theme already exists, please give another name' 30 | return 31 | } 32 | 33 | # create theme from template 34 | Copy-Item -Path "$PSScriptRoot\themeTemplate.ps1" -Destination $ThemeFileFullName 35 | 36 | # log message 37 | Write-Host 'theme file successfully created in:' -ForegroundColor Green 38 | Write-Host $ThemeFileFullName -ForegroundColor Yellow 39 | } 40 | 41 | function Get-ThemeDate { 42 | param ( 43 | [Parameter(Mandatory=$false)] 44 | [string] $Format 45 | ) 46 | 47 | 48 | if ($THEME.DateTimeFormat) { # if user's setting exits 49 | $DateStr = Get-Date -Format $THEME.DateTimeFormat 50 | return $DateStr 51 | } 52 | elseif ($Format) { # if there is no user's setting, use developer setting 53 | $DateStr = Get-Date -Format $Format 54 | return $DateStr 55 | } 56 | else { # if all none, use default Get-Date 57 | $DateStr = Get-Date 58 | return $DateStr 59 | } 60 | 61 | } 62 | 63 | 64 | function Get-ThemePath { 65 | param ( 66 | [Parameter(Mandatory = $false)] 67 | [ValidateSet('concise', 'full', 'folder')] 68 | [string] $Format = 'folder' 69 | ) 70 | 71 | if ($THEME.PathFormat) { # user setting exist 72 | $pathStr = Get-ThemePathHelper -Format $THEME.PathFormat # use the user setting 73 | return $pathStr 74 | } 75 | elseif ($Format) { 76 | $pathStr = Get-ThemePathHelper -Format $Format # use the developer setting 77 | return $pathStr 78 | } 79 | 80 | } 81 | 82 | function Get-ThemePathHelper ($Format) { 83 | 84 | # concise path is a fish-like path format 85 | # it only display the first letter in each forlder, besides the current forlder 86 | # C:\path\to\current\folder will be displayed as C:\p\t\c\folder 87 | 88 | if ($Format -eq 'concise') { 89 | # split the path into a list 90 | $PathList = $PWD -split '\\' 91 | 92 | # only take the first letter in each folder name, except the Drive Letter and current folder 93 | $concisePathList = @($PathList[0]) # put the Drive Letter into the pathList 94 | foreach ($Path in $PathList[1..$($PathList.Length-2)]) { 95 | $concisePathList += $Path[0] 96 | } 97 | $concisePathList += $PathList[-1] 98 | 99 | # reconstruct the path string 100 | $concisePath = $concisePathList -join '\' 101 | 102 | return $concisePath 103 | } 104 | 105 | # only display the current folder 106 | elseif ($Format -eq 'folder') { 107 | $folderName = Split-Path $PWD -leaf 108 | return $folderName 109 | } 110 | 111 | # display the full path 112 | elseif ($Format -eq 'full') { 113 | return $PWD 114 | } 115 | 116 | # error 117 | else { 118 | Write-Error 'the path format you specify is not valid' 119 | return 120 | } 121 | } -------------------------------------------------------------------------------- /screenshots/customizePath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czhang03/power-theme/79c60be80e7c575c4f592dcd5d0def4560439f3d/screenshots/customizePath.png -------------------------------------------------------------------------------- /screenshots/customizeTime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czhang03/power-theme/79c60be80e7c575c4f592dcd5d0def4560439f3d/screenshots/customizeTime.png -------------------------------------------------------------------------------- /screenshots/enableTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czhang03/power-theme/79c60be80e7c575c4f592dcd5d0def4560439f3d/screenshots/enableTheme.png -------------------------------------------------------------------------------- /screenshots/gitSupport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czhang03/power-theme/79c60be80e7c575c4f592dcd5d0def4560439f3d/screenshots/gitSupport.png -------------------------------------------------------------------------------- /screenshots/pathToDefault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czhang03/power-theme/79c60be80e7c575c4f592dcd5d0def4560439f3d/screenshots/pathToDefault.png -------------------------------------------------------------------------------- /themeTemplate.ps1: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # setting for you Write-VCSStatus 3 | ########################################################################### 4 | # below is the default setting for git prompt, you can make you own 5 | # see: https://github.com/dahlbyk/posh-git/blob/master/GitPrompt.ps1 6 | 7 | # ONLY ENABLE THE ONES YOU CHANGED FOR EFFICIENCY 8 | 9 | # $global:GitPromptSettings.DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor 10 | 11 | # $global:GitPromptSettings.BeforeText = ' [' 12 | # $global:GitPromptSettings.BeforeForegroundColor = [ConsoleColor]::Yellow 13 | # $global:GitPromptSettings.BeforeBackgroundColor = $Host.UI.RawUI.BackgroundColor 14 | 15 | # $global:GitPromptSettings.DelimText = ' |' 16 | # $global:GitPromptSettings.DelimForegroundColor = [ConsoleColor]::Yellow 17 | # $global:GitPromptSettings.DelimBackgroundColor = $Host.UI.RawUI.BackgroundColor 18 | 19 | # $global:GitPromptSettings.AfterText = ']' 20 | # $global:GitPromptSettings.AfterForegroundColor = [ConsoleColor]::Yellow 21 | # $global:GitPromptSettings.AfterBackgroundColor = $Host.UI.RawUI.BackgroundColor 22 | 23 | # $global:GitPromptSettings.FileAddedText = '+' 24 | # $global:GitPromptSettings.FileModifiedText = '~' 25 | # $global:GitPromptSettings.FileRemovedText = '-' 26 | # $global:GitPromptSettings.FileConflictedText = '!' 27 | 28 | # $global:GitPromptSettings.LocalDefaultStatusSymbol = $null 29 | # $global:GitPromptSettings.LocalDefaultStatusForegroundColor = [ConsoleColor]::DarkGreen 30 | # $global:GitPromptSettings.LocalDefaultStatusForegroundBrightColor = [ConsoleColor]::Green 31 | # $global:GitPromptSettings.LocalDefaultStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 32 | 33 | # $global:GitPromptSettings.LocalWorkingStatusSymbol = '!' 34 | # $global:GitPromptSettings.LocalWorkingStatusForegroundColor = [ConsoleColor]::DarkRed 35 | # $global:GitPromptSettings.LocalWorkingStatusForegroundBrightColor = [ConsoleColor]::Red 36 | # $global:GitPromptSettings.LocalWorkingStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 37 | 38 | # $global:GitPromptSettings.LocalStagedStatusSymbol = '~' 39 | # $global:GitPromptSettings.LocalStagedStatusForegroundColor = [ConsoleColor]::Cyan 40 | # $global:GitPromptSettings.LocalStagedStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 41 | 42 | # $global:GitPromptSettings.BranchUntrackedSymbol = $null 43 | # $global:GitPromptSettings.BranchForegroundColor = [ConsoleColor]::Cyan 44 | # $global:GitPromptSettings.BranchBackgroundColor = $Host.UI.RawUI.BackgroundColor 45 | 46 | # $global:GitPromptSettings.BranchIdenticalStatusToSymbol = [char]0x2261 # Three horizontal lines 47 | # $global:GitPromptSettings.BranchIdenticalStatusToForegroundColor = [ConsoleColor]::Cyan 48 | # $global:GitPromptSettings.BranchIdenticalStatusToBackgroundColor = $Host.UI.RawUI.BackgroundColor 49 | 50 | # $global:GitPromptSettings.BranchAheadStatusSymbol = [char]0x2191 # Up arrow 51 | # $global:GitPromptSettings.BranchAheadStatusForegroundColor = [ConsoleColor]::Green 52 | # $global:GitPromptSettings.BranchAheadStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 53 | 54 | # $global:GitPromptSettings.BranchBehindStatusSymbol = [char]0x2193 # Down arrow 55 | # $global:GitPromptSettings.BranchBehindStatusForegroundColor = [ConsoleColor]::Red 56 | # $global:GitPromptSettings.BranchBehindStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 57 | 58 | # $global:GitPromptSettings.BranchBehindAndAheadStatusSymbol = [char]0x2195 # Up & Down arrow 59 | # $global:GitPromptSettings.BranchBehindAndAheadStatusForegroundColor = [ConsoleColor]::Yellow 60 | # $global:GitPromptSettings.BranchBehindAndAheadStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 61 | 62 | # $global:GitPromptSettings.BeforeIndexText = "" 63 | # $global:GitPromptSettings.BeforeIndexForegroundColor = [ConsoleColor]::DarkGreen 64 | # $global:GitPromptSettings.BeforeIndexForegroundBrightColor = [ConsoleColor]::Green 65 | # $global:GitPromptSettings.BeforeIndexBackgroundColor = $Host.UI.RawUI.BackgroundColor 66 | 67 | # $global:GitPromptSettings.IndexForegroundColor = [ConsoleColor]::DarkGreen 68 | # $global:GitPromptSettings.IndexForegroundBrightColor = [ConsoleColor]::Green 69 | # $global:GitPromptSettings.IndexBackgroundColor = $Host.UI.RawUI.BackgroundColor 70 | 71 | # $global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::DarkRed 72 | # $global:GitPromptSettings.WorkingForegroundBrightColor = [ConsoleColor]::Red 73 | # $global:GitPromptSettings.WorkingBackgroundColor = $Host.UI.RawUI.BackgroundColor 74 | 75 | # $global:GitPromptSettings.EnableStashStatus = $false 76 | # $global:GitPromptSettings.BeforeStashText = ' (' 77 | # $global:GitPromptSettings.BeforeStashBackgroundColor = $Host.UI.RawUI.BackgroundColor 78 | # $global:GitPromptSettings.BeforeStashForegroundColor = [ConsoleColor]::Red 79 | # $global:GitPromptSettings.AfterStashText = ')' 80 | 81 | # $global:GitPromptSettings.AfterStashBackgroundColor = $Host.UI.RawUI.BackgroundColor 82 | # $global:GitPromptSettings.AfterStashForegroundColor = [ConsoleColor]::Red 83 | # $global:GitPromptSettings.StashBackgroundColor = $Host.UI.RawUI.BackgroundColor 84 | # $global:GitPromptSettings.StashForegroundColor = [ConsoleColor]::Red 85 | 86 | # $global:GitPromptSettings.ShowStatusWhenZero = $true 87 | 88 | # $global:GitPromptSettings.AutoRefreshIndex = $true 89 | 90 | # $global:GitPromptSettings.EnablePromptStatus = !$Global:GitMissing 91 | # $global:GitPromptSettings.EnableFileStatus = $true 92 | # $global:GitPromptSettings.RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths 93 | # $global:GitPromptSettings.DescribeStyle = '' 94 | 95 | # $global:GitPromptSettings.EnableWindowTitle = 'posh~git ~ ' 96 | # $global:GitPromptSettings.Debug = $false 97 | # $global:GitPromptSettings.BranchNameLimit = 0 98 | # $global:GitPromptSettings.TruncatedBranchSuffix = '...' 99 | 100 | 101 | 102 | ############################################################## 103 | # begin of your prompt function 104 | ############################################################## 105 | 106 | function global:prompt { 107 | # do not remove this line 108 | # this line is to make sure the prompt function do not interfer with your exit code 109 | $RealExitCode = $LASTEXITCODE 110 | 111 | ############################################# 112 | # start of your theme 113 | ############################################# 114 | 115 | 116 | # use the line below to get current time. 117 | # format parameter obey the same rule as the format parameter in get-Date 118 | $time = Get-ThemeDate -Format 'hh:mm:ss' 119 | 120 | 121 | # use the line below to get current working directory path. 122 | # format parameter accepts 'concise', 'folder' and 'full', default is folder 123 | $path = Get-ThemePath -Format 'folder' 124 | 125 | 126 | 127 | ############################################# 128 | # end of your theme 129 | ############################################# 130 | 131 | # do not remove this line 132 | # this line is to make sure the prompt function do not interfer with your exit code 133 | $Global:LASTEXITCODE = $RealExitCode 134 | 135 | # you can change this line if you want 136 | return '> ' 137 | } -------------------------------------------------------------------------------- /themes/amuse.ps1: -------------------------------------------------------------------------------- 1 | function global:prompt { 2 | # do not remove this line 3 | # this line is to make sure the prompt function do not interfer with your exit code 4 | $RealExitCode = $LASTEXITCODE 5 | 6 | $Path = Get-ThemePath -Format "full" 7 | $time = Get-ThemeDate -Format "hh:mm:ss" 8 | 9 | Write-Host 10 | Write-Host $Path -NoNewline -ForegroundColor Green 11 | Write-VcsStatus 12 | Write-Host ' 🕒 ' -NoNewline 13 | Write-Host $time -ForegroundColor Magenta 14 | 15 | # do not remove this line 16 | # this line is to make sure the prompt function do not interfer with your exit code 17 | $Global:LASTEXITCODE = $RealExitCode 18 | return '> ' 19 | } -------------------------------------------------------------------------------- /themes/pure.ps1: -------------------------------------------------------------------------------- 1 | function global:prompt { 2 | # do not remove this line 3 | # this line is to make sure the prompt function do not interfer with your exit code 4 | $RealExitCode = $LASTEXITCODE 5 | 6 | 7 | $currentfolder = Get-ThemePath -Format 'folder' 8 | 9 | # newline 10 | Write-Host 11 | 12 | # first line 13 | Write-Host ' ' -NoNewLine 14 | Write-Host $currentfolder -NoNewLine -ForegroundColor Blue 15 | Write-Host ' ' -NoNewLine 16 | Write-VcsStatus 17 | Write-Host ' ' 18 | 19 | # second line 20 | Write-Host ' ' -NoNewLine 21 | if ($RealExitCode -ne 0) { 22 | Write-Host '〉' -NoNewline -ForegroundColor Red 23 | } 24 | else { 25 | Write-Host '〉' -NoNewline -ForegroundColor Magenta 26 | } 27 | 28 | # do not remove this line 29 | # this line is to make sure the prompt function do not interfer with your exit code 30 | $Global:LASTEXITCODE = $RealExitCode 31 | return ' ' 32 | } -------------------------------------------------------------------------------- /themes/robbyrussell.ps1: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # setting for you Write-VCSStatus 3 | ########################################################################### 4 | # below is the default setting for git prompt, you can make you own 5 | # see: https://github.com/dahlbyk/posh-git/blob/master/GitPrompt.ps1 6 | 7 | # $global:GitPromptSettings.DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor 8 | 9 | $global:GitPromptSettings.BeforeText = ' git( ' 10 | $global:GitPromptSettings.BeforeForegroundColor = [ConsoleColor]::DarkBlue 11 | # $global:GitPromptSettings.BeforeBackgroundColor = $Host.UI.RawUI.BackgroundColor 12 | 13 | # $global:GitPromptSettings.DelimText = ' |' 14 | # $global:GitPromptSettings.DelimForegroundColor = [ConsoleColor]::Yellow 15 | # $global:GitPromptSettings.DelimBackgroundColor = $Host.UI.RawUI.BackgroundColor 16 | 17 | $global:GitPromptSettings.AfterText = ' )' 18 | $global:GitPromptSettings.AfterForegroundColor = [ConsoleColor]::DarkBlue 19 | # $global:GitPromptSettings.AfterBackgroundColor = $Host.UI.RawUI.BackgroundColor 20 | 21 | # $global:GitPromptSettings.FileAddedText = '+' 22 | # $global:GitPromptSettings.FileModifiedText = '~' 23 | # $global:GitPromptSettings.FileRemovedText = '-' 24 | # $global:GitPromptSettings.FileConflictedText = '!' 25 | 26 | # $global:GitPromptSettings.LocalDefaultStatusSymbol = $null 27 | # $global:GitPromptSettings.LocalDefaultStatusForegroundColor = [ConsoleColor]::DarkGreen 28 | # $global:GitPromptSettings.LocalDefaultStatusForegroundBrightColor = [ConsoleColor]::Green 29 | # $global:GitPromptSettings.LocalDefaultStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 30 | 31 | # $global:GitPromptSettings.LocalWorkingStatusSymbol = '!' 32 | # $global:GitPromptSettings.LocalWorkingStatusForegroundColor = [ConsoleColor]::DarkRed 33 | # $global:GitPromptSettings.LocalWorkingStatusForegroundBrightColor = [ConsoleColor]::Red 34 | # $global:GitPromptSettings.LocalWorkingStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 35 | 36 | # $global:GitPromptSettings.LocalStagedStatusSymbol = '~' 37 | # $global:GitPromptSettings.LocalStagedStatusForegroundColor = [ConsoleColor]::Cyan 38 | # $global:GitPromptSettings.LocalStagedStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 39 | 40 | # $global:GitPromptSettings.BranchUntrackedSymbol = $null 41 | # $global:GitPromptSettings.BranchForegroundColor = [ConsoleColor]::Cyan 42 | # $global:GitPromptSettings.BranchBackgroundColor = $Host.UI.RawUI.BackgroundColor 43 | 44 | # $global:GitPromptSettings.BranchIdenticalStatusToSymbol = [char]0x2261 # Three horizontal lines 45 | # $global:GitPromptSettings.BranchIdenticalStatusToForegroundColor = [ConsoleColor]::Cyan 46 | # $global:GitPromptSettings.BranchIdenticalStatusToBackgroundColor = $Host.UI.RawUI.BackgroundColor 47 | 48 | # $global:GitPromptSettings.BranchAheadStatusSymbol = [char]0x2191 # Up arrow 49 | # $global:GitPromptSettings.BranchAheadStatusForegroundColor = [ConsoleColor]::Green 50 | # $global:GitPromptSettings.BranchAheadStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 51 | 52 | # $global:GitPromptSettings.BranchBehindStatusSymbol = [char]0x2193 # Down arrow 53 | # $global:GitPromptSettings.BranchBehindStatusForegroundColor = [ConsoleColor]::Red 54 | # $global:GitPromptSettings.BranchBehindStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 55 | 56 | # $global:GitPromptSettings.BranchBehindAndAheadStatusSymbol = [char]0x2195 # Up & Down arrow 57 | # $global:GitPromptSettings.BranchBehindAndAheadStatusForegroundColor = [ConsoleColor]::Yellow 58 | # $global:GitPromptSettings.BranchBehindAndAheadStatusBackgroundColor = $Host.UI.RawUI.BackgroundColor 59 | 60 | # $global:GitPromptSettings.BeforeIndexText = "" 61 | # $global:GitPromptSettings.BeforeIndexForegroundColor = [ConsoleColor]::DarkGreen 62 | # $global:GitPromptSettings.BeforeIndexForegroundBrightColor = [ConsoleColor]::Green 63 | # $global:GitPromptSettings.BeforeIndexBackgroundColor = $Host.UI.RawUI.BackgroundColor 64 | 65 | # $global:GitPromptSettings.IndexForegroundColor = [ConsoleColor]::DarkGreen 66 | # $global:GitPromptSettings.IndexForegroundBrightColor = [ConsoleColor]::Green 67 | # $global:GitPromptSettings.IndexBackgroundColor = $Host.UI.RawUI.BackgroundColor 68 | 69 | # $global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::DarkRed 70 | # $global:GitPromptSettings.WorkingForegroundBrightColor = [ConsoleColor]::Red 71 | # $global:GitPromptSettings.WorkingBackgroundColor = $Host.UI.RawUI.BackgroundColor 72 | 73 | # $global:GitPromptSettings.EnableStashStatus = $false 74 | # $global:GitPromptSettings.BeforeStashText = ' (' 75 | # $global:GitPromptSettings.BeforeStashBackgroundColor = $Host.UI.RawUI.BackgroundColor 76 | # $global:GitPromptSettings.BeforeStashForegroundColor = [ConsoleColor]::Red 77 | # $global:GitPromptSettings.AfterStashText = ')' 78 | 79 | # $global:GitPromptSettings.AfterStashBackgroundColor = $Host.UI.RawUI.BackgroundColor 80 | # $global:GitPromptSettings.AfterStashForegroundColor = [ConsoleColor]::Red 81 | # $global:GitPromptSettings.StashBackgroundColor = $Host.UI.RawUI.BackgroundColor 82 | # $global:GitPromptSettings.StashForegroundColor = [ConsoleColor]::Red 83 | 84 | # $global:GitPromptSettings.ShowStatusWhenZero = $true 85 | 86 | # $global:GitPromptSettings.AutoRefreshIndex = $true 87 | 88 | # $global:GitPromptSettings.EnablePromptStatus = !$Global:GitMissing 89 | # $global:GitPromptSettings.EnableFileStatus = $true 90 | # $global:GitPromptSettings.RepositoriesInWhichToDisableFileStatus = @( ) # Array of repository paths 91 | # $global:GitPromptSettings.DescribeStyle = '' 92 | 93 | $global:GitPromptSettings.EnableWindowTitle = '' 94 | # $global:GitPromptSettings.Debug = $false 95 | # $global:GitPromptSettings.BranchNameLimit = 0 96 | # $global:GitPromptSettings.TruncatedBranchSuffix = '...' 97 | 98 | function global:prompt { 99 | # do not remove this line 100 | # this line is to make sure the prompt function do not interfer with your exit code 101 | $RealExitCode = $LASTEXITCODE 102 | 103 | $currentFolder = Get-ThemePath 104 | 105 | Write-Host $currentFolder -NoNewline -ForegroundColor Cyan 106 | Write-VcsStatus 107 | Write-Host ' ' -NoNewline 108 | Write-Host '→' -NoNewline -ForegroundColor Magenta 109 | 110 | # do not remove this line 111 | # this line is to make sure the prompt function do not interfer with your exit code 112 | $Global:LASTEXITCODE = $RealExitCode 113 | return ' ' 114 | } 115 | -------------------------------------------------------------------------------- /themes/ys.ps1: -------------------------------------------------------------------------------- 1 | function global:prompt { 2 | # do not remove this line 3 | # this line is to make sure the prompt function do not interfer with your exit code 4 | $RealExitCode = $LASTEXITCODE 5 | 6 | ############################################# 7 | # start of your theme 8 | ############################################# 9 | 10 | $path = Get-ThemePath -Format 'folder' 11 | $Date = Get-ThemeDate 12 | 13 | Write-Host 14 | Write-Host "# " -NoNewline -ForegroundColor Blue 15 | Write-Host $env:USERNAME -NoNewline -ForegroundColor Cyan 16 | Write-Host " in " -NoNewline 17 | Write-Host "$path " -NoNewline -ForegroundColor Green 18 | Write-VcsStatus 19 | Write-Host " $Date" 20 | Write-Host ">" -NoNewline -ForegroundColor Magenta 21 | 22 | 23 | ############################################# 24 | # end of your theme 25 | ############################################# 26 | 27 | # do not remove this line 28 | # this line is to make sure the prompt function do not interfer with your exit code 29 | $Global:LASTEXITCODE = $RealExitCode 30 | 31 | # you can change this line if you want 32 | return ' ' 33 | } --------------------------------------------------------------------------------