Added posh-winfetch.ps1 script since in gallery theres already a winfetch not own by us. Modifications to the readme file

This commit is contained in:
Paulino Padial
2020-06-10 22:23:28 +02:00
parent 080f92f5f3
commit a49e691188
2 changed files with 38 additions and 13 deletions
+15 -4
View File
@@ -1,8 +1,7 @@
> Because I'm no longer using Windows frequently, I'm currently looking for an additional maintainer to assist in the Winfetch development. [#17](https://github.com/lptstr/winfetch/issues/17)
<br>
# Posh Winfetch
> A command-line system information utility for Windows 10
<h3 align="center"><img src="https://lptstr.github.io/lptstr-images/proj/winfetch/logo.png" alt="logo" height="100px"></h3>
<p align="center">A command-line system information utility for Windows 10</p>
<p align="center">
<img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/lptstr/winfetch.svg">
@@ -21,9 +20,21 @@ While Winfetch does work in the majority of cases, things may break occasionally
<img src="https://lptstr.github.io/lptstr-images/screenshots/projects/winfetch/computant-hyper.png" alt="winfetch" align="right" height="230px" width="350">
**Why use Winfetch?**
## Why use Winfetch?
1. **Winfetch is fast.** According to [benchmarks](https://github.com/lptstr/winfetch/wiki/Winfetch-vs-Neofetch) done with Hyperfine, Winfetch is faster than Neofetch running on Git Bash.
2. **Winfetch isn't bloated.** The whole thing is only 12.5KB and 380 lines of pure PowerShell, counting comments. Compare that to Neofetch, which is about 280KB and 7,500 lines of code.
3. **No need for the WSL, Cygwin, or MSYS2.** While you need to install a bash emulator (WSL, Git Bash, MSYS2, Cygwin) to run Neofetch, all you need for Winfetch is PowerShell, which is installed by default on most Windows computers.
## Quick Install
Install script to your current user by
`Install-Script posh-winfetch -Scope CurrentUser`
Run script by `posh-winfetch`
## Contributors
* [@lptstr](github.com/lptstr)
* [@ppadial](github.com/ppadial)
#### More: \[[Dependencies](https://github.com/lptstr/winfetch/wiki/Dependencies)\] \[[Installation](https://github.com/lptstr/winfetch/wiki/Installation)\] \[[Usage](https://github.com/lptstr/winfetch/wiki/Basic-Usage)\]
+23 -9
View File
@@ -22,6 +22,22 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
<#PSScriptInfo
.VERSION 1.2.1
.GUID 1c26142a-da43-4125-9d70-97555cbb1752
.DESCRIPTION Winfetch is a command-line system information utility for Windows written in PowerShell.
.AUTHOR lptstr
.PROJECTURI https://github.com/ppadial/winfetch
.COMPANYNAME
.COPYRIGHT
.TAGS
.LICENSEURI
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
#>
<#
.SYNOPSIS
Winfetch - Neofetch for Windows in PowerShell 5+
@@ -42,8 +58,6 @@
.NOTES
Run Winfetch without arguments to view core functionality.
#>
[CmdletBinding()]
param(
[string][alias('i')]$image,
@@ -55,8 +69,8 @@ param(
$e = [char]0x1B
$colorBar = ('{0}[0;40m{1}{0}[0;41m{1}{0}[0;42m{1}{0}[0;43m{1}' +
'{0}[0;44m{1}{0}[0;45m{1}{0}[0;46m{1}{0}[0;47m{1}' +
'{0}[0m') -f $e, ' '
'{0}[0;44m{1}{0}[0;45m{1}{0}[0;46m{1}{0}[0;47m{1}' +
'{0}[0m') -f $e, ' '
$is_pscore = if ($PSVersionTable.PSEdition.ToString() -eq 'Core') {
$true
@@ -87,7 +101,7 @@ if ($help) {
# ===== GENERATE CONFIGURATION =====
if ($genconf.IsPresent) {
if ((Get-Item -Path $config).Length -gt 0) {
write-host 'ERROR: configuration file already exists!' -f red
Write-Output 'ERROR: configuration file already exists!' -f red
exit 1
}
"INFO: downloading default config to '$config'."
@@ -169,8 +183,8 @@ $img = if (-not $image -and -not $noimage.IsPresent) {
}
elseif (-not $noimage.IsPresent -and $image) {
if (-not (Get-Command -Name magick -ErrorAction Ignore)) {
write-host 'error: Imagemagick must be installed to print custom images.' -f red
write-host 'hint: if you have Scoop installed, try `scoop install imagemagick`.' -f yellow
Write-Output 'error: Imagemagick must be installed to print custom images.' -f red
Write-Output 'hint: if you have Scoop installed, try `scoop install imagemagick`.' -f yellow
exit 1
}
@@ -183,7 +197,7 @@ elseif (-not $noimage.IsPresent -and $image) {
$image = (Get-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name Wallpaper).Wallpaper
}
if (-not (test-path -path $image)) {
write-host 'Specified image or wallpaper does not exist.' -f red
Write-Output 'Specified image or wallpaper does not exist.' -f red
exit 1
}
$pixels = @((magick convert -thumbnail "${COLUMNS}x" -define txt:compliance=SVG $image txt:-).Split("`n"))
@@ -430,4 +444,4 @@ write-output ''
# | __/ _ \| __|
# | _| (_) | _|
# |___\___/|_|
#
#