5

I know that the following command increases volume

amixer -D pulse sset Master 10%+

This command only increases the volume, but does not show any GUI notifications. But, the default Volume Up key also gives GUI and sound notifications.

What commands are called when I press the Volume Up button?

2 Answers 2

2

I don't know exactly what command is being invoked while pressing volume up button however I believe that it's not a single command. You can simulate and achieve same behavior by using three simple command:

  1. To increase the volume as you know:

    amixer -D pulse sset Master 10%+
    
  2. To send a notify:

    notify-send Volume volume has been increased by +10
    
  3. To play a song:

    paplay '/usr/share/sounds/KDE-Window-All-Desktops-Not.ogg'
    

change the file address with anything you want, you can find different songs at:

/usr/share/sounds/

or run a simple search:

locate .ogg | grep /share
3
  • It's likely that the GUI doesn't call any command at all. It will make use of libraries.
    – muru
    Aug 31, 2017 at 7:34
  • @muru Exactly, and so can we!
    – dessert
    Sep 21, 2017 at 7:12
  • So, how do I do that?! Jan 14, 2018 at 10:55
0

You‘re probably searching for the X On-Screen Display library XOSD. The package is called xosd-bin and the command osd_cat is used to display text, status bars etc. on the screen.

osd_cat -b percentage -P 20 -T Status: -f "-adobe-helvetica-bold-*-*--34-*-*-*-*"

displays

enter image description here

See this German wiki page for options and examples and man osd_cat for more.


As others already pointed out, sounds can be played using a player like aplay, paplay, cvlc, mplayer, cmus, … – Where do I find system sounds?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .