Skip to content

robert5974/vol_overlay

 
 

Repository files navigation

Summary

vol_control.py and vol_overlay.py are simply programs designed to be run behind the scenes to intercept the media keys (Vol up/down and mute) and control the master Alsa volume level

Example image

vol_control.py

Basic keyboard controls and volume control

vol_overlay.py

Same as vol_control.py but with an added volume bar overlay

Dependencies

The following dependencies are required for vol_control.py

sudo install python-alsaaudio

sudo pip install keyboard

If you want to run vol_overlay.py the following additional dependencies are also required

sudo apt-get install python-opengl

Settings

There are some basic settings that can be configured to change the behaviour and appearance to suit your needs.

vol_control.py

Setting Behavior
CARD Alsa card index you wish to control. Default = 0

vol_overlay.py

Setting Behavior
OMX_LAYER Layer to render overlay
HIDE_DELAY Number of seconds to show overlay for after changing volume
BACKGROUND_COLOR Color of background image
BACKGROUNDBAR_COLOR Colour of inactive volume bar
BAR_COLOR Color of active volume bar

Additionally, the following images are used and can be changed as required. All images must be saved as 32-bit pngs

Image Usage
background.png Background shading
bar.png Active and inactive volume bar shading
speaker.png Unmuted image
muted.png Muted image

Running

Due to globally monitor keyboard input without X11, both vol_control and vol_overlay must be run as root (See https://pypi.python.org/pypi/keyboard/ for more details)

sudo python vol_control.py

or

sudo python vol_overlay.py

Images

Icons from http://www.softicons.com/system-icons/crystal-project-icons-by-everaldo-coelho

About

Volume overlay

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%