fetchcord / FetchCord

FetchCord grabs your OS info and displays it as Discord Rich Presence
MIT License
325 stars 19 forks source link

Motherboard/Laptop: MSI PE70 6QD not recognised + battery percentage not working ( `[KeyError]: 'Battery:'` ) #128

Open GGORG0 opened 3 years ago

GGORG0 commented 3 years ago

Debug info

❯ fetchcord --debug
[KeyError]: 'Font:'[KeyError]: 'Font:'----run_rpc----

uptime in epoch: 1610286283.0
cpuid: 740476198437650473
cpuappid: 741100300219187335
termappid: 741286819676553258
Unknown motherboard, contact us on github to resolve this.
hostappid: 742887089179197462
1291 (pacman) 
----out.py----

----DE/WM----
deid: Plasma
wmid: KWin
wmline item 0: KWin 

----TERMINAL----

[KeyError]: 'Font:'
fontline: Font: N/A
termid: 741286819676553258
termline item 0: konsole 
themeline: Sweet-Dark-transparent 
Sweet [Plasma], Breeze [GTK2/3] 

----HOST INFO----

hostline: PE70 6QD REV:1.0 
[KeyError]: 'Battery:'
[KeyError]: 'Battery:'
batteryline: Battery: N/A
resline: 1920x1080, 1920x1080 

----GPU INFO----

gpuinfo: NVIDIA GeForce GTX 950M
Intel HD Graphics 530
gpuvendor: nvidiaintel

----CPU INFO----

cpuvendor: intel
cpumodel: Intel i7
cpuinfo: Intel i7-6700HQ (8) @ 3.500GHz
cpuline item 0: Intel i7-6700HQ (8) @ 3.500GHz
memline: 3710MiB / 15804MiB 

----OS INFO----

sysosline: Arch Linux x86_64 
sysosid: 740476198437650473
[KeyError]: 'Disk'
diskline: Disk N/A
packagesline item 0: 1291 (pacman) 

----testing.py----
----DE/WM----

deid: Plasma
wmid: KWin

----TERMINAL/SHELL----

termid: 741286819676553258
shellid: zsh

----HOST INFO----

hostid: 742887089179197462

----GPU INFO----

gpuvendor: nvidiaintel

----CPU INFO----

cpumodel: Intel i7

('DEFAULT', <Section: DEFAULT>)
('cycle_0', <Section: cycle_0>)
('cycle_1', <Section: cycle_1>)
('cycle_2', <Section: cycle_2>)
('cycle_3', <Section: cycle_3>)
Unknown motherboard, contact us on github to resolve this.
{}
cycle0 not in : True
try_connect(key="cycle0") on <pypresence.presence.Presence object at 0x7fcd31fbd880>
cycle 0
try_update(key="cycle0") on <pypresence.presence.Presence object at 0x7fcd31fbd880>
appid: 740476198437650473
❯ neofetch --stdout
ggorg@ggorg-arch 
---------------- 
OS: Arch Linux x86_64 
Host: PE70 6QD REV:1.0 
Kernel: 5.4.85-1-lts 
Uptime: 17 mins 
Packages: 1291 (pacman) 
Shell: zsh 5.8 
Resolution: 1920x1080, 1920x1080 
DE: Plasma 5.20.4 
WM: KWin 
WM Theme: Sweet-Dark-transparent 
Theme: Sweet [Plasma], Breeze [GTK2/3] 
Icons: candy-icons [Plasma], candy-icons [GTK2/3] 
Terminal: konsole 
Terminal Font: JetBrainsMono Nerd Font 13 
CPU: Intel i7-6700HQ (8) @ 3.500GHz 
GPU: NVIDIA GeForce GTX 950M 
GPU: Intel HD Graphics 530 
Memory: 3694MiB / 15804MiB 

❯ neofetch
                   -`                    ggorg@ggorg-arch 
                  .o+`                   ---------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: PE70 6QD REV:1.0 
               `+oooooo:                 Kernel: 5.4.85-1-lts 
               -+oooooo+:                Uptime: 17 mins 
             `/:-:++oooo+:               Packages: 1291 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.8 
           `/++++++++++++++:             Resolution: 1920x1080, 1920x1080 
          `/+++ooooooooooooo/`           DE: Plasma 5.20.4 
         ./ooosssso++osssssso+`          WM: KWin 
        .oossssso-`  `/ossssss+`         WM Theme: Sweet-Dark-transparent 
       -osssssso.      :ssssssso.        Theme: Sweet [Plasma], Breeze [GTK2/3] 
      :osssssss/        osssso+++.       Icons: candy-icons [Plasma], candy-icons [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: konsole 
   `/ossssso+/:-        -:/+osssso+-     Terminal Font: JetBrainsMono Nerd Font 13 
  `+sso+:-`                 `.-/+oso:    CPU: Intel i7-6700HQ (8) @ 3.500GHz 
 `++:.                           `-/+/   GPU: NVIDIA GeForce GTX 950M 
 .`                                 `/   GPU: Intel HD Graphics 530 
                                         Memory: 3664MiB / 15804MiB 

Requested item

Motherboard/Laptop: MSI PE70 6QD plus battery percentage not working ( [KeyError]: 'Battery:' )

Other notes

(nothing :) )

Magicrafter13 commented 3 years ago

I don't know if this is related, but I had to manually enable the Battery line in my ~/.config/neofetch/config.conf file (which I didn't even know I had...). However, mine displays as Battery1: 100%.

I could be wrong, but I have a hunch that FetchCord is just grepping for a line containing Battery: (or something similar), and since the 1 is in the way, this fails.

I'm not too surprised it shows up like this actually. On my previous laptop, I wrote my own script to get info from upower to show battery percentage. However, when copying that script to my new laptop it didn't work. A quick check revealed that while my previous laptop had information at /org/freedesktop/UPower/devices/battery_BAT0, my new one didn't have a BAT0, but instead /org/freedesktop/UPower/devices/battery_BAT1. Neofetch probably doesn't show a number if your battery is BAT0 but for all others it does?

Either way, hope this helps you, and/or @MrPotatoBob in some way.

Magicrafter13 commented 3 years ago

Yeah, I believe the change would need to be implemented in fetch_cord/computer/Computer.py.

Either in this function, or possibly even requiring a change here?

I don't know Python at all, and am not entirely sure what's going on here. In v2.6.1 it looked like the change may have been simpler, but in the latest commit it seems like it would be harder to add an exception like this. And, not knowing any Python, the only method I can think of is to do a RegEx check along the lines of Battery[0-9]*: (or Battery[\d]*: if supported).

Edit:
Nevermind actually, it looks like this issue is already known about: #115