lptstr / winfetch Goto Github PK
View Code? Open in Web Editor NEW🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
License: MIT License
🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
License: MIT License
How can I get custom ascii art?
I have been able to use images but I don't know how I can do this with text
Environment: Windows Terminal 1.9.1942.0
I've installed winfetch and while fiddling around with it, I thought the default picture in neofetch is quite nice and wanted her on my terminal.
So I downloaded and saved the picture as a png file, cropped out extra stuffs except the girl, but when I loaded the image, the image was awfully low-res compared to the screenshot on the neofetch github page. Imgur
How do I get that girl on my terminal without losing any resolution, like shown in the neofetch page? Thank you.
The official package manager, WinGet does not support publishing PowerShell scripts and modules. Only supported formats are .exe, .msi, .msix.
The solution is to use a well-known executable creator - PS2EXE. Really simple program, it takes just one command to create a single full-fledged Windows executable (.exe).
The advantage of this is that we will have something to put out in our releases page, which can be picked up automatically by the WinGet manifest. Also, this will allow calling winfetch from any shell - CMD, Bash, WSL etc. - just like Scoop does (Scoop creates a shim so it's a slightly different method). The obvious downside is that, when used from PowerShell, it's slower because it's an executable as compared to a shell script. From other shells it makes no difference. In fact it was faster in my testing, when done from CMD.
The publish-psgallery branch can be repurposed as a general package-management branch (free of source files) - for hosting PSGallery, Scoop, Chocolatey and WinGet manifests and other related assets.
Since I rarely use Windows anymore, I'm looking for an additional maintainer.
Right now winfetch only shows packages which are installed from Chocolatey or Scoop. I think it would also be a good idea to show all the WinGet packages in winfetch.
In WinGet you can view the list of installed packages/apps using winget list
.
I've created a demo version of my suggested changes at jcwillox/winfetch@demo.
Specifically, this commit jcwillox@cb003ea is where I make the changes.
The demo branch is based upon the 3 PRs I recently created.
The approach I have used is far more modular than the current method, this should make it easier to add info segments and it allows users to add custom segments to their configs.
It also allows users to configure the order of segments and add blank lines (#16).
It simplifies the printing out loop, and prints info segments dynamically as the information is retrieved (like neofetch does).
The changes are in three parts, switching to the new config method (and converting old configs), encapsulating each info segment inside a function, and rewriting the printing loop for the new method.
TLDR; Implications:
Example Config:
# ===== WINFETCH CONFIGURATION =====
# Remove the '#' from any of the lines in
# this file to **enable** their output.
# $noimage = $true
# create custom info line
function info_custom_time {
return @{
title = "Time"
content = (Get-Date)
}
}
@(
"title"
"dashes"
"os"
"computer"
"custom_time" # use custom info line
"uptime"
"pkgs"
"pwsh"
"terminal"
"cpu"
"gpu"
"memory"
"disk"
"blank" # empty info line
"colorbar"
)
This is, of course, open to discussion, if anyone has a better idea, styling suggestions, etc. Otherwise, if the maintainer is happy, I'll make some final tweaks and submit a PR, where we can finalize any changes.
I created the lptstr
repository a few years ago to store my "serious" projects. The idea was to have a place where I could keep side projects I intended for broader use, and keep other things (dotfiles, random scripts, experiments) in my user profile.
However, it's become a bit tedious to follow this pattern and this rule hasn't held true for a while. There are plenty of half-assed junk projects in lptstr
and a few "serious" projects in kiedtl
, so I've decided to move everything from lptstr
to kiedtl
and just get rid of that pseudo-organization.
Of course, this will be easy to do for things like chmap, but not so easy for Winfetch, as the repository names are baked into a lot of places. I'm making a list of these places; once I believe I've gotten everything down, I'll transfer the repository and change all the URL references.
List of things to be changed/done before move:
After:
@jcwillox @rashil2000 Let me know if the repository transfer will affect anything else. Of course, all maintainers will continue to have access after the transfer.
Output of WinFetch:
{ src } master = » .\winfetch.ps1
....,,:;+ccllll kiedtl@COMPUTANT
...,,+:; cllllllllllllllllll ---------------
,cclllllllllll lllllllllllllllllll OS: Windows 10.0.17134
llllllllllllll lllllllllllllllllll Host: Acer Aspire E5-576
llllllllllllll lllllllllllllllllll PowerShell: PowerShell v6.1.3
llllllllllllll lllllllllllllllllll Uptime: 0 day 0 day hour
llllllllllllll lllllllllllllllllll CPU: Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz
llllllllllllll lllllllllllllllllll GPU: Intel(R) UHD Graphics 620
Memory: 10780MiB / 16261MiB
llllllllllllll lllllllllllllllllll Disk: 426GiB / 831GiB (Acer)
llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
`'ccllllllllll lllllllllllllllllll
`' \\*:: :ccllllllllllllllll
````''*::cll
``
Output of 'get-uptime':
{ src } master = » uptime
Days : 0
Hours : 0
Minutes : 40
Seconds : 33
Milliseconds : 0
Ticks : 24330000000
TotalDays : 0.0281597222222222
TotalHours : 0.675833333333333
TotalMinutes : 40.55
TotalSeconds : 2433
TotalMilliseconds : 2433000
Following the release of winfetch 2.0.0 or something close to that, I have noticed that winfetch hangs somewhere between printing RAM info and pritnign disk info. I usually Ctrl+C it after about 5 seconds, but I left it running once and PS reported roughly 50 seconds to get through it.
I am using PowerShell 7, winfetch 2.1.0, Windows 10, disk is 1 TB WD Blue SSD.
Along with using scoop for a package manager, create a package using chocolatey as well.
when using winfetch -showdisks *
, i get the error:
Attempted to divide by zero.
At C:\Users\conno\scoop\apps\winfetch\current\winfetch.ps1:638 char:17
+ $usage = [math]::floor(($used / $total * 100))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
Today you just have the option to show/hide some info, but keep track of order in config file will be awesome!
Plus, the space thing will be good, because if you remove a lot of info, the info and the logo are misaligned:
Config:
# ===== WINFETCH CONFIGURATION =====
# Remove the '#' from any of the lines in
# this file to **enable** their output.
@(
'None'
'None'
'None'
'Show_CPU'
'Show_GPU'
'Show_Memory'
'Show_Disk'
'Show_OS'
'Show_Uptime'
'Show_Terminal'
'Show_Pwsh'
# 'Show_Title'
# 'Show_Dashes'
# 'Show_Computer'
# 'Show_Pkgs'
) -join ','
I use Windows 7 SP1 and installed Windows PowerShell 5.1 (Windows Modules Framework). ASCII color it does not show this. Any have solutions?
I see that the Imagemagick dependency was removed -- kudos for that!
When a new release is made, this line in scoop-extras
's Winfetch manifest will have to be updated.
I discovered this:
Add-Type -Assembly System.Windows.Forms
[System.Windows.Forms.SystemInformation]::PowerStatus
We can replace the (unreliably slower) WMI calls with this simple environment variable.
In windows 11, using winfetch uses windows 10 logo, and for some reason loads considerably slower, but might be my pc
imagethat ^ image is me using windows 11 home, and it is using windows 10 logo, if it could be changed, awesome
-thanks in advanced
Winfetch should, ideally, clip the output of a line if its length exceeds the current buffer width, just like Neofetch.
I started working on it, but I think it'll take some time, because it needs a lot of escape sequences to be handled.
Also pinging @jcwillox for suggestions; he recommended me to open this issue here.
Can you upload this to Powershell Gallery so I can install it with "Install-Module winfetch"?
Having a "no ascii" art flag would really really help.
General rule of thumb is to give commandline parameters the highest preference; then the config, and then whatever is set as default in the script.
Winfetch currently ignores any commandline switch values if they have been declared in the config. This should not be the case.
Example:
Config has: $legacylogo = $true
Commandline: winfetch -legacylogo:$false
The output still has the legacy logo.
I think this is caused by line 323
.
Since Microsoft released the winget package manager a few weeks ago, it would be cool to see support for it in the future alongside the current installation options.
Exactly as the title said. I was curious about it, so I decided to try winfetch
with -image
pointing to this image. winfetch
appears to freeze, then after a little bit Windows freezes, then my display starts flickering in and out. Until I get freaked out and quickly terminate winfetch
.
Lost the config file can't replace.
The webrequest URL is 404.
I installed scoop package manager like was said in the installation instructions.
Whenever I try to install winfetch with the command scoop install winfetch
, I always get this error, no matter what terminal I use:
If I try to run in powershell 7, I get this error instead:
And administrator mode returns the same errors.
README.md indicates
Install-Script posh-winfetch -Scope CurrentUser`
However, tick at the end is not needed.
I know this is minor but throw me off for little.
By default, every version of a package on Chocolatey has to undergo a moderation process that can take even more than 1 month. Unmoderated packages cannot be installed without passing the version explicitly to choco install
.
winfetch 2.1.0 was pushed on Chocolatey on June 19, 2021 and it is still not moderated.
There are also trusted packages on Chocolatey, that bypass human moderation checks. They are packages that either have a long and good history or come from official sources (developers). I guess since the Chocolatey installation method is on the wiki - it can be considered official.
If developers and maintainers @kiedtl, @rashil2000, @jcwillox agree, I will contact Chocolatey moderators about making winfetch package as a trusted with this issue as a proof.
~ powershell
❯ Set-StrictMode -Version latest
~ powershell
❯ F:\scoop\apps\winfetch\current\winfetch.ps1
....,,:;+ccllll thorsten@rednails
...,,+:; cllllllllllllllllll -----------------
,cclllllllllll lllllllllllllllllll OS: Windows 10 Pro [64-Bit] (10.0.19042)
llllllllllllll lllllllllllllllllll Host: FUJITSU LIFEBOOK A556/G
llllllllllllll lllllllllllllllllll Uptime: 5 hours 26 minutes
llllllllllllll lllllllllllllllllll Packages: 100 (scoop)
llllllllllllll lllllllllllllllllll PowerShell: PowerShell v7.1.1
llllllllllllll lllllllllllllllllll Terminal: ConEmuC
CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
llllllllllllll lllllllllllllllllll GPU: Intel(R) HD Graphics 520 AMD Radeon (TM) R7 M360
llllllllllllll lllllllllllllllllll Memory: 11,6 GiB / 15,9 GiB
llllllllllllll lllllllllllllllllll Disk (C:): 104GiB / 475GiB (21%)
llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
`'ccllllllllll lllllllllllllllllll
`' \\*:: :ccllllllllllllllll
````''*::cll
``
winfetch.ps1: Index was outside the bounds of the array.
Yes, PowerShell 6 is far better than PowerShell 5. However, the fact that PowerShell 6+ is required for Winfetch may be a deterrent for users to try Winfetch.
❯ winfetch -genconf
INFO: downloading default config to 'C:\Users\thorsten\.config/winfetch/config.ps1'.
INFO: successfully completed download.
~ powershell
❯ F:\scoop\apps\winfetch\current\winfetch.ps1
winfetch.ps1: Cannot convert value "title,dashes,os,computer,kernel,uptime,pkgs,pwsh,terminal,cpu,gpu,memory,blank,colorbar" to type "Configuration". Error: "Unable to match the identifier name title,dashes,os,computer,kernel,uptime,pkgs,pwsh,terminal,cpu,gpu,memory,blank,colorbar to a valid enumerator name. Specify one of the following enumerator names and try again:
None, Show_Title, Show_Dashes, Show_OS, Show_Computer, Show_Uptime, Show_Terminal, Show_CPU, Show_GPU, Show_Memory, Show_Disk, Show_Pwsh, Show_Pkgs"
I think winfetch should support Windows XP and Vista i.e. PowerShell 2.0. I installed winfetch manually on Windows XP and run it from PowerShell, but it complains about "#requires" statement at line 2 for PowerShell version 5.0. I buy used computers and factory reset them, and then the OS could be XP or Vista. It would be good to be able to run winfetch to get information about the system before installing another OS.
I had to install these in order to install winfetch manually:
https://www.microsoft.com/en-US/download/details.aspx?id=16614
https://www.microsoft.com/en-US/download/details.aspx?id=16818
https://github.com/git-for-windows/git/releases/tag/v2.10.0.windows.1
The instructions for downloading didn't work in Windows XP so I had to use git clone https://github.com/lptstr/winfetch
.
I also run winfetch 1.3.0 installed using scoop on a computer with Windows 10 20H2 and PowerShell version 5.1.19041.610.
PowerShell: PowerShell-Core 7.1.3.20210315 (Chocolatey)
winfetch: 2.2.0 (Chocolatey)
winfetch incorrectly lists my PowerShell version as 5.1.19041.1023. Manually running $PSVersionTable.PSVersion
, directly afterwards, in the same terminal, correctly displays version 7.1.3.
PS C:\Users\izaac> winfetch
....,,:;+ccllll izaac@IZAAC-DESKTOP
...,,+:; cllllllllllllllllll -------------------
,cclllllllllll lllllllllllllllllll OS: Windows 10 Pro [64 bitar]
llllllllllllll lllllllllllllllllll Host: To be filled by O.E.M. To be filled by O.E.M.
llllllllllllll lllllllllllllllllll Kernel: 10.0.19043.0
llllllllllllll lllllllllllllllllll Motherboard: ASUSTeK COMPUTER INC. CROSSHAIR V FORMULA-Z
llllllllllllll lllllllllllllllllll Uptime: 22 hours 25 minutes
llllllllllllll lllllllllllllllllll Packages: 17 (choco)
Shell: PowerShell v5.1.19041.1023
llllllllllllll lllllllllllllllllll Resolution: 1920x1080, 1920x1080
llllllllllllll lllllllllllllllllll Terminal: Windows Terminal
llllllllllllll lllllllllllllllllll CPU: AMD FX(tm)-8350 Eight-Core Processor
llllllllllllll lllllllllllllllllll GPU: Radeon RX 580 Series
llllllllllllll lllllllllllllllllll Memory: 7.73 GiB / 15.9 GiB (48%)
`'ccllllllllll lllllllllllllllllll Disk (C:): 152 GiB / 446 GiB (34%)
`' \\*:: :ccllllllllllllllll
````''*::cll
``
PS C:\Users\izaac> $PSVersionTable
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Users\izaac> $PSVersionTable.PSVersion
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 1 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.