-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinfetch.cmd
132 lines (125 loc) · 6.14 KB
/
winfetch.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@echo off
chcp 65001>nul
setlocal enabledelayedexpansion
:relaunch
set brightred=[1;91m
set brightyellow=[93m
set brightgreen=[92m
set brightblue=[94m
set brightpurple=[95m
set brightcyan=[96m
set brightwhite=[97m
set darkred=[31m
set darkyellow=[33m
set darkgreen=[32m
set darkblue=[34m
set darkpurple=[35m
set darkcyan=[36m
set reg=[0m
set grey=[90m
if "%1" == "-s" (
set clear=True
)
if "%1" == "-h" (
goto help
)
if "%1" == "-fs" (
goto forcestart
)
if "%1" == "-u" (
goto update
)
:: winfetch/nimfetch id's
for /f "tokens=2 delims==" %%a in ('wmic os get caption /value ^| findstr "=" ') do set OS=%%a
for /f "tokens=2 delims==" %%b in ('wmic cpu get name /value ^| findstr "=" ') do set CPU=%%b
for /f "tokens=2 delims==" %%c in ('wmic path win32_videocontroller get name /value ^| findstr "=" ') do set GPU=%%c
FOR /F %%d IN ('cmd /c ver') DO set shell=%%d
for /f "tokens=2 delims==" %%e in ('wmic csproduct get name /value') do set host=%%e
for /f "tokens=2 delims==" %%f in ('wmic path win32_videocontroller get name /value ^| findstr "=" ') do set GPU=%%f
for /f %%a in ('powershell -Command "(Get-Content '"C:\Users\%username%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"' -Raw | ConvertFrom-Json).profiles.list[1].colorScheme"') do set COLOR_SCHEME=%%a
set terminal=CMD
for /f "tokens=2 delims=]" %%v in ('ver ^| findstr /R "\[.*\]"') do set "kernel=%%v"
set colorused1=[30m●[31m●[32m●[33m●[34m●[35m●[36m●[37m●
set colorused2=[90m●[91m●[92m●[93m●[94m●[95m●[96m●[97m●
rem Get current time
for /f "delims=" %%T in ('powershell -Command "Get-Date -Format 'HH:mm:ss'"') do set "current_time=%%T"
rem Get boot time
for /f "delims=" %%B in ('powershell -Command "(Get-CimInstance Win32_OperatingSystem).LastBootUpTime.ToString('HH:mm:ss')"') do set "boot_time=%%B"
rem Convert current time to minutes since midnight
for /f "tokens=1-3 delims=:" %%a in ("%current_time%") do (
set /a "current_min=(%%a*60)+1%%b %% 100"
)
rem Convert boot time to minutes since midnight
for /f "tokens=1-3 delims=:" %%a in ("%boot_time%") do (
set /a "boot_min=(%%a*60)+1%%b %% 100"
)
rem Calculate uptime in minutes
set /a "uptime_min=(current_min-boot_min)"
if %uptime_min% lss 0 set /a "uptime_min+=1440"
rem Get horizontal resolution
for /f "delims=" %%R in ('powershell -Command "(Get-WmiObject -Class Win32_VideoController).CurrentHorizontalResolution"') do set "horizontal_resolution=%%R"
rem Get vertical resolution
for /f "delims=" %%R in ('powershell -Command "(Get-WmiObject -Class Win32_VideoController).CurrentVerticalResolution"') do set "vertical_resolution=%%R"
rem Get memory used in MB
for /f "delims=" %%M in ('powershell -Command "(Get-WmiObject Win32_OperatingSystem).TotalVisibleMemorySize - (Get-WmiObject Win32_OperatingSystem).FreePhysicalMemory"') do set /a "memory_used_MB=%%M/1024"
if exist C:\ProgramData\chocolatey (
set packagemanager=Choco
) else (
set packagemanager=N/A
)
if !uptime_min! gtr 60 (
rem Perform the division to get hours
set /a uptime_hrs=!uptime_min! / 60
rem Append "hrs" to the result
set uptime_hrs=!uptime_hrs! hrs
) else (
set uptime_hrs=0 hrs
)
if not !clear!==True goto start_winfetch
cls
:forcestart
:start_winfetch
echo.
echo %brightred% ,.=:!!t3Z3z., %brightred%%username%%reg%@%brightred%%computername%
echo %brightred% :tt:::tt333EE3 %reg%----------------------------
echo %brightred% Et:::ztt33EEE%brightgreen% @Ee., .., %brightred%OS%reg%: %OS%
echo %brightred% ;tt:::tt333EE7%brightgreen% ;EEEEEEttttt33# %brightred%HOST%reg%: %host%
echo %brightred% :Et:::zt333EEQ.%brightgreen% SEEEEEttttt33QL %brightred%Kernel%reg%: %kernel%
echo %brightred% it::::tt333EEF %brightgreen% @EEEEEEttttt33F %brightred%Uptime%reg%: %uptime_min% mins ( %uptime_hrs% )
echo %brightred% ;3=*^```'*4EEV %brightgreen%:EEEEEEttttt33@. %brightred%Packages%reg%: %packagemanager%
echo %brightblue% ;::::::::zt33) %brightgreen% '4EEEtttji3P* %brightred%Resolution%reg%: %horizontal_resolution%x%vertical_resolution%
echo %brightblue% :t::::::::tt33.%brightyellow% :Z3z.. `` %brightred%DE%reg%: Windows Shell
echo %brightblue% i::::::::zt33F%brightyellow% AEEEtttt::::ztF %brightred%WM%reg%: DWM
echo %brightblue% ;:::::::::t33V %brightyellow% ;EEEttttt::::t3 %brightred%Theme%reg%: %COLOR_SCHEME%
echo %brightblue% E::::::::zt33L %brightyellow% @EEEtttt::::z3F %brightred%Terminal%reg%: %terminal%
echo %brightblue%{3=*^```'*4E3) %brightyellow%;EEEtttt:::::tZ` %brightred%CPU%reg%: %CPU%
echo %brightblue% ` %brightyellow%:EEEEtttt::::z7 %brightred%GPU%reg%: %GPU%
echo %brightblue% %brightyellow% 'VEzjt:;;z^>*` %brightred%Memory%reg%: %memory_used_MB%MB
echo.
echo [30m███[31m███[32m███[33m███[34m███[35m███[36m███[37m███[0m
echo [90m███[91m███[92m███[93m███[94m███[95m███[96m███[97m███[0m
echo.
goto eof
:help
echo WINFETCH VER [v2024.4] - SJ
echo Usage: WINFETCH [ARGS]...
echo.
echo Welcome to winfetch, a neofetch replica built entirely in batch script!
echo now you can have the same "linux-ricing-screenfetch" experience without the installation
echo of any package managers, or the hassle. Just download and run!
echo.
echo Args,
echo -h shows this help screen
echo -i initialize a config file
echo -c configure settings/config file
echo -s start with a clear screen
echo -fs force starts with information that takes less than O(1)
echo -l update logs
echo -u updates
echo.
goto eof
:update
curl -s https://raw.githubusercontent.com/sjapanwala/winfetch/main/winfetch.cmd>update.cmd
echo updated to "update.cmd"
goto eof
:eof