<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>noisybox blog</title>
    <link>https://noisybox.net/blog/rss</link>
    <atom:link href="https://noisybox.net/blog/rss" rel="self" type="application/rss+xml" />
    <description>noisybox.net blog</description>
    <language>en-us</language>
    <webMaster>jason@noisybox.net (Jason Plumb)</webMaster>
    <pubDate>Thu, 02 Apr 2009 06:38:20 GMT</pubDate>
    
      <item>
      	<title>Make sound on Fluxbox volume changes.</title>
      	<link>https://noisybox.net/blog/2009/04/make_sound_on_fluxbox_volume_changes</link>
      	<guid isPermaLink='true'>https://noisybox.net/blog/2009/04/make_sound_on_fluxbox_volume_changes</guid>
      	<pubDate>Thu, 02 Apr 2009 06:38:20 GMT</pubDate>
      	<description>&lt;p&gt;&lt;img src=&#34;http://noisybox.net/blog/images/scream_that_one_sound.jpg&#34; alt=&#34;scream that sound&#34;&gt;&lt;/p&gt;
&lt;p&gt;I recently acquired a &lt;a href=&#34;http://msiwind.net/&#34;&gt;certain netbook&lt;/a&gt; so that I could be frugal but still have the ability to hack while mobile. Of course, I have to run &lt;a href=&#34;http://debian.org&#34;&gt;Debian&lt;/a&gt;...it&amp;#39;s a curse...but it rules.&lt;/p&gt;
&lt;p&gt;Surprisingly, things work altogether very very well. I still don&amp;#39;t think I&amp;#39;m that savvy, but I&amp;#39;ve gotten things to play together quite nicely. I will create a real page and post my results/settings/findings soon....but I made a stupid simple hack tonight that I thought I&amp;#39;d share.&lt;/p&gt;
&lt;p&gt;So I&amp;#39;m running &lt;a href=&#34;http://www.fluxbox.org&#34;&gt;Fluxbox&lt;/a&gt; again. It&amp;#39;s clean, simple, and takes up very little screen real-estate. It&amp;#39;s been a few years, but it&amp;#39;s as elegant and non-intrusive as I remember it.&lt;/p&gt;
&lt;p&gt;The default keys file for fluxbox has commands that grok asla (via alsactl) and are able to nudge the volume up/down based on the magical function modifier keys (like Fn+F7 or Fn+F8 on the Wind). That&amp;#39;s all great...but at least with the sound apps I run (including &lt;em&gt;Flash&lt;/em&gt;!), the defaults aren&amp;#39;t enough because this &amp;quot;Front&amp;quot; control keeps stomping on things (eg. it apparently needs to be massaged after the Master is massaged). I wish this wasn&amp;#39;t the case, it&amp;#39;s stupid, I should complain...Whatever.&lt;/p&gt;
&lt;p&gt;Scripts to the rescue.&lt;/p&gt;
&lt;p&gt;For the MSI Wind, I made three scripts, one does muting, the other two do volume up/down. They look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;tt&gt;#!/bin/bash
for control in Master Front ; do
        amixer sset ${control},0 1+
done
aplay ~/media/sounds/volume_change.wav&lt;/tt&gt;
&lt;/pre&gt;

&lt;p&gt;The 1+ indicates volume up, change to 1- for volume down.&lt;/p&gt;
&lt;p&gt;And then in ~/.fluxbox/keys we can map things like:&lt;/p&gt;
&lt;pre&gt;&lt;tt&gt;176 :Exec ~/bin/volume_up
174 :Exec ~/bin/volume_down
160 :Exec ~/bin/volume_mute&lt;/tt&gt;
&lt;/pre&gt;

&lt;p&gt;What this provides is two things. First, when you press Fn+F7, for example, the Master and Front volume levels will both decrement. The Front is changed last, so that the actual volume output level is applied. Secondly, the &amp;#39;aplay&amp;#39; line gives a little chime to audibly indicate the volume level...something akin to the sound that those $2000 Macintoshes make.&lt;/p&gt;
&lt;p&gt;I found &lt;a href=&#34;http://www.freesound.org/samplesViewSingle.php?id=5297&#34;&gt;this bink sound&lt;/a&gt; on &lt;a href=&#34;http://freesound.org&#34;&gt;freesound&lt;/a&gt; and think it works quite well.&lt;/p&gt;
&lt;p&gt;Until I can create a real page for my Wind setup, scream loud and enjoy the hack.&lt;/p&gt;
</description>
      </item>
    
  </channel>
</rss>
