Compare commits
1
Commits
4889c5c355
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf1d75aca8 |
@@ -46,9 +46,13 @@ Non-interactive / re-install:
|
||||
Test it manually any time with:
|
||||
|
||||
```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+).
|
||||
Image logos need Windows Terminal 1.22+ (sixel) or WezTerm with kitty
|
||||
graphics enabled; other terminals fall back to a plain fastfetch.
|
||||
|
||||
@@ -39,6 +39,9 @@ function Get-InstalledConfigValue {
|
||||
param([string]$Name)
|
||||
if (-not (Test-Path -LiteralPath $configFile)) { return $null }
|
||||
$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 + ' = ''([^'']*)'''
|
||||
if ($content -match $rx) { return $Matches[1] }
|
||||
return $null
|
||||
@@ -142,8 +145,13 @@ if (-not $NoProfilePatch) {
|
||||
$markerBegin,
|
||||
'# Random J621 library image as the fastfetch logo (extras/powershell_greeting).',
|
||||
'$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) {',
|
||||
' . $j621GreetingScript',
|
||||
' Show-J621Greeting',
|
||||
'}',
|
||||
$markerEnd
|
||||
|
||||
Reference in New Issue
Block a user