diff --git a/winfetch.ps1 b/winfetch.ps1 index 2462a42..a400c8c 100644 --- a/winfetch.ps1 +++ b/winfetch.ps1 @@ -30,8 +30,8 @@ Specify a path to a custom config file. .PARAMETER noimage Do not display any image or logo; display information only. -.PARAMETER legacylogo - Use legacy Windows logo. +.PARAMETER switchlogo + Switch the default Windows logo. .PARAMETER blink Make the logo blink. .PARAMETER stripansi @@ -65,7 +65,7 @@ param( [switch][alias('g')]$genconf, [string][alias('c')]$configpath, [switch][alias('n')]$noimage, - [switch][alias('l')]$legacylogo, + [switch][alias('l')]$switchlogo, [switch][alias('b')]$blink, [switch][alias('s')]$stripansi, [switch][alias('a')]$all, @@ -171,7 +171,8 @@ if ($help) { # ===== VARIABLES ===== $cimSession = New-CimSession -$t = if ($blink) { "5" } else { "1" } +$buildVersion = "$([System.Environment]::OSVersion.Version)" +$legacylogo = $buildVersion -like "6.1*" # ===== CONFIGURATION ===== @@ -207,8 +208,8 @@ $defaultConfig = @' # $image = "~/winfetch.png" # $noimage = $true -# Use legacy Windows logo -# $legacylogo = $true +# Switch the default Windows logo +# $switchlogo = $true # Make the logo blink # $blink = $true @@ -312,6 +313,8 @@ if ($config.GetType() -eq [string]) { $config += @("blank", "colorbar") } +$t = if ($blink) { "5" } else { "1" } +if ($switchlogo) { $legacylogo = -not $legacylogo } # ===== IMAGE ===== $img = if (-not $noimage) { @@ -454,14 +457,14 @@ function info_motherboard { function info_title { return @{ title = "" - content = "${e}[1;34m{0}${e}[0m@${e}[1;34m{1}${e}[0m" -f [Environment]::UserName,$env:COMPUTERNAME + content = "${e}[1;34m{0}${e}[0m@${e}[1;34m{1}${e}[0m" -f [System.Environment]::UserName,$env:COMPUTERNAME } } # ===== DASHES ===== function info_dashes { - $length = [Environment]::UserName.Length + $env:COMPUTERNAME.Length + 1 + $length = [System.Environment]::UserName.Length + $env:COMPUTERNAME.Length + 1 return @{ title = "" content = "-" * $length @@ -483,11 +486,7 @@ function info_computer { function info_kernel { return @{ title = "Kernel" - content = if ($IsWindows -or $PSVersionTable.PSVersion.Major -eq 5) { - "$([System.Environment]::OSVersion.Version)" - } else { - "$(uname -r)" - } + content = $buildVersion } }