Closed TheCuteOwl closed 9 months ago
If you're running hyfetch using powershell, you can actually set any default arguments to any command by editing powershell profile.
$PROFILE
(e.g. code $PROFILE
for vscode)function Start-Hyfetch {
hyfetch --ascii-file 'C:\your\path\to\ascii.txt'
}
Set-Alias -Name hyfetch -Value Start-Hyfetch
I'll close this for now, please let me know if it works or if you run into any issues.
oh-my-posh init pwsh --config 'C:\Users\myusername\AppData\Local\Programs\oh-my-posh\themes\1_shell.omp.json' | Invoke-Expression
function Start-Hyfetch {
hyfetch --ascii-file 'C:\Users\myusername\Downloads\ascii-art (3).txt'
}
Set-Alias -Name hyfetch -Value Start-Hyfetch
there is nothing showing up maybe you could help me for cmd?
Oops okay I created an recursive loop on accident. Here is the correct way to do it: (https://stackoverflow.com/questions/70828336/adding-arguments-to-powershell-alias-functions)
function hyfetch {
# Get executable path to one commnad named hyfetch
$bin = (Get-Command -Type Application hyfetch -TotalCount 1).Source
# Define additional arguments as a list
$add = ("--ascii-file", 'C:\Users\myusername\Downloads\ascii-art (3).txt')
if ($MyInvocation.ExpectingInput) { # pipeline (stdin) input present
# $args passes all arguments through.
$input | & $bin $add $args
} else {
& $bin $add $args
}
}
Tested with Powershell 7.3.8 (on macOS)
Why does a simple alias hyfetch="hyfetch --ascii-file ..."
in bash have to be so verbose in powershell 🙃
thanks ! it work perfectly now
Hi i want to put a custom ascii when i do hyfetch (without having to put --ascii (path) is this possible (i'm on windows)