Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding image/logo width #123

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion winfetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
Do not display any image or logo; display information only.
.PARAMETER logo
Sets the version of Windows to derive the logo from.
.PARAMETER imgwidth
Specify width for image/logo. Default is 35.
.PARAMETER blink
Make the logo blink.
.PARAMETER stripansi
Expand Down Expand Up @@ -74,6 +76,7 @@ param(
[ValidateSet("text", "bar", "textbar", "bartext")][string]$memorystyle = "text",
[ValidateSet("text", "bar", "textbar", "bartext")][string]$diskstyle = "text",
[ValidateSet("text", "bar", "textbar", "bartext")][string]$batterystyle = "text",
[ValidateScript({$_ -gt 1 -and $_ -lt $Host.UI.RawUI.WindowSize.Width-1})][alias('w')][int]$imgwidth = 35,
[array]$showdisks = @($env:SystemDrive),
[array]$showpkgs = @("scoop", "choco")
)
Expand Down Expand Up @@ -175,7 +178,6 @@ if ($help) {
$cimSession = New-CimSession
$buildVersion = "$([System.Environment]::OSVersion.Version)"
$os = Get-CimInstance -ClassName Win32_OperatingSystem -Property Caption,OSArchitecture -CimSession $cimSession
$COLUMNS = 35
$GAP = 3
Add-Type -TypeDefinition @'
using System;
Expand Down Expand Up @@ -255,6 +257,9 @@ $defaultConfig = @'
# Set the version of Windows to derive the logo from.
# $logo = "Windows 10"

# Specify width for image/logo
# $imgwidth = 40

# Make the logo blink
# $blink = $true

Expand Down Expand Up @@ -375,6 +380,7 @@ if ($config.GetType() -eq [string]) {
}

$t = if ($blink) { "5" } else { "1" }
$COLUMNS = $imgwidth

# ===== IMAGE =====
$img = if (-not $noimage) {
Expand Down