How to display a volume bar on the screen when volume level is changed?
  • How can I display a volume bar on the screen? Something like this or whatever:



    I've found these pages that probably do what I'm looking for but I really have no idea what to do with it...
    http://how-to.wikia.com/wiki/Howto_show_volume_in_Linux_with_On-Screen_Display
    https://forum.lxde.org/viewtopic.php?f=8&t=31892

    What I want is a volume indicator to be displayed every time I change the sound volume. Currently I use this command to change the sound volume:
    amixer -D pulse -q sset Master 10%+ unmute

    and every time I do it a sound is played:
    play -t mp3 /home/pemartins/Arquivos/click.mp3

    and I want to add another line to show the volume level on the screen for a second or so but I have no idea how to do it.
  • lxlelxle
    PMPosts: 2,656
    did you try using the script on the lxde link?
  • I think I did, I copied the code into a mew file, called that file "testa", made it executable, opened a terminal window on its folder, typed "./testa" and all I got was this:

    $ ./testa
    Argument number incorrect, only one parameter is needed
    ./testa: line 73: return: can only `return' from a function or sourced script
    Wrong parameter value !
    Possible values are: up, down, mute
    ./testa: line 97: return: can only `return' from a function or sourced script
    ./testa: line 101: return: can only `return' from a function or sourced script

    Maybe it didn't use properly but I don't know another possible way to use it.

    Also tried the first script in the first link and only got this:

    $ ./testa
    Specify a scontrol identifier: 'name',index
    ./testa: line 6: [: ==: unary operator expected
    Specify a scontrol identifier: 'name',index
    ./testa: line 15: let: volcounter=volset/: syntax error: operand expected (error token is "/")
    ./testa: line 22: [: -gt: unary operator expected
    ./testa: line 32: aosd_cat: command not found

  • I would be interested in this, aswell. Any luck yet?