LinkedIn Sourceforge Twitter

Vincent's Blog

Pleasure in the job puts perfection in the work (Aristote)

Tint2 snippet for Audio

Posted on 2018-03-29 19:29:00 from Vincent in OpenBSD Desktop Tint2

As discussed in this blog, I'll detail my Audio snippet for Tint2.


I just remind you that this snippet for Tint2 allow me to display an icon on my status bar for all what concerns Audio.

As presented in this blog, there are several statuses for this icon.

In the following screenshots, the NFS icon is the 3rd one:


Source code is available here

This audio snippet for Tint2 allows me to quickly see the level of my audio outputs.
Thanks to the mouse's wheel, I'm also able to adjust the audio output level.

Automatic installation

There is no prerequisites for this script. It just use standard tools and commands.

For the installation, I provide you a Makefile doing the tasks for you. Just do:

make install

This script will modify your ~./config/tint2/tint2rc file !!!!.

Manual installation

If you prefer, you can do the installation manually by doing the following:

Add the following elements in your ~/.config/tint2/tint2rc file

# Executor 3
execp = new
execp_command = ~/.config/tint2/
execp_interval = 3
execp_has_icon = 1
execp_cache_icon = 1
execp_continuous = 0
execp_markup = 1
execp_tooltip = Sound control (mouse wheel to modify)
execp_lclick_command = ~/.config/tint2/ -t
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = ~/.config/tint2/ 10
execp_dwheel_command = ~/.config/tint2/ -10
execp_font_color = #000000 100
execp_padding = 1 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 30
execp_icon_h = 0

In my case the Audio icon is located on the 3rd executor this explains the 1st line.

If you adapt the tint2rc file with an editor, do not forget to adapt the following element by Adding an "E" at the good place:

panel_items =

Finally perform some copies on ~/.config/tint2:

cp ~/.config/tint2
cp -r icons/* ~/.config/tint2/icons/
chmod +x ~/.config/tint2/

Parameters to adapt

There is no parameter to adapt. The script should find all elements on is own

What does the Audio snippet ?

The script accept different parameters:

  • no parameter: he just report the correct icon based on the current level of output sound

  • "-t": he toggle the mute feature.

  • value: he adapts the level of outputs.master with the provided value. This is a relative adaptation; so if you put a value of 10, he will increase the output level by 10. If you put -10 e will decrease the output value for 10.

In all cases, the value will remains between 0 and 250.

Possible inter-actions

By click in the audio icon, you can toggle the mute feature.

By using the wheel features of your mouse when you are on the audio icon, he will increase (or decrease) the level of output sound

24, 25
displayed: 4039

What is the first letter of the word Python?