anirudhajith / process-wallpaper Goto Github PK
View Code? Open in Web Editor NEWShell and python scripts that set the desktop wallpaper to a word cloud of the most resource-hungry processes
License: GNU General Public License v3.0
Shell and python scripts that set the desktop wallpaper to a word cloud of the most resource-hungry processes
License: GNU General Public License v3.0
The crontab executes the updateWallpaper script which only runs generateWallpaper which creates a new wallpaper. It is needed to run the setWallpaper script from updateWallpaper script after creating the new wallpaper. I have opened a pull request #17 with the required changes. Please review it.
Creating wallpaper...
Can't open display
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(generateWallpaper.py:1354307): Gdk-CRITICAL **: 16:05:10.098: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
It works well runned by hand but with cron
it's like that
It does not create a png anymore of the running processes.
I would like to use your script, but when it's time to execute python program, an error appears.
Traceback (most recent call last): File "generateWallpaper.py", line 20, in <module> cpu = float(fields[8]) ValueError: could not convert string to float: '25,0'
Hi!
Please can you explain with more details how update wallpaper every minute.
Thanks!
Hi, is there a way to run this on Windows 11?
If so, how can I do it?
I see the original version of the setWallpaper.sh file prioritized feh. But the repo version uses gsettings. Some apps install gsettings at their dependency. it gets detected but doesn't work.
Feh works with almost anything. Can it be reversed back in the repo so people don't get confused?
Hello,
I'm trying to make the script compatible with macOS, I've managed to update the code that sets the wallpaper, and I changed the command to generate the logs of the top command, I'm facing a problem that I can't solve, here's the result of my shell when I run the command ./updateWallpaper.sh :
[yann@macbook-pro] ~/Sites/process-wallpaper master) ✗
$ ./updateWallpaper.sh
Traceback (most recent call last):
File "generateWallpaper.py", line 50, in <module>
).generate_from_frequencies(resourceDict)
File "/Users/yann/Library/Python/3.7/lib/python/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.
Here is a commit that shows my changes : https://github.com/YannMCX/process-wallpaper/commit/57bf10ee5d54fc775be8c21641f58fe1b2274e3b
What was expected:
Setting wallpaper...
Wallpaper set successfully
What happened:
Creating wallpaper...
Traceback (most recent call last):
File "/home/michael/process-wallpaper/generateWallpaper.py", line 2, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
Setting wallpaper...
feh WARNING: /home/michael/process-wallpaper/wallpaper.png does not exist - skipping
feh: No loadable images specified.
See 'man feh' for detailed usage information
Wallpaper set successfully.
My Verdict: The "PIL" module appears to be depreciated, and the wallpaper is not created.
Neither feh
nor gsettings
work on Plasma. Plasma uses a dbus
-based system to manage its functions and doesn't provide a script to do this out of the box. This reddit thread will probably be of some help when this is fixed.
Would be nice to be able to just install this from PyPi, or at least have it be installable with pip.
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 :
$ ./updateWallpaper.sh
Traceback (most recent call last):
File "generateWallpaper.py", line 50, in <module>
).generate_from_frequencies(resourceDict)
File "/home/user/.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.
I noticed that running top -b -n 1
only gives me the running processes, but even when I change it to top -b -n 1 -i
to show the last remembered state in updateWallpaper.sh
the error is the same.
I'm not sure what causes this.. Maybe a different version of top
?
My system uses procps-ng 3.3.15
.
And my top.out
:
top - 16:21:32 up 57 min, 5 users, load average: 0,70, 0,53, 0,47
Tasks: 191 total, 1 running, 190 sleeping, 0 stopped, 0 zombie
%CPU0 : 0,0 us, 0,0 sy, 0,0 ni, 94,4 id, 0,0 wa, 5,6 hi, 0,0 si, 0,0 st
%CPU1 : 0,0 us, 0,0 sy, 0,0 ni,100,0 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st
%CPU2 : 5,6 us, 11,1 sy, 0,0 ni, 83,3 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st
%CPU3 : 5,3 us, 5,3 sy, 0,0 ni, 89,5 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Spch: 5982776 total, 2809516 free, 1365032 used, 1808228 buff/cache
KiB Swap: 6991868 total, 6991868 free, 0 used. 4012360 avail Spch
PID USER PR NI VIRT RES SHR S %CPU %MEM ZEIT+ BEFEHL
4533 user 20 13856 4072 3344 R 18,8 0,1 0:00.03 top -b -i -n 1 -u user
565 user 20 31420 8840 7284 S 0,1 0:00.09 /usr/lib/systemd/systemd --user
566 user 20 73432 2660 44 S 0,0 (sd-pam)
576 user 20 297288 40076 35448 S 0,7 0:00.75 /usr/bin/kwalletd5 --pam-login 7 3
577 user 20 7436 3308 2844 S 0,1 0:00.04 /bin/sh /usr/bin/startkde
585 user 20 11100 4628 3612 S 0,1 0:00.55 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
610 user 20 2200 84 S 0,0 /usr/lib/kf5/start_kdeinit --kded +kcminit_startup
613 user 20 109448 20124 16952 S 0,3 0:00.15 kdeinit5: Running...
614 user 20 296644 40248 35712 S 0,7 0:00.83 /usr/lib/kf5/klauncher --fd=9
617 user 20 866540 60252 49988 S 1,0 0:03.36 kded5 [kdeinit5]
624 user 20 307088 41032 36280 S 0,7 0:01.21 /usr/bin/kaccess
636 user 20 296096 38476 33264 S 0,6 0:00.83 /usr/bin/kglobalaccel5
642 user 20 156876 5172 4644 S 0,1 /usr/lib/dconf-service
647 user 20 52204 7344 6764 S 0,1 kwrapper5 /usr/bin/ksmserver
649 user 20 385960 45360 39764 S 0,8 0:01.07 /usr/bin/ksmserver
652 user 20 232052 19476 17532 S 0,3 0:00.51 /usr/lib/kf5/kscreen_backend_launcher
663 user 20 2967648 114728 75576 S 1,9 1:30.77 /usr/bin/kwin_x11 -session 10d6616765000156271349000000008530007_1566300741_407616
671 user 39 19 256,3g 483468 305248 S 8,1 0:08.73 /usr/bin/baloo_file
674 user 20 512176 73752 57664 S 1,2 0:02.20 /usr/bin/krunner
677 user 20 1554044 279172 120160 S 4,7 1:33.18 /usr/bin/plasmashell
683 user 20 446880 42404 37552 S 0,7 0:00.71 /usr/lib/polkit-kde-authentication-agent-1
688 user 20 238868 20972 18844 S 0,4 0:00.56 /usr/bin/xembedsniproxy
694 user 20 240012 22320 20180 S 0,4 0:00.51 /usr/bin/gmenudbusmenuproxy
696 user 20 397880 57984 50216 S 1,0 0:01.52 /usr/lib/kdeconnectd
704 user 9 -11 840800 12880 9420 S 0,2 0:00.16 /usr/bin/pulseaudio --daemonize=no
741 user 20 558052 35220 31100 S 0,6 0:00.82 /usr/lib/kactivitymanagerd
747 user 20 247308 6864 5992 S 0,1 0:00.01 /usr/lib/pulse/gsettings-helper
757 user 20 431468 75656 59704 S 1,3 0:23.94 /usr/bin/yakuake -session 10d6616765000156271349000000008530008_1566300741_389646
766 user 20 307416 45812 39244 S 0,8 0:01.66 /usr/bin/msm_kde_notifier -session 10d6616765000156271349000000008530009_1566300741_388300
770 user 20 320796 48328 42444 S 0,8 0:00.83 /usr/bin/octopi-notifier -session 10d6616765000156271349200000008530012_1566300741_388268
779 user 20 13904 9100 4672 S 0,2 0:03.42 /usr/bin/zsh
781 user 20 1107360 102212 78308 S 1,7 0:05.33 /usr/bin/nextcloud -session 10d6616765000156340972400000010330012_1566300741_388443
827 user 20 4028 2344 2136 S 0,0 0:06.43 /usr/bin/ksysguardd
1054 user 20 235396 4776 4340 S 0,1 0:00.01 /usr/lib/geoclue-2.0/demos/agent
1067 user 20 420864 40440 35896 S 0,7 0:00.94 /usr/lib/org_kde_powerdevil
1103 user 20 45244 6872 6228 S 0,1 0:00.02 /usr/lib/bluetooth/obexd
1105 user 20 434084 82008 40092 S 1,4 0:01.55 /usr/bin/python /usr/bin/vorta -session 10d6616765000156341015000000010330022_1566300741_388200 -name vorta
1113 user 20 110096 17688 14476 S 0,3 0:00.01 file.so [kdeinit5] file local:/run/user/1000/klauncherHxprTy.1.slave-socket local:/run/user/1000/kio_desktopdEmnga+
1211 user 20 1037504 225336 126024 S 3,8 1:56.41 /opt/vivaldi/vivaldi-bin https://github.com/anirudhajith/process-wallpaper/blob/master/README.md
1220 user 20 14092 1676 1416 S 0,0 cat
1221 user 20 14092 1592 1336 S 0,0 cat
1223 user 20 2748 884 788 S 0,0 /opt/vivaldi/vivaldi-sandbox /opt/vivaldi/vivaldi-bin --type=zygote
1224 user 20 237384 47248 38244 S 0,8 0:00.06 /opt/vivaldi/vivaldi-bin --type=zygote
1226 user 20 237384 13604 4588 S 0,2 0:00.04 /opt/vivaldi/vivaldi-bin --type=zygote
1236 user 20 238476 7628 6704 S 0,1 0:00.03 /usr/lib/gvfsd
1241 user 20 379096 6016 5220 S 0,1 0:00.07 /usr/lib/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
1264 user 20 409772 172380 130272 S 2,9 3:44.87 /opt/vivaldi/vivaldi-bin --type=gpu-process --field-trial-handle=3915765391718663846,6007434879633374880,131072 --+
1269 user 20 326568 84068 57472 S 1,4 0:06.37 /opt/vivaldi/vivaldi-bin --type=utility --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lang+
1337 user 20 610792 158560 91972 S 2,7 1:54.66 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1344 user 20 10,5g 112928 65828 S 1,9 0:08.60 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1350 user 20 632328 204496 114712 S 3,4 2:30.84 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1442 user 20 515452 98496 72976 S 1,6 0:00.88 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1540 user 20 110012 17104 13908 S 0,3 0:00.06 file.so [kdeinit5] file local:/run/user/1000/klauncherHxprTy.1.slave-socket local:/run/user/1000/kded5DUfMlI.1.sla+
1566 user 20 585740 88840 71396 S 1,5 0:06.39 /usr/bin/dolphin
1593 user 20 404696 59232 49072 S 1,0 0:00.99 /usr/lib/kf5/kiod5
1802 user 20 533972 110320 74508 S 1,8 0:03.22 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1867 user 20 528800 111092 76412 S 1,9 0:02.29 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
1881 user 20 11300 6764 4332 S 0,1 0:00.40 /usr/bin/zsh
2678 user 20 10848 6456 4424 S 0,1 0:00.14 /usr/bin/zsh
2778 user 20 10484 4732 2688 S 0,1 0:00.18 man top
2787 user 20 10484 2044 S 0,0 man top
2788 user 20 7068 3304 2840 S 0,1 0:00.05 less
3851 user 20 552376 121984 76552 S 2,0 0:03.00 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
3895 user 20 528348 106108 78408 S 1,8 0:04.08 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
3908 user 20 570672 134360 83152 S 2,2 0:25.37 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
4264 user 20 463156 45880 33804 S 0,8 0:00.05 /opt/vivaldi/vivaldi-bin --type=renderer --field-trial-handle=3915765391718663846,6007434879633374880,131072 --lan+
This will ensure better compatibility as psutil
takes care of all that for us and a better API as top
wasn't really meant to be machine readable anyway.
Traceback (most recent call last):
File "generateWallpaper.py", line 15, in <module>
if fields[11].count("/") > 0:
IndexError: list index out of range
For convenient installation on Arch Linux
Hey,
I am using Jupyter notebook to create a word cloud, but I'm encountering some issues that I can't resolve. I've tried various methods online, but I'm still stuck.。
`ValueError Traceback (most recent call last)
in
31 index_positive = data['scores'] >= 30.0
32
---> 33 my_word_cloud(data['content'][index_negative],stoplist,'aixin.jpg') # 差评词云
34 my_word_cloud(data['content'][index_positive],stoplist,'aixin.jpg') # 好评词云
in my_word_cloud(data, stoplist, img)
16 )
17 # 词云绘制
---> 18 wc.fit_words(wordFre)
19 plt.imshow(wc) # 词云
20 plt.axis('off') # 关闭坐标
C:\anaconda\lib\site-packages\wordcloud\wordcloud.py in fit_words(self, frequencies)
380 self
381 """
--> 382 return self.generate_from_frequencies(frequencies)
383
384 def generate_from_frequencies(self, frequencies, max_font_size=None): # noqa: C901
C:\anaconda\lib\site-packages\wordcloud\wordcloud.py in generate_from_frequencies(self, frequencies, max_font_size)
401 frequencies = sorted(frequencies.items(), key=itemgetter(1), reverse=True)
402 if len(frequencies) <= 0:
--> 403 raise ValueError("We need at least 1 word to plot a word cloud, "
404 "got %d." % len(frequencies))
405 frequencies = frequencies[:self.max_words]
ValueError: We need at least 1 word to plot a word cloud, got 0.`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.