GLava - OpenGL audio spectrum visualizer
Clone or download
Latest commit 66a9b09 Nov 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
glad @ c33992f Added "pinned" option for setxwinstate, addresses #4 Jun 2, 2018
shaders Added audio backends, fifo support, see #78 Nov 18, 2018
.gitignore Add gitignore Nov 30, 2018
.gitmodules added submodule Nov 26, 2017
CONTRIBUTING.md update wording Oct 27, 2018
LICENSE Fix hyperlink text in license Jun 2, 2018
LICENSE_ORIGINAL updating licensing information Nov 27, 2017
Makefile Added '@' include specifier, #define workaround, closes #74, closes #75 Oct 27, 2018
README.md Added audio backends, fifo support, see #78 Nov 18, 2018
fifo.c Added audio backends, fifo support, see #78 Nov 18, 2018
fifo.h Added audio backends, fifo support, see #78 Nov 18, 2018
glad.c Removed hard dependency on glad submodule Oct 9, 2018
glad.h Removed hard dependency on glad submodule Oct 9, 2018
glava.c Added audio backends, fifo support, see #78 Nov 18, 2018
glfw_wcb.c Fixed changes to _XROOTPMAP_ID not updating background with "xroot" t… Oct 8, 2018
glsl_ext.c Added --request parameter, fixed reading directives at end of file, l… Nov 2, 2018
glsl_ext.h Added '@' include specifier, #define workaround, closes #74, closes #75 Oct 27, 2018
glx_wcb.c Style changes and contribution guidelines Oct 27, 2018
khrplatform.h Removed hard dependency on glad submodule Oct 9, 2018
pulse_input.c Added audio backends, fifo support, see #78 Nov 18, 2018
pulse_input.h initial commit Nov 26, 2017
render.c Added --request parameter, fixed reading directives at end of file, l… Nov 2, 2018
render.h Added --request parameter, fixed reading directives at end of file, l… Nov 2, 2018
xwin.c Fix leak with 'xroot' transparency Nov 2, 2018
xwin.h Handle window map_state and VisibilityNotify events, closes #68 Oct 8, 2018

README.md

GLava is an OpenGL audio spectrum visualizer. Its primary use case is for desktop windows or backgrounds. Displayed to the left is the radial shader module, and here is a demonstration video. Development is active, and reporting issues is encouranged.

Compiling (Or use the Arch Linux glava package, or the glava-git AUR package):

$ git clone https://github.com/wacossusca34/glava
$ cd glava
$ CFLAGS="-march=native" make
$ sudo make install
$ glava

You can pass BUILD=debug to the makefile for debug builds of both glad and glava, and you can manually specify install targets with INSTALL=..., possible arguments are unix for FHS compliant Linux and BSD distros, osx for Mac OSX, and standalone which allows you to run GLava in the build directory.

Requirements:

  • X11 (Xext, Xcomposite, & Xrender)
  • PulseAudio
  • Linux or BSD

Additional compile time requirements:

  • GCC (this program uses GNU C features)

Optional requirements:

  • GLFW 3.1+ (optional, enable with ENABLE_GLFW=1)

Ubuntu/Debian users: the following command ensures you have all the needed packages and headers to compile GLava:

sudo apt-get install libpulse0 libpulse-dev libglfw3 libglfw3-dev libxext6 libxext-dev libxcomposite-dev python make gcc 

Configuration

GLava will start by looking for an entry point in the user configuration folder (~/.config/glava/rc.glsl*), and will fall back to loading from the shader installation folder (/etc/xdg/glava*). The entry point will specify a module to load and should set global configuration variables. Configuration for specific modules can be done in their respective .glsl files, which the module itself will include.

You should start by running glava --copy-config. This will copy over default configuration files and create symlinks to modules in your user config folder. GLava will either load system configuration files or the user provided ones, so it's not advised to copy these files selectively.

To embed GLava in your desktop (for EWMH compliant window managers), run it with the --desktop flag and then position it accordingly with #request setgeometry x y width height in your rc.glsl.

* On an XDG compliant Linux or BSD system.

Desktop window compatibility

GLava aims to be compatible with most EWMH compliant window managers. Below is a list of common window managers and issues specific to them for trying to get GLava to behave as a desktop window or widget:

WM ! Details
Mutter (GNOME, Budgie) - "native" (default) opacity should be used
KWin (KDE) - "Show Desktop" temporarily hides GLava
Openbox (LXDE or standalone) - No issues
Xfwm (XFCE) - No issues
Fluxbox - No issues
IceWM - No issues
Bspwm - No issues
Herbstluftwm - hc rule windowtype~'_NET_WM_WINDOW_TYPE_DESKTOP' manage=off can be used to unmanage desktop windows
Unity - No issues
AwesomeWM - Defaults to unmanaged
i3 (and i3-gaps) - Defaults to unmanaged
EXWM - EXWM does not have a desktop, and forces window decorations
Enlightenment - Needs testing
Xmonad - Needs testing
Any non EWMH-compliant WM - Window types and hints will not work if the window manager does not support the EWMH standards.

Note that some WMs listed without issues have specific overrides when using the --desktop flag. See shaders/env_*.glsl files for details.

Reading from MPD's FIFO output

Add the following to your ~/.config/mpd.conf:

audio_output {
    type                    "fifo"
    name                    "glava_fifo"
    path                    "/tmp/mpd.fifo"
    format                  "22050:16:2"
}

Note the 22050 sample rate -- this is the reccommended setting for GLava. Restart MPD (if nessecary) and start GLava with glava --audio=fifo.

Licensing

GLava is licensed under the terms of the GPLv3, with the exemption of khrplatform.h, which is licensed under the terms in its header. GLava includes some (heavily modified) source code that originated from cava, which was initially provided under the MIT license. The source files that originated from cava are the following:

  • [cava]/input/fifo.c -> [glava]/fifo.c
  • [cava]/input/fifo.h -> [glava]/fifo.h
  • [cava]/input/pulse.c -> [glava]/pulse_input.c
  • [cava]/input/pulse.h -> [glava]/pulse_input.h

The below copyright notice applies for the original versions of these files:

Copyright (c) 2015 Karl Stavestrand <karl@stavestrand.no>

The modified files are relicensed under the terms of the GPLv3. The MIT license is included for your convience and to satisfy the requirements of the original license, although it no longer applies to any code in this repository. You will find the original copyright notice and MIT license in the LICENSE_ORIGINAL file.

The below copyright applies for the modifications to the files listed above, and the remaining sources in the repository:

Copyright (c) 2017 Levi Webb

Porting

GLava was built with GLFW, making the graphics frontend mostly compatible if it were to be ported to Windows, and I have taken most of the Xlib-specific code and placed it into xwin.c if anyone decides they wish to attempt at a port.