Today I’ll stay home instead going to the Amsterdam office. I have a terrible headache and i stay better on the dark-silence.
But i want to stay in touch with the office so i start my email, chat, and other web apps, but suddenly I realize that probably in the office, my colleagues hear a sound for each chat, email i receive and calendar alarms as well.
So I wanted to shut down my pc speaker in the office from ssh.
What i did was typing into a ssh shell:
amixer sset Master toggle
For next time, since I don’ trust my memory, I created a shell script with just that line into it, so i could call it with a easy name like “volume”. (If you too want to do so, remember to add “#!/bin/bash” on the very first line of the script otherwise you have to call the shell together with the script, in other words you need to feed the shell with the script as argument).
Then Chmod it in order to be executable
chmod +x volume
And if you want to do it 100% complete, just move the file you created into /usr/bin, so it will be possible to call that file without the complete path, like a system binary.
I added a cron job right some minutes after my usual leaving time in the office so, i don’t have to concern about this any longer. 🙂
This one is nice because it doen’t toggle but it can set a precise percentage amount of volume:
amixer -c 0 cset iface=MIXER,name="Master Playback Volume",index=0 50%