Coder Social home page Coder Social logo

paleofetch's People

Contributors

dwzg avatar gokop avatar srithon avatar ss7m avatar titaniumtown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paleofetch's Issues

CPU Count and Speed are being printed on the wrong line.

                  -`                    krutonium@GamingPC
                 .o+`                   ------------------
                `ooo/                   OS: Arch Linux x86_64
               `+oooo:                  Host: MS-7A34 2.0
              `+oooooo:                 Kernel: 5.6.4-zen1-1-zen
              -+oooooo+:                Uptime: 4 hours, 46 mins
            `/:-:++oooo+:               
           `/++++/+++++++:              Packages: 1178 (pacman)
          `/++++++++++++++:             Shell: zsh
         `/+++ooooooooooooo/`           Resolution: 4720x1050
        ./ooosssso++osssssso+`          Terminal: gnome-terminal-server
       .oossssso-````/ossssss+`         
      -osssssso.      :ssssssso.        CPU: AMD Ryzen 7 1800X Eight- Processor
 (16) @ 3.6GHz
     :osssssss/        osssso+++.       GPU: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii PRO [Radeon R9 290/390]
    /ossssssss/        +ssssooo/-       Memory: 5937MiB / 32127MiB (18%)
  `/ossssso+/:-        -:/+osssso+-     
 `+sso+:-`                 `.-/+oso:                            
`++:.                           `-/+/                           
.`                                 `/   

Missing GPU on Optimus System

The results from your tool are

GPU: Intel 4th Gen Core Processor Integrated Graphics Controller

But in Neofetch it's

GPU: Intel 4th Gen Core Processor 
GPU: NVIDIA GeForce GTX 950M 

[enhancement] Should paleofetch detect the user's window manager?

I have a patch ready to go that supports EWMH-compliant window managers, but I wanna make sure it's within the spirit of the project before requesting the pull. It's only ~20 lines and still blazing-fast, but it could spell the beginning of "feature creep" since naturally we'd also want to get the DE if applicable, and that could be a can of worms.

Add GPU Output

This one doesn't seem to be as straightforward as the CPU. Neofetch parses output from lspci; I'm not sure if that is the best approach for this project.

Crash

           PID: 36401 (paleofetch)
           UID: 1000 (krutonium)
           GID: 1000 (krutonium)
        Signal: 11 (SEGV)
     Timestamp: Thu 2020-04-23 19:58:59 EDT (40s ago)
  Command Line: paleofetch
    Executable: /usr/bin/paleofetch
     Owner UID: 1000 (krutonium)
      Hostname: GamingPC
       Storage: /var/lib/systemd/coredump/core.paleofetch.1000.ad51c9fb2c4742c88e42585159d753ed.36401.1587686339000000000000.lz4
       Message: Process 36401 (paleofetch) of user 1000 dumped core.
                
                Stack trace of thread 36401:
                #0  0x00007fdd95fb9229 __strncpy_avx2 (libc.so.6 + 0x163229)
                #1  0x0000558aed1958b3 n/a (paleofetch + 0x28b3)
                #2  0x0000558aed195191 n/a (paleofetch + 0x2191)
                #3  0x00007fdd95e7d023 __libc_start_main (libc.so.6 + 0x27023)
                #4  0x0000558aed19538e n/a (paleofetch + 0x238e)

Just running paleofetch on my system.

 krutonium@GamingPC  ~  paleofetch
                  -`                    krutonium@GamingPC
                 .o+`                   ------------------
                `ooo/                   OS: Arch Linux x86_64
               `+oooo:                  Host: MS-7A34 2.0
              `+oooooo:                 Kernel: 5.6.4-zen1-1-zen
              -+oooooo+:                Uptime: 4 hours, 37 mins
            `/:-:++oooo+:               
           `/++++/+++++++:              Packages: 1178 (pacman)
          `/++++++++++++++:             Shell: zsh
         `/+++ooooooooooooo/`           Resolution: 4720x1050
        ./ooosssso++osssssso+`          Terminal: gnome-terminal-server
       .oossssso-````/ossssss+`         
[1]    36784 segmentation fault (core dumped)  paleofetch

This system has both an AMD R9 390 and an nVidia 750 Ti, with a Ryzen 7 1800X CPU.

Bug - Cannot compile. pci library isn't found

Whenever I run make, it refuses to find pci/pci.h

Here's my output

cc paleofetch.c -o paleofetch -O3 -Wall -Wextra -lX11 -lpci
paleofetch.c:10:10: fatal error: pci/pci.h: No such file or directory
 #include <pci/pci.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:10: paleofetch] Error 1

And pciutils is installed.

Thoughts on a minimalist approach to saying something about the user's interface.

I know we don't wanna become neofetch (in terms of SLOC nor the headache of special-casing so many things), but the fact that we don't say anything about the user's environment is conspicuous.

I think a sensible approach to providing some sort of umbrella "interface" datum would be to report the name of the command attached to the Xorg process's immediate sibling. This would be things like spectrwm, xfce4-session, etc.

Not exactly "pretty", but it'd get us ~80% of the way there for free.

Support for other package managers

I would like for paleofetch to support package managers other than pacman. But since I only have pacman installed on my computer, it's difficult for me to figure how to do that.

If you want paleofetch to support your favorite package manager, please reply to this issue with the following information:

  • The name of your package manager
  • The name of a directory which includes a folder for each package you have installed (for pacman this is /var/lib/pacman/local)
  • The output of ls -la in this directory

unable to open product name file

When I run paleofetch on my raspberry pi 4, running arch linux arm, I get the error:
paleofetch: unable to open product name file

Add Support for Multiple Batteries

Currently, the "Battery" output only displays the main battery in the system, which is determined at compile-time. It ignores all of the other entries in the power_supply folder, some of which the user may care about.

If we add support for multiple batteries, I believe the batteries would have to be discovered at runtime rather than at compile-time. I have a Bluetooth keyboard which I use on and off throughout the day; this means that its battery appears and disappears from the power_supply folder.

https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power
Inside each subdirectory in power_supply, there is a file called type. We can use the contents of this file to determine which ones are truly batteries.
The contents of the file can be one of the following:

  1. "Battery"
  2. "UPS"
  3. "Mains"
  4. "USB"

On my system, I have a subdirectory called AC of type Mains. By checking against the type file, we would be able to filter this out.

https://www.kernel.org/doc/Documentation/power/power_supply_class.txt
Inside each battery subdirectory, there is a file called model_name. The contents of this file could be used to whitelist/blacklist battery entries in the configuration. However, I am not sure how we would make this whitelisting/blacklisting user-friendly.


To implement this, we would list the subdirectories in power_supply and filter out the ones that do not have Battery in their type file. For each remaining subdirectory, we would do what we are currently doing, just with BATTERY_DIRECTORY substituted with the path of that subdirectory. However, this approach would require some reworking of the current code.

Approach 1

In order to have one battery function handle all of the subdirectories in power_supply, one approach would be to have every function return a char** and an int holding the number of returns. One problem with this is that it would add unnecessary overhead to all of the other functions that only return 1 value.

The batteries would have to be named according to their model_name, so that would be another issue. Currently, the labels are determined at compile-time. If we want the battery function to work like this, the function itself would have to have control of the label, which would be another refactor.

Approach 2

A different approach that would require way less refactoring would be to have different functions for printing out each nth battery. With this approach, the model_name issue still persists, but we no longer have the issue of multiple returns from one function.

General

One thing we could do to reduce overhead is cache the output of ls and which subdirectories are batteries. In consecutive runs, we would run ls and see if the output equaled the cached version. If so, we would be able to skip the filtering step. However, the work involved in reading the cache and comparing the output of ls could be greater than just filtering them out each time.

Dedicated GPU doesn't show up

On neofetch I get both GPUs, but paleofetch finds only integrated GPU
Paleofetch:

                  -`                    cigla@Rakija
                 .o+`                   ------------
                `ooo/                   OS: Arch Linux x86_64
               `+oooo:                  Host: 81BF Lenovo ideapad 520-15IKB
              `+oooooo:                 Kernel: 5.6.8-arch1-1
              -+oooooo+:                Uptime: 1 hour, 52 mins
            `/:-:++oooo+:               
           `/++++/+++++++:              Packages: 1611 (pacman)
          `/++++++++++++++:             Shell: fish
         `/+++ooooooooooooo/`           Resolution: 1920x1080
        ./ooosssso++osssssso+`          Terminal: gnome-terminal-server
       .oossssso-````/ossssss+`         
      -osssssso.      :ssssssso.        CPU: Intel i5-8250U (8) @ 3.4GHz
     :osssssss/        osssso+++.       GPU: Intel UHD Graphics 620
    /ossssssss/        +ssssooo/-       Memory: 3700MiB / 7745MiB (47%)
  `/ossssso+/:-        -:/+osssso+-     
 `+sso+:-`                 `.-/+oso:                            
`++:.                           `-/+/                           
.`                                 `/   

Neofetch:

                   -`                    cigla@Rakija 
                  .o+`                   ------------ 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: 81BF Lenovo ideapad 520-15IKB 
               `+oooooo:                 Kernel: 5.6.8-arch1-1 
               -+oooooo+:                Uptime: 1 hour, 52 mins 
             `/:-:++oooo+:               Packages: 1611 (pacman) 
            `/++++/+++++++:              Shell: fish 3.1.0 
           `/++++++++++++++:             Resolution: 1920x1080 
          `/+++ooooooooooooo/`           DE: GNOME 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: Canta-indigo-dark [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Numix-Circle [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: gnome-terminal 
   `/ossssso+/:-        -:/+osssso+-     CPU: Intel i5-8250U (8) @ 3.400GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce MX150 
 `++:.                           `-/+/   GPU: Intel UHD Graphics 620 
 .`                                 `/   Memory: 3686MiB / 7745MiB 

Add flatpak support

Hi,
I thought to do this like pacman, by listing directories under /var/lib/flatpak/app and /var/lib/flatpak/runtime
I tried that but me and C rarely give working results :(

Moreover there is the problem of flatpak "installations", which allows installing apps to other folders according to config files in /etc/flatpak/installations.d/...

Idea: caching kernel on boot

So, I've been having an issue on my laptop (and raspberry pi) whenever I get a kernel update i have to do paleofetch --recache everytime i update. Maybe it could have a cache file stating last time it did a recache, and if that time is longer back than the uptime, it recaches.

Implement Testing

I think that this project is big enough now that we may want to add some testing, but I'm not sure exactly what that'd look like, especially since many things in paleofetch are dependent on hardware. And I'll be the first to admit that I'm not sure how best to write tests for a C project.

I definitely think that passing the valgrind-smell-test should be part of test, for any number of situations, including:

  • Plainly running paleofetch
  • Running paleofetch --recache
  • Running paleofetch when reading from cache
  • Running SHELL="" paleofetch (or any situation causing a value to be empty)
  • Repeating all those for when there is no X server running

Add get_diskspace?

I gave it a try, but being a pleb python scripter i couldnt get it working. Maybe i should write a clone in python :)
As far as i can tell it would'nt be a major project adding though, either using statvfs.h or even calling df.
But you might not even want to add it, idk your philosophy on the project.
If not im gonna give it another try. I really want used/free space for a few mount points.

Also when i GPU_REMOVE "NVIDIA", "CORPORATION", "TU", "116", "[", "]", i get a blank space left ahead of the gpu name. Just a little annoyance.

Also it would be cool querying AUR packages separately...

And as a little gift i stole another logo from pfetch and made a arch.h.

// This was stolen from pfetch by fuzebox
char *LOGO[] = {
    "                             ",
    "                             ",
    "                             ",
    "             /\\              ",
    "            /  \\             ",
    "           /\\   \\           ",
    "          /      \\           ",
    "         /   ,,   \\          ",
    "        /   |  |  -\\         ",
    "       /_-''    ''-_\\        ",
    "                             ",
    "                             ",
    "                             ",
    "                             "
};

jJteJQg

Not detecting terminal correctly

When running paleofetch automatically via the .zshrc it seems to be too fast (?) for my terminal emulator (konsole) to start up, and it picks a random window that is currently open. Putting sleep 0.17 in front of it fixes it most of the time, but not always. A higher value might make it more consistent, but at that point the advantage to neofetch is lost.

Add terminal output

Currently paleofetch does not detect what terminal you're using. Note that $TERM is not necessarily a reliable way to get this information- I use alacritty but my $TERM is set to xterm-256color.

Neofetch examines the parent process to get this; that might be a good approach to take.

It detects the wrong GPU

I've just given this program a try and a thing I've noticed is that although I'm using a GTX 960, paleofetch says I'm using "Intel Q170/Q150/B150/H170/H110/Z170/CM236 Chipset SATA Controller [AHCI Mode]". This looks like some generic guess on what my integrated graphics is, but that's not the card I use.

Add CPU output

Get paleofetch to detect the users CPU. Parsing /proc/cpuinfo will probably be what we need to do.

Segfault

Built at commit be825d7
It starts printing but segfaults when it's supposed to print i-dont-remember-what. (probably distro name)

$ ./paleofetch 
                  -`                    gokop@demunarch
                 .o+`                   ---------------
[1]    13866 segmentation fault  ./paleofetch

Error of failed request: BadWindow

Hi,
I get the following error when running paleofetch. I am currently on the latest commit.

Screenshot from 2020-04-24 10-06-54

[Edit]
The issue occurs in the get_terminal call. Commenting out that line resolves the issue. I am using gnome-terminal if that helps.

make install fails

make install is saying that /sys/class/power_supply/BAT0 is not a directory even though it is and is cancelling install? I am on void linux.

Should we make it possible to put the logo on the right?

I did a side-by-side of my current configuration and what I wish it looked like, and I thought maybe other folks would like to have the logo on the right (either justified or "as flush as possible" with the data like I have it in the demo).

The problem is this would be a fairly invasive change to the code. We wouldn't know how to position things until the end of data acquisition when we know the length of the longest line. A somewhat clean approach might be to gate all the right-alignment code behind an #ifdef RIGHT, and then instead of straight printf() in main(), we print to a string and then do all the magic on that iff we're trying to right-align. But then we're left dealing with the ANSI escape sequences contributing to line lengths.

It could get hairy, but I think this would be a nifty feature that sets us apart from neofetch (not that the absurd speed improvement is anything to scoff at).

CPU 0mhz

I'm on arch linux arm w/ a raspberry pi 4. And now when I run paleofetch, the cpu stats are displayed as: CPU: (0) @ 0MHz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.