[Haskell] ANN: mute-unmute-0.2.0.0

Bailo, John John.Bailo at Bowne.com
Wed Sep 1 12:23:01 EDT 2010


If you’re good with sound applications, two others I could use are:

 

1)      Universal mixer.   Some linux apps (vlc) have a mixer, but there isn’t the equivalent of the SoundMax app that only runs in windows for my nVidia audio chipset

2)      Automatic Leveler.   For when you’re watching a streaming movie, and half the dialogue is really quiet…but then there’s a car chase and things start exploding.

 

 

 

From: haskell-bounces at haskell.org [mailto:haskell-bounces at haskell.org] On Behalf Of Krzysztof Skrzetnicki
Sent: Friday, August 27, 2010 4:17 PM
To: Haskell Cafe; Haskell
Subject: [Haskell] ANN: mute-unmute-0.2.0.0

 

Hello!

 

I'm pleased to announce a small utility program I wrote recently. Today I pushed version 0.2.0.0 of mute-unmute to Hackage, from with you can cabal-install it right now (following the usual 'update' step). What it does? It's simple: it will mute the sound when you lock your screen and unmute it back again when you unlock it.

 

Why anyone would need such program? Well, this is a little bit more complicated.

 

I work in "open space" kind of office. It can get quite noisy there. I often sit with headphones on, but when I walk away from my desk I put them down and lock my screen. Here comes uncomfortable moment: when I remove my headphones suddenly people around me who doesn't use their headphones now start to hear the music I listen to. And they don't always like it, so I manually mute the sound to make happy.

 

But now, instead of doing this task by hand I have a program do it for me :-)

 

Unfortunately this kind of programs tend to be pretty much platform specific. Current version supports the recent versions of Gnome and KDE, but needs ALSA. It's quite common setup, but if you happen to have a different one you can easily hack the code (it's very straightforward) and send me patches. Patches are always welcome. The source repo is on Github and released versions are on Hackage:

 

Github: 

http://github.com/Tener/mute-unmute

Hackage: 

http://hackage.haskell.org/package/mute-unmute <http://hackage.haskell.org/package/mute-unmute> 

 

Example use:

 

~/ mute-unmute # first session, it will ask for configuration options

mute-unmute: Creating config directory...

mute-unmute: Mute config is missing...

Mute sound card and press RETURN

 

mute-unmute: Unmute config is missing...

Unmute sound card and press RETURN

 

mute-unmute: Session: UnixAbstract {addrPath = "/tmp/dbus-1tB1AEUcgg", addrGuid = Just "19ec85e3778816ad38a77bbf0000003f"}

mute-unmute: Connected

mute-unmute: Handler added: [MatchType Signal,MatchInterface "org.gnome.ScreenSaver",MatchMember "ActiveChanged",MatchPath "/org/gnome/ScreenSaver"]

mute-unmute: Handler added: [MatchType Signal,MatchInterface "org.freedesktop.ScreenSaver",MatchMember "ActiveChanged",MatchPath "/ScreenSaver"]

^C

 

~/ mute-unmute # remembers previous options which can be changed by calling with --store switch

mute-unmute: Session: UnixAbstract {addrPath = "/tmp/dbus-1tB1AEUcgg", addrGuid = Just "19ec85e3778816ad38a77bbf0000003f"}

mute-unmute: Connected

mute-unmute: Handler added: [MatchType Signal,MatchInterface "org.gnome.ScreenSaver",MatchMember "ActiveChanged",MatchPath "/org/gnome/ScreenSaver"]

mute-unmute: Handler added: [MatchType Signal,MatchInterface "org.freedesktop.ScreenSaver",MatchMember "ActiveChanged",MatchPath "/ScreenSaver"]

mute-unmute: Message {mType = Signal, mFlags = [NoReplyExpected], mSerial = 31, mPath = Just "/org/gnome/ScreenSaver", mInterface = Just "org.gnome.ScreenSaver", mMember = Just "ActiveChanged", mErrorName = Nothing, mReplySerial = Nothing, mDestination = Nothing, mSender = Just ":1.19", mBody = [Variant (True) {- b -}]}

mute-unmute: Lock screen

mute-unmute: Message {mType = Signal, mFlags = [NoReplyExpected], mSerial = 32, mPath = Just "/org/gnome/ScreenSaver", mInterface = Just "org.gnome.ScreenSaver", mMember = Just "ActiveChanged", mErrorName = Nothing, mReplySerial = Nothing, mDestination = Nothing, mSender = Just ":1.19", mBody = [Variant (False) {- b -}]}

mute-unmute: Unlock screen

^C

 

 

You can get usage information with --help switch:


~/ mute-unmute --help
mute-unmute
         --store         ask for mute and unmute configurations
         --store-mute    ask for mute configuration
         --store-unmute  ask for unmute configuration
 -d      --daemon        wait for screensaver state changes
 -h, -?  --help          show help

 

There isn't much more I can say. I hope you find the program at least educational (as a simple example of DBus usage) if not useful.

 

Best regards,

Krzysztof Skrzętnicki


CONFIDENTIALITY NOTICE: The information in this Internet email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20100901/f9fcf6a6/attachment-0001.html


More information about the Haskell mailing list