Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tip: mute speakers when at work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
nivw
Apprentice
Apprentice


Joined: 09 Nov 2005
Posts: 261

PostPosted: Sun Sep 04, 2011 10:01 am    Post subject: tip: mute speakers when at work Reply with quote

here is a small hack that makes the laptop notice its at work and so mute the speakers.
so when it starts playing music , i hear it only in my bluetooth headset:
pre requirements:
1. I am using network manager
2. I am using pulse audio
3. I know my WORK_DOMAIN (ask the sys admin or see for yourself)

create this file:
/etc/NetworkManager/dispatcher.d/10mute_at_work
Code:

[ "$DHCP4_DOMAIN_NAME" != "WORK_DOMAIN" ] && exit 0
case "$2" in
    up)
      pactl set-card-profile 0 "input:analog-stereo"
   ;;
esac

now chmod +x /etc/NetworkManager/dispatcher.d/10mute_at_work

when you connect it will run the pactl command that will cause the onboard audio to act as a microphone only
Back to top
View user's profile Send private message
tomk
Administrator
Administrator


Joined: 23 Sep 2003
Posts: 7219
Location: Sat in front of my computer

PostPosted: Sun Sep 04, 2011 11:34 am    Post subject: Reply with quote

Moved from Portage & Programming to Documentation, Tips & Tricks as it fits better here.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum