Open zaphbbrox opened 5 years ago
I've got the same issue here after cloning the most recent update (commit 717e945).
Output:
Creating wallpaper...
Traceback (most recent call last):
File "generateWallpaper.py", line 50, in <module>
).generate_from_frequencies(resourceDict)
File "/home/ccl/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 383, in generate_from_frequencies
"got %d." % len(frequencies))
ValueError: We need at least 1 word to plot a word cloud, got 0.
Setting wallpaper...
/usr/bin/gsettings
Setup successfully completed
@zaphbbrox
The %CPU stat is missing for all of your processes (except top
).
That's what's causing the problem. I'll work on a fix soon.
@anirudhajith I found a workaround to successfully generate a wallpaper:
In /etc/topdefaultrc
I changed Zero_suppress=1
to Zero_suppress=0
and now at least my top.out has a similiar output like yours.
With this I can generate a wallpaper, but I got the feeling some of the stuff is missing. For example: I'm playing a video in VLC and in top.out
I find:
7771 user 20 0 2029900 142344 84348 S 31,2 2,4 0:13.99 /usr/bin/vlc --started-from-file smb://share@NAS/Videos/Misc/samplevid.mkv
But in the wallpaper I can't see VLC.
oh boy still not fixed. i wonder why the output of top differs so much
@Hachiverol top
isn't exactly supposed to be machine readable. There's better APIs for that. Currently planning on moving to psutil
for better compatibility. See #20.
@dsluo How about glances
. it's python based and supports json and csv.
@Hachiverol glances
depends on psutil
.
In any case, it's pretty heavyweight for what we're trying to do.
About the mac output difference. I don't own a mac. Can someone provide the output of psutil
in mac, for curiosity's sake.
@Hachiverol @dsluo
I've attempted a port to psutil
on a new branch: d7531658f1e07c00819d24998d1aec54c3498716
This should work on all platforms since we're not relying on the precise format of the output of top
.
@anirudhajith
I just tested the psutil
branch and it works fine with Manjaro KDE. So from my side the issue can be closed.
@dsluo Shall we merge psutil
into master
? Do you want to make any changes before that?
@anirudhajith The last time I looked into this, I remember reading that psutil
's cpu_percent
(and maybe memory_percent
as well; I don't recall) only gives back a non-zero percentage after the first time it's retrieved. The code as it is now may not be accurately measuring resource usage due to this, as we only ever get CPU usage once per process. Simply retrieving all the stats that you can and then waiting 0.1 seconds or so should fix it.
I was working on making some changes addressing this and a few places where I think that code quality could be improved, but I've been busy preparing for and participating in interviews.
@dsluo Haven't you already fixed this? I think you've put in a delay of 0.2 seconds?
Hey, since I'm not using it on a Mac but on a Manjaro system, I opened a new issue. Besides that I have very similiar issues like in #8 :
I noticed that running
top -b -n 1
only gives me the running processes, but even when I change it totop -b -n 1 -i
to show the last remembered state inupdateWallpaper.sh
the error is the same. I'm not sure what causes this.. Maybe a different version oftop
? My system usesprocps-ng 3.3.15
.And my
top.out
: