anirudhajith / process-wallpaper

Shell and python scripts for setting your desktop wallpaper to a ~live word cloud of your most resource-hungry processes
GNU General Public License v3.0
544 stars 52 forks source link

fixed some output issues in generateWallpaper.py #10

Closed zaphbbrox closed 5 years ago

zaphbbrox commented 5 years ago

Fixes #9 :

zaphbbrox commented 5 years ago

I just tested if this still works if this still works when Zero_suppress=1 is in /etc/topdefaultrc. It doesn't. So for this problem there's still a fix needed.

anirudhajith commented 5 years ago

I tested out your code on my machine. Unfortunately, it doesn't work here. On my system, the output of top looks like:

top - 19:51:58 up 12:01,  1 user,  load average: 0.40, 0.60, 0.60
Tasks: 358 total,   1 running, 291 sleeping,   0 stopped,   0 zombie
%Cpu(s): 14.5 us,  4.1 sy,  1.4 ni, 80.0 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem : 32818784 total, 24970460 free,  3607528 used,  4240796 buff/cache
KiB Swap:        0 total,        0 free,        0 used. 28575348 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
12271 anirudh   20   0   41908   3812   3184 R  18.8  0.0   0:00.03 top
 3493 root      20   0  817016 490624  52144 S   6.2  1.5  11:34.63 Xorg
    1 root      20   0  226132  10012   6736 S   0.0  0.0   0:04.45 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.02 kthreadd
    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/0:0H
    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S   0.0  0.0   0:00.14 ksoftirqd/0
    8 root      20   0       0      0      0 I   0.0  0.0   0:12.72 rcu_sched
    9 root      20   0       0      0      0 I   0.0  0.0   0:00.00 rcu_bh
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.07 migration/0
   11 root      rt   0       0      0      0 S   0.0  0.0   0:00.05 watchdog/0
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.01 cpuhp/1
   14 root      rt   0       0      0      0 S   0.0  0.0   0:00.05 watchdog/1
   15 root      rt   0       0      0      0 S   0.0  0.0   0:00.04 migration/1
   16 root      20   0       0      0      0 S   0.0  0.0   0:00.08 ksoftirqd/1
.
.
.

So using the last part of the split command doesn't work like it does for the absolute paths your getting in your output.

zaphbbrox commented 5 years ago

OK, I wasn't aware that the output of top differs so much. Also I noticed I still used the -u(ser) switch for the top command. Without it I had entries like:

    2 root      20   0       0      0      0 S   0.0   0.0   0:00.00 [kthreadd]

which I have strip and split differently. I don't know if it's because I'm using Manjaro KDE edition or something else.

So I close this pull request for now.