KittyKatt / screenFetch

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

Raspberry Pi Odities #510

Open Zzyzx-Wolfe opened 7 years ago

Zzyzx-Wolfe commented 7 years ago

First, on both my Pi 2 running Kali Linux and Pi 3 running Raspbian, when I'm in the terminal (the terminal you go to if you don't start the x server, not the terminal app running in LXDE), SSH, or the desktop, it returns the PID of bash as the shell (which you can see in the screenshots below) rather than the name and version of bash.

pi@pi3:~ $ echo $SHELL
/bin/bash
pi@pi3:~ $ /bin/bash --version
GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

It appears that detectshell() instead of running echo "$SHELL" | awk -F'/' '{print $NF}' which returns bash as it should, is dropping down to the else nested in the else which runs ps -p $(ps -p $PPID | awk '$1 !~ /PID/ {print $1}') | awk 'FNR>1 {print $1}' which returns the PID, 32573 in the case of the Pi 3 running on SSH. echo ${shell_type} is returning nothing, so I'm not sure what's causing the problem.


Second, on Raspberry Pis running screenfetch terminal or SSH the Intel GPU detection causes an issue.

On my Pi 2, I get the following: screenfetch-ssh-kali

On my Pi 3 with a Pi Sense hat installed, I get the following: screenfetch-ssh

Line 1341 is part of the Intel GPU detetction since in SSH/Terminal, it's unable to detect a GPU up to that point, so it runs awk '{print $2}' /proc/fb, which gave me the hint I needed to figure out what's going on:

On the Raspberry Pi 3 with the Pi Sense hat installed, cat /proc/fb returns:

0 BCM2708 FB
1 RPi-Sense FB

This causes the issue on the Raspberry Pi 2 GPU info because cat /proc/fb still returns 0 BCM2708 FB.


Third, if I run it under LXDE at 80x24, the GPU name causes wrapping: screenfetch-2017-08-09_18-52-00_termtrans It would be nice if the text wrapped without disrupting the ASCII art. It looks like it's not detecting the terminal size properly. Or, the GPU text could be trimmed a bit.


In all of these instances, I'm running version 3.8.0-3 from the Raspbian Buster and Kali kali-rolling repositories:

pi@pi3:~ $ apt-cache policy screenfetch
screenfetch:
  Installed: 3.8.0-3
  Candidate: 3.8.0-3
  Version table:
 *** 3.8.0-3 0
        200 http://mirrordirector.raspbian.org/raspbian/ buster/main armhf Packages
        100 /var/lib/dpkg/status
     3.7.0-1 0
        300 http://mirrordirector.raspbian.org/raspbian/ stretch/main armhf Packages
     3.6.5-1 0
        400 http://mirrordirector.raspbian.org/raspbian/ jessie/main armhf Packages
Zzyzx@Kali:~$ apt-cache policy screenfetch
screenfetch:
  Installed: 3.8.0-3
  Candidate: 3.8.0-3
  Version table:
 *** 3.8.0-3 900
        900 http://http.kali.org/kali kali-rolling/main armhf Packages
        500 http://http.kali.org/kali kali-dev/main armhf Packages
        100 /var/lib/dpkg/status
     3.6.5-1 600
        600 http://old.kali.org/kali sana/main armhf Packages

If there's any information I can provide to help with either of these three issues, please don't hesitate to ask! Thanks for the wonderful program!

Cheers, Zzyzx

Zzyzx-Wolfe commented 7 years ago

Oh, I also forgot to add, when running screenFetch under Kali Linux, I get the error Property "/Gtk/FontName" does not exist on channel "xsettings". screenfetch-2017-08-09_19-52-40

CyberSteve99 commented 4 years ago

I wonder if a simple fix would be to change the line that reads

if [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" || "${OSTYPE}" == "linux-musl" ]]; then

to

if [[ "${OSTYPE}" == "linux-gnu"* || "${OSTYPE}" == "linux" || "${OSTYPE}" == "linux-musl" ]]; then

I get the same issue on Raspberry Pi's and this seemed to work for me. My OSTYPE seems to be "linux-gnueabihf".

Steve