Skip to content

Commit

Permalink
Merge pull request #66 from lptstr/sane-logo
Browse files Browse the repository at this point in the history
Make sane defaults for logo
  • Loading branch information
rashil2000 authored Mar 3, 2021
2 parents af0c386 + f94b96f commit 0ec5e86
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions winfetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 =====
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}

Expand Down

0 comments on commit 0ec5e86

Please sign in to comment.