Tint2 Brightness and Volume level

If, for some mysterious reason, you would like to see the brightness and volume level in your Tint2 panel, you may use the script below.


Dependencies: alsa-utils, xorg-xbacklight or light-git

Save this as ~/scripts/print_levels.sh and make executable:

# Use the line below with `xorg-xbacklight`
bri=B:$(xbacklight -get | cut -d'.' -f1)%

# or hash out above, unhash below for `light-git` (should work anywhere, e.g. on Radeon graphics)
#bri=B:$(light -G | cut -d'.' -f1)%

vol=V:$(amixer sget Master | grep 'Right:' | awk -F'[][]' '{ print $2 }')

echo -e $out

Then add the executor in Tint2 settings: