KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.89k stars 454 forks source link

How does screenfetch calculate RAM? #689

Open Firestar-Reimu opened 4 years ago

Firestar-Reimu commented 4 years ago
(base) [19:53:38] firestar:~ $ free -m
               total        used        free      shared  buff/cache   available
Mem:        7881        1877        3894         975        2110        4766
Swap:           0           0           0
(base) [19:53:41] firestar:~ $ screenfetch

 ██████████████████  ████████     firestar@FIRESTAR
 ██████████████████  ████████     OS: Manjaro 20.1 Mikah
 ██████████████████  ████████     Kernel: x86_64 Linux 5.8.10-arch1-3-surface
 ██████████████████  ████████     Uptime: 30m
 ████████            ████████     Packages: 1257
 ████████  ████████  ████████     Shell: zsh 5.8
 ████████  ████████  ████████     Resolution: 2736x1824
 ████████  ████████  ████████     DE: KDE 5.73.0 / Plasma 5.19.5
 ████████  ████████  ████████     WM: KWin
 ████████  ████████  ████████     GTK Theme: Mojave-light [GTK2/3]
 ████████  ████████  ████████     Icon Theme: Mojave-CT-Light
 ████████  ████████  ████████     Disk: 31G / 112G (29%)
 ████████  ████████  ████████     CPU: Intel Core i5-8250U @ 8x 1.6GHz [41.0°C]
 ████████  ████████  ████████     GPU: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
                                  RAM: 3132MiB / 7881MiB
(base) [19:53:46] firestar:~ $ 

This is the output of inputing free -m and screenfetch almost at once.

Is the used RAM calculated by screenfetch is shared + buff/cache?

KittyKatt commented 3 years ago

Yes, screenfetch's RAM calculations include shared+buff/cache. This was kind of a flaw in logic on my part when I made the memory detect function and it's been on my list to go back and revisit this logic at some point, I just haven't had the time.