330 Commits
Author SHA1 Message Date
Rashil GandhiandGitHub abb172b68d Release 2.5.1 v2.5.1 2023-08-27 01:38:38 +05:30
James D. Bartlett IIIandGitHub 43ccb7f706 Add Chocolatey v2.0 compatibility (#191)
* removed "-l" switch from "choco list" command for Chocolatey 2.0 compatibility

Running `choco list -l` on Chocolatey 2.0.0 produces the following error:
```Invalid argument -l. This argument has been removed from the list command and cannot be used.```
Removing the `-l` switch resolves the error and winfetch works properly again.

* handle "choco list" syntax for chocolatey 1.x and 2.x
2023-08-27 01:18:14 +05:30
OjjeoragoandGitHub 9cc0ebea77 Use choco list instead of deprecated clist (#184)
Change clist on line 875 to choco list
2023-04-05 22:03:34 +05:30
Rashil Gandhi 695ef484d7 Release 2.5.0 v2.5.0 2023-02-01 00:32:56 +05:30
Rashil Gandhi 1f1cc9f7b6 Reflect repository transfer (#162) 2023-02-01 00:30:40 +05:30
Rashil Gandhi 0358deea5e Show current theme name
Closes #119
2023-01-31 19:05:01 +05:30
62ede34254 Slightly faster CPU info (#167)
* New Method Working

- Replaces the CIM method with one that uses the registry
  - Uses `[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computername).OpenSubKey("HARDWARE\DESCRIPTION\System\CentralProcessor\0")` to get a registry key much faster than `Get-ItemProperty`
  - Currently doesn't round the frequency as rounding is slow

* Actually supply it with the computer's name

* Maybe Fix Bug and use smallcase

Attempt to fix bug with duplication of frequency by removing whitespace in split command

* Update winfetch.ps1

---------

Co-authored-by: Rashil Gandhi <rashil2000@gmail.com>
2023-01-31 16:29:42 +05:30
625a5c8c93 Optimize ps_pkgs function (#163)
* Implementation Working

- Replicates the functionality of `Get-InstalledModule` and `Get-InstalledScript`
 - Has a slight speed increase with Modules, and a slight speed decrease with Scripts
  - Largest speed increase comes from the reuse of the output of Get-Package

* More Better

Removed unneeded if-statement and replaced the pipe

* Spelling Fix

* More Faster

- Merged the foreach loops into one, saving a few milliseconds

- Also a extension I have in VSCode cut a bunch of trailing whitespace from $localeLookup

* Maximum speed

- Completely redid the processing of `Get-Package` output
  - Instead of using 2 foreach loops, uses a Where statement and counts the returned values
- 3 - 8x faster on the processing step

* Restore formatting

* Fix issue

- Used `-contains`, which doesn't take wildcards
  - Replaced with `-like`

* Update winfetch.ps1

---------

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2023-01-31 16:07:57 +05:30
JManchandGitHub eb184e6b02 Support for transparent images (#169)
* Add ability to print transparent pixels

* Add alphathreshold config option

* Fix typo

* Fix last row of transparent pixels

* Improve variable names

* Remove aMin variable
2023-01-07 19:30:51 +05:30
Rashil GandhiandGitHub 30770d10d8 Add publishing workflow 2023-01-07 01:14:29 +05:30
Rashil Gandhi c0bbc26c86 Optimize some WMI calls 2022-11-04 15:12:23 +05:30
7512b70584 Optimize CPU usage retrieval (#160)
* New Method Working

Implements a new method of CPU usage retrieval and process counting using .NET
- Uses `System.Diagnostics.PerformanceCounter` to create a CPU time counter
-  Gets the value of the CPU time, then gets it again after a delay because the CPU time is the average of two measurements
  - 150ms was a good compromise between accuracy and speed as the lower it is set, the less accurate the results are
  - The Do-Until loop is to make sure that a proper value is returned, because sometimes a value of 0 or 100 is returned when it fails to retrieve a value
    - This does introduce a possible bug where it could get stuck in a loop of someone's computer is pinned at 100%, but it is unlikely this would happen for an extended period of time
- Rounds returned value to 1 decimal place, which is more accurate than the previous implementation

- Gets the process count using `([diagnostics.process]::GetProcesses()).Count`

* Love it when this happens

- Replaces the PerformanceCounter implementation with a significantly faster one

* Update config

Co-authored-by: Rashil Gandhi <rashil2000@gmail.com>
2022-11-04 13:21:23 +05:30
b673c1adc6 Optimize info_disks (#164)
* New Method Working

- Replaces the `Add-Type` implementation with one that uses `System.IO.DriveInfo`
  - For once, my new implementation is actually shorter than the previous one
  - Significantly faster on both fast and slow systems

* Apply suggestions from code review

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2022-11-03 00:26:19 +05:30
CarterandGitHub 3d1477ad37 Add .gitignore (#165)
* Create .gitignore

- Created `.gitignore` with a list of possibly problematic paths
  - Created this as I started using VSCode's internal debugger for the project for some troubleshooting which created a `.vscode` folder with some configuration files

* Slim Down .gitignore

- removed irrelevant entries from `.gitignore`
  - Kept Desktop.ini and .DS_Store though due to them causing problems quite often
2022-11-02 21:11:56 +05:30
5918b3fe50 Implement Faster IPv4 Address Retrieval Method (#159)
* New Method Working

- Implemented new method to find user's real IPv4 address using a recursive mess of .NET witchcraft that somehow ends up being much faster
  - Gets all network adapters using `[System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()`
    - Checks if each adapter is online, has a gateway address, and is not a loopback adapter
      - Then checks if adapter is a WiFi or Ethernet adapter using `NetworkInterfaceType`
        - Then iterates through each Unicast address, and checks if the address is for InterNetwork communication
          - Then checks if the $local_ip variable has already been set, and if not, sets it to the IP returned
            - This is because under some circumstances, multiple IP's can be returned
              - It grabbed the ZeroTier IP address on my PC, which shouldn't occur
              - This bug also exists with the previous implementation, and I'm not sure if there is an easy way to fix it without manually filtering out certain adapter names

Speed:
- PowerShell 5:
  - 400ms -> 43ms
    - 9.3x Faster
- PowerShell 7:
  - 459ms -> 56ms
    - 8.2x Faster

Possible Extra Checks:
- Check `$ni.GetIPProperties().UnicastAddresses.DhcpLeaseLifetime` for if time is less than 24 hours

* Apply suggestions from code review

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2022-10-10 22:44:44 +05:30
72c3403eb7 Speed Up info_locale (#154)
* Make info_locale blazing fast

- Made info_locale speedy
  - Takes the registy entries at HKCU:Control Panel\International to get region code and language code, and passes them into two very large hash tables to get the accompanying region and language values.
  - TODO: Make it work when user has more than one language
  - Maybe: Find a way to circumvent the very large table
  - 3251 ms -> 12.43 ms
    - 262x Faster

* Make large table even bigger

- Should fix any issues with missing languages as this was ripped directly from Microsoft's documentation

* Have 3 values per line on table

- Makes it easier to scroll through

* Not break when more than one language is used

- Instead of getting the value of "Languages" of HKCU:Control Panel\International\User Profile, iterates through the multi-key in case multiple languages are configured

* Better format tables

- Added even spacing between the table's values to make much easier to read

* Slight Formatting Change

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2022-09-16 00:46:32 +05:30
Sotirios RoussisandGitHub 89a4524fc3 Fix redundant whitespace in CPU name (#148)
* Fixed #147

* Refined Trim() call in info_cpu()
2022-08-28 16:16:54 +05:30
Rashil GandhiandGitHub e5cd798a62 Report MaxClockSpeed in CPU (#144)
* Report MaxClockSpeed in CPU

* Round off to GHz
2022-08-15 19:17:32 +05:30
ca50dc997b Add Windows 95/98/2000 ASCII art (#143)
* added windows 9x/2000

* fix indent, correct width

Co-authored-by: Rashil Gandhi <rashil2000@gmail.com>
2022-07-14 14:41:11 +05:30
Rashil Gandhi 24ca268352 Allow custom ASCII art using config file 2022-06-17 02:15:59 +05:30
Rashil GandhiandGitHub aff73ca754 Release 2.4.1 v2.4.1 2022-05-04 21:39:27 +05:30
Alex StelmachonakandGitHub 6a3ef5336c Change script encoding to UTF-8 with BOM (#135)
Fixes PowerShell 5.x compatibility
2022-05-04 21:36:56 +05:30
Rashil GandhiandGitHub c228cba02c Release 2.4.0 v2.4.0 2022-05-01 02:13:11 +05:30
f759d8b3e7 Show multiple GPUs on separate lines (#127)
* Multi-gpu on separate lines

* Change back the default showdisks settings

* Restore formatting

* Restore formatting2

* Revert back changes in main function, change `info_gpu` instead

* Revert more spaces

* Apply suggestions from code review

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2022-02-19 18:53:19 +05:30
Rashil Gandhi f19207d4f7 Simplify Scoop function 2022-02-16 23:51:34 +05:30
Rashil Gandhi 03ce4cec24 Refactoring and cleanup
No functional changes
2022-02-06 15:07:24 +05:30
Rashil Gandhi 938dde7f6e Allow passing remote URL for image path 2022-02-06 12:22:32 +05:30
Rashil Gandhi e64bcd7cfa Defer adding DiskMethods type to info_disk function 2022-02-05 23:47:21 +05:30
Rashil GandhiandGitHub 07cce61009 Fix check for empty config file
Closes #125
2022-01-31 11:29:47 +05:30
Rashil GandhiandGitHub 8f3d1ce21d Add flag to print image as ASCII text (#124)
* Add option to print image as ASCII text

* Update winfetch.ps1
2022-01-27 11:44:27 +05:30
Rashil Gandhi 86cce69259 Allow overriding image/logo width 2022-01-22 13:29:59 +05:30
Rashil GandhiandGitHub 8e86caf024 Add small logo variant (#122) 2022-01-22 16:27:30 +11:00
Rashil Gandhi c16fdc48d3 Add NoProfile flag to shebang 2022-01-22 00:39:36 +05:30
Rashil GandhiandGitHub 8fa2210b6d Specify image width for different logos 2022-01-22 00:07:09 +05:30
Rashil GandhiandGitHub cf8861e713 Remove hardcoded cursor shift 2022-01-21 23:57:54 +05:30
Rashil GandhiandGitHub c3c9105fd0 Resolve-Path while defining bitmap - Fixes #105 2022-01-21 23:50:49 +05:30
Rashil Gandhi d14361e3d2 Broaden condition check for Locale cmdlet
PowerShell/PowerShellModuleCoverage#18 - Still not fixed smh
2021-12-13 12:04:32 +05:30
KidandGitHub f55c29e3cd Link to Neofetch (#115)
* LInk to Neofetch

* Also remove some redundant words

Hyperfine is mentioned in the linked wiki page, there's no need to mention it here as most people probably don't really care
2021-11-27 21:02:19 +05:30
Rashil GandhiandGitHub a3588713d2 Release 2.3.0 v2.3.0 2021-11-06 11:11:24 +05:30
Rashil GandhiandGitHub f3cb9e2153 Optimize battery reporting (#111) 2021-11-06 10:12:36 +05:30
Rashil Gandhi 15ec7b388a Add more shell exceptions 2021-10-19 12:57:53 +05:30
Kiëd LlaentennandGitHub a2be7f4332 Merge pull request #107 from kiedtl/kiedtl-patch-1
Add `made with: wordpad` badge to README
2021-09-08 11:01:54 -04:00
Kiëd LlaentennandGitHub b59307e47d Add made with: wordpad badge to README 2021-09-07 08:12:12 -04:00
0b5c91fc7a Change user, host, and rowname colors to yellow for better visibility (#97)
* Change user, host, and rowname colors to yellow for better visibility

* User@Host color actually changed now

Co-authored-by: bilditup1 <bilditup1@users.noreply.github.com>
2021-08-29 00:37:33 +10:00
Lukáš KrejčíandGitHub f1e816fb60 Show "system" identifier for winget package count (#104)
* Show missing "winget" identifier.

The choco and scoop packages count both have the package manager identifier written next to it, but winget is missing it. This adds the identifier to keep the output consistent, if users explicitly enable winget in settings.

* "winget" changed to "system"

As the reported number does not correspond to the number of apps installed through winget (but to the number of all installed apps in the system), using "system" seems more appropriate.
2021-08-27 14:03:24 +10:00
Josh WilloxandGitHub 8eb61b1fbe Release 2.2.0 v2.2.0 2021-07-21 12:08:54 +10:00
AwesomeCronkandGitHub 1d2977ac96 Rewrote disk info to use Windows API calls instead of WMIC (#94)
* Rewrote disk_info to use Windows API calls instead of WMIC. Renamed old disk_info to disk_info_CIM.

* Moved the C# definition for disk_info to the VARIABLES section.

* Refactored the disk letter comparison section, appears to still not be working entirely.

* Fixed wrong array type for $allDiskLetters.

* Cleaned up the old disk_usage.

* Fixed a missing newline.
2021-07-19 12:51:35 +10:00
Rashil Gandhi 670463f3ac Workaround locale issue in PS 7.1+ 2021-07-14 02:03:20 +05:30
Rashil GandhiandGitHub 229480f407 Add PS packages information (#90) 2021-07-05 09:08:14 +05:30
Diab NeiroukhandGitHub 8f41cf6248 Improve Windows Logo Detection (#88)
* Improve Windows Logo Detection

This also adds support for (the upcoming) Windows 11.

* Remove the "switchlogo" Parameter

This has become useless after our changes to the logo detection logic.

* Add a "logo" Parameter to Set a Specific Version Logo
2021-07-02 11:15:48 +05:30