A Different Audio Spectrum Analyzer for KDE Plasma
Minimal version required | |
---|---|
OpenGL / GLSL | 3.0 / 1.30 |
QtQuick | 2.0 |
sudo pacman -S qt5-websockets qt5-3d \
python-docopt python-numpy python-pillow python-pyaudio python-cffi python-websockets
sudo apt-get install qml-module-qt3d qml-module-qt-websockets \
python3-docopt python3-numpy python3-pyaudio python3-cffi python3-websockets python3-pil
- Open the “Add Widgets” dialog of your desktop
- Go to “Get New Widgets” in the bottom
- Click “Download New Plasma Widgets”
- Search for “panon”
- Click “Install”
git clone https://github.com/rbn42/panon.git
cd panon/kde
# To install
kpackagetool5 -t Plasma/Applet --install plasmoid
# To upgrade
kpackagetool5 -t Plasma/Applet --upgrade plasmoid
plasma5-applets-panon and plasma5-applets-panon-git are available for ArchLinux.
If you want to modify shaders, installing panon as a system package is not a preferred solution right now, because then the modification will require write permission in /usr/share/plasma/plasmoids/panon
.
Drag panon widget to your panel (eg. latte-dock).
What is a shader? And a turtorial for beginners.
Shaders are stored in kde/plasmoid/contents/shaders/. If you want to modify the shaders, you can start with solid.frag.
Providing panon is installed in your home directory, you can add your own shader files to ~/.local/share/plasma/plasmoids/panon/contents/shaders/
. Panon can detect and load shaders in this folder. The name of a shader file must be ended with .frag
.
Shadertoy.com is a cross-browser online community and tool for creating and sharing shaders through WebGL, from where you can find many wonderful works shared by kind people. And by default, these works are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Panon’s shader API is designed to be similar to shadertoy.com. Many of the works can be copied directly to panon, providing you add #version 130
to the shader file’s first line. But all these works were designed to show in browsers, so they won’t look good in tiny space like a panel. example-shadertoy.frag is such an example.
Currently, these shadertoy-like uniforms are provided,
iResolution | width and heigh of the applet | available |
iTime | available | |
iTimeDelta | available | |
iFrame | available | |
iMouse | mouse position | available |
iChannel0 | fixed wave data | coming soon |
iChannel1 | fixed spectrum data | available |
Neither KDE Panel nor Latte-Dock shows the errors caused by the shaders. To catch the error messages, plasma-sdk
is required. To debug your shader, you must put your shader file in kde/plasmoid/contents/shaders/, and then start plasmoidviewer in a console.
cd ./kde/
#Providing plasma-sdk is installed
plasmoidviewer --applet ./plasmoid/
In plasmoidviewer, go to the configuration window and pick your own shader. Then plasmoidviewer will run your shader and show the errors, if exist, in the console.
- Please make sure your OpenGL version satisfies the minimum requirement.
- If you are using pyaudio as panon’s backend, please execute
python3 ./test/test_pyaudio.py
The script will tell you if pyaudio works or not. If the script failed, this issue can be reported to pyaudio. Alternatively, you may choose to execute./test/test_python-sounddevice.py
and./test/test_QtMultimedia.py
and if one of them works for you, I can add it to panon as another backend choice.
LICENSE | ||
---|---|---|
source.py and spectrum.py | adapted from PyVisualizer | |
husl-glsl.fsh | copied from hsluv-glsl | |
hsv2rgb in utils.fsh | copied from GLSL-color.md | |
example-shadertoy.frag | copied from shadertoy | CC BY-NC-SA 3.0 |
pulseaudio.py and pulseaudio.py.h | copied from SoundCard | BSD-3-Clause |