Update
This commit is contained in:
@@ -46,9 +46,13 @@ Non-interactive / re-install:
|
|||||||
Test it manually any time with:
|
Test it manually any time with:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Show-J621Greeting
|
greeting
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The profile block also installs a `greeting` helper that (re)sources
|
||||||
|
`J621Greeting.ps1` and runs `Show-J621Greeting`, so it works even when the
|
||||||
|
automatic interactive greeting was skipped.
|
||||||
|
|
||||||
Requirements: `fastfetch` and `curl.exe` (ships with Windows 10 1803+).
|
Requirements: `fastfetch` and `curl.exe` (ships with Windows 10 1803+).
|
||||||
Image logos need Windows Terminal 1.22+ (sixel) or WezTerm with kitty
|
Image logos need Windows Terminal 1.22+ (sixel) or WezTerm with kitty
|
||||||
graphics enabled; other terminals fall back to a plain fastfetch.
|
graphics enabled; other terminals fall back to a plain fastfetch.
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ function Get-InstalledConfigValue {
|
|||||||
param([string]$Name)
|
param([string]$Name)
|
||||||
if (-not (Test-Path -LiteralPath $configFile)) { return $null }
|
if (-not (Test-Path -LiteralPath $configFile)) { return $null }
|
||||||
$content = Get-Content -LiteralPath $configFile -Raw
|
$content = Get-Content -LiteralPath $configFile -Raw
|
||||||
|
# Ignore commented-out lines: the config ships an example token line, and
|
||||||
|
# matching it would make us probe with the placeholder as a real token.
|
||||||
|
$content = (@($content -split "`r?`n") | Where-Object { $_ -notmatch '^\s*#' }) -join "`n"
|
||||||
$rx = '\$env:' + $Name + ' = ''([^'']*)'''
|
$rx = '\$env:' + $Name + ' = ''([^'']*)'''
|
||||||
if ($content -match $rx) { return $Matches[1] }
|
if ($content -match $rx) { return $Matches[1] }
|
||||||
return $null
|
return $null
|
||||||
@@ -142,8 +145,13 @@ if (-not $NoProfilePatch) {
|
|||||||
$markerBegin,
|
$markerBegin,
|
||||||
'# Random J621 library image as the fastfetch logo (extras/powershell_greeting).',
|
'# Random J621 library image as the fastfetch logo (extras/powershell_greeting).',
|
||||||
'$j621GreetingScript = "$env:APPDATA\j621Greeting\J621Greeting.ps1"',
|
'$j621GreetingScript = "$env:APPDATA\j621Greeting\J621Greeting.ps1"',
|
||||||
|
'if (Test-Path -LiteralPath $j621GreetingScript) { . $j621GreetingScript }',
|
||||||
|
'# Run it again any time with: greeting',
|
||||||
|
'function greeting {',
|
||||||
|
' if (-not (Get-Command Show-J621Greeting -ErrorAction Ignore) -and (Test-Path -LiteralPath $j621GreetingScript)) { . $j621GreetingScript }',
|
||||||
|
' Show-J621Greeting',
|
||||||
|
'}',
|
||||||
'if ((Test-Path -LiteralPath $j621GreetingScript) -and [Environment]::UserInteractive -and -not [Console]::IsOutputRedirected) {',
|
'if ((Test-Path -LiteralPath $j621GreetingScript) -and [Environment]::UserInteractive -and -not [Console]::IsOutputRedirected) {',
|
||||||
' . $j621GreetingScript',
|
|
||||||
' Show-J621Greeting',
|
' Show-J621Greeting',
|
||||||
'}',
|
'}',
|
||||||
$markerEnd
|
$markerEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user