How to switch quickly between the native soundcard and USB speakers?

My computer has two sound devices: one, the native sound card (which I use for my headphones), and an external pair of USB speakers. However, switching between them is a complicated task, mainly because I find almost no programs to do it:
* GNOME Control Center, Sound section: What currently works for me, but can only be used within GNOME Shell or Cinnamon. It can be used from other sessions, though (for example Spectrwm), but it's very heavyweight to have the whole GNOME desktop solely to switch between sound cards.
* KMix: Works only within KDE and nowhere else. What's more, to actually do the switch one must open the program, go to the options menu and select the soundcard (unlike GNOME, which is two clicks away from the status bar).
* Pavucontrol: Kind of works, but only in a per-application basis. That is, I can't tell the system to start all current and future sound streams in X device. What's worse, I must wait until the application is open to actually do the switch.
* XFCE4 Mixer: Doesn't work from outside XFCE. Even there, switching cards is not possible without literally editing a configuration file each time.
* Alsamixer and GNOME Alsamixer: Can't switch sound cards at all.
So, I'm still on the search of a lightweight program that can allow me to do something as simple as switching between my USB speakers and native headphones without much hassle. Is there anything else besides GNOME that can do the trick?

The script I use with pulse.
#/bin/bash
# paswitch 2011-02-02 by Ng Oon-Ee <[email protected]>
# I can't remember where I found this script, can't locate the original author.
# Please inform me if you know, so that I can give proper attribution.
# CHANGES: Added auto-move all inputs to new default sound card.
# WAS: Pulse Audio Sound Card Switcher v1.0 2010-01-13
# Switches between soundcards when run. All streams are moved to the new default sound-card.
# $totalsc: Number of sound cards available
totalsc=$(pacmd "list-sinks" | grep index: | wc -l) # total of sound cards: $totalsc
if [ $totalsc -le 1 ]; then # Check whether there are actually multiple cards available
notify-send -u critical -t 5000 "Nothing to switch, system only has one sound card."
exit
fi
# $scindex: The Pulseaudio index of the current default sound card
scindex=$(pacmd list-sinks | awk '$1 == "*" && $2 == "index:" {print $3}')
# $cards: A list of card Pulseaudio indexes
cards=$(pacmd list-sinks | sed 's|*||' | awk '$1 == "index:" {print $2}')
PICKNEXTCARD=1 # Is true when the previous card is default
count=0 # count of number of iterations
for CARD in $cards; do
if [ $PICKNEXTCARD == 1 ]; then
# $nextsc: The pulseaudio index of the next sound card (to be switched to)
nextsc=$CARD
PICKNEXTCARD=0
# $nextind: The numerical index (1 to totalsc) of the next card
nextind=$count
fi
if [ $CARD == $scindex ]; then # Choose the next card as default
PICKNEXTCARD=1
fi
count=$((count+1))
done
pacmd "set-default-sink $nextsc" # switch default sound card to next
# $inputs: A list of currently playing inputs
inputs=$(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}')
for INPUT in $inputs; do # Move all current inputs to the new default sound card
pacmd move-sink-input $INPUT $nextsc
done
# $nextscdec: The device.description of the new default sound card
# NOTE: This is the most likely thing to break in future, the awk lines may need playing around with
nextscdesc=$(pacmd list-sinks | awk '$1 == "device.description" {print substr($0,5+length($1 $2))}' \
| sed 's|"||g' | awk -F"," 'NR==v1{print$0}' v1=$((nextind+1)))
#notify-send "Default sound-card changed to $nextscdesc"
dbus-send --session --type=method_call --reply-timeout=10000 \
--dest=org.freedesktop.Notifications /org/freedesktop/Notifications \
org.freedesktop.Notifications.Notify string:"paswitch" uint32:1 \
string:$icon_name string:"Default sound card is now" string:"$nextscdesc" \
array:string:"" dict:string:string:"","" int32:3000
exit
# Below text was from original author and remains unaltered
# CC BY - creative commons
# Thanks God for help :) and guys lhunath, geirha, Tramp and others from irc #bash on freenode.net

Similar Messages

  • I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    Hi...
    Mac OS X keyboard shortcuts
    Control-F4
    Move focus to the active (or next) window
    Shift-Control-F4
    Move focus to the previously active window
    By the way...  since you are new to Mac, click a clear space on your Desktop. You should see "Finder" top left corner of the screen in the menu bar.
    Click Help then click Help Center
    As an example type in    keyboard shortcuts
    You can use the Help menu for almost any application on your Mac.
    Apple - Find Out How - Mac Basics
    For held switching from PC to Mac >  Apple - Support - Switch 101

  • HT4623 after the ios 7.0 update my iphone 4s and ipad keep switching in between the home screen and the apple loading screen, can anybody help?

    Can anybody help with the above?
    i.e
    both my iphone 4s and ipad switch in between the home screen and the apple loading screen
    Many thanks

    I would connect each device to a power source, and then reset them by holding the power button and the home button until they turn off.
    If it keeps happening, I would put the devices in recovery mode and restore them with iTunes.
    This article will help with that if needed:
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808

  • Switching between the firewire connection and USB 2.0 Connection

    Is it possible to switch between the firewire connection and USB 2.0 Connection on a portable external hard drive? I've tried unsuccessfully to use the firewire connection on my external hard drive after using the 2.0 connection. No machine will read the drive if it is connected via the firewire port. Using USB 2.0 it works as intended.

    Hello Grizzly Marmot,
    Thank you for the feedback. So probably my old MAXTOR enclosure is playing me tricks ....
    Last night the backup on my USB 2.0 was terribly slow ??? The incremental duplication of my hard drive (372.9 MB of data from 35GB of complete data) gave me these stats:
    Copied : 6232 files, 372,9 Mo
    Average : 8,8 Mo/minute (4,5 copying, 148,1 verifiying)
    Just to analyse the drive it takes ±45 minutes ??? Also could the energy saving mode be a slow down factor (the suspension of the computer is NEVER) ???
    I still wonder what speed I could experience for a wireless backup to a NAS drive ??
    Thanks for helping.
    Robert

  • How to switch quickly between Pages documents?

    Is there a way to switch quickly, back and forth, between open Pages documents. Similar to the "tabs" function in Safari.

    fruhulda wrote:
    I which the help files were adapted for swedish keyboard when in swedish!!
    We can't get that because the User Guides are translated by beings which never used the application.
    They receive an English text and they must translate it in an other language.
    I'm accustomed to that for years and I would be surprised if something changes in this area.
    As far as I know, nobody in Apple France saw the localized iWork '09 before the day it was introduced.
    I was asked to search oddities *_after the delivery_*
    Some oddities available in iWork '08 French version are always here in iWork '09 and I'm not sure that they will be gone when we will get the next version.
    It was the same for AppleWorks which I beta tested two times.
    Tests where made upon the US version and all of us discovered the localized versions when they where delivered. In the Help, every examples of formulas where using the comma as parameters separators when the correct one was the semi-colon.
    For sure, it's ridiculous but it's the way foreign customers are treated by Apple.
    I'm remembering that I edited a resource dedicated to samples of functions.
    With the edited resource, Swiss users where able to use the "insert functions" feature with the separator matching their system settings.
    The problem is the same with iWork.
    The delivered French version inserts functions with semi-colons between parameters, even is the user setting is "Swiss French" which use the decimal period and require the comma as separator.
    Same behavior with Deutsch and Italian.
    But not is completely bad.
    I never succeed when I requested correct treatment of "curly quotes" in AppleWorks.
    For info, the correct structure is *_« caractères chevrons »_* (the first space and the last one are required, at least for French of France).
    I started to request them when I start using iWork '06.
    They wheren't introduced by the different updaters but, hosannah, they are available in iWork '08.
    In fact, we got only the quotes, not the required spaces.
    So I requested again the spaces.
    They wheren't introduced by the different updaters but, hosannah, they are available in iWork '09.
    I remember that I wrote to Apple that I was surprised to see that their staff of engineers appeared to be less efficient than the single developer which was delivering Bean.
    Yvan KOENIG (VALLAURIS, France) vendredi 14 janvier 2011 18:47:14

  • I have english and arabic key board, how to switch in between the 2 in writing e

    Hi, I have English and Arabic letters keyboard, how to switch between the 2 in writing

    can you see a flag on the top right corner if you click on that you can switch between the keyboards you have installed on your system

  • How is the interface between the Java Stack and ABAP stack is achieved?

    How is the interface between the Java Stack and ABAP stack is achieved?..Please send me the answer to [email protected]

    Hi,
    By interface, I assume you mean the connection between the ABAP and the Java stacks in a double stack system.
    The connection from Java to ABAP is through JCo connections defined in the WebDynpro section of the J2EE start page. So Java to ABAP requests are processed through JCo.
    The connection from ABAP to Java is through RFC connections defined in TA SM59. The ABAP to Java requests are processed through RFC.
    Refer https://dsd.esco-salt.com/StartPage/documents/integration/3.html for detailed explanation.
    The UME can be maintained in either ABAP or in JAVA depending on the persistence.
    Refer: http://help.sap.com/saphelp_nw70/helpdata/en/5b/5d2706ebc04e4d98036f2e1dcfd47d/frameset.htm
    Check UME data source configuration.
    Some quick FAQs can be found at:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad47eb90-0201-0010-7cb2-ddfa5ed879ec
    Hope this helps.
    Best Regards,
    Srividya.R

  • Switching between the Classic View and the Tree View in transaction FEBA

    Hi All
    I would like to know how to switch between the Classic View and the Tree View on transaction FEBA for post processing of bank statements. I have a scenario where in the DEV client the transaction is calling up the Tree View and in my QA environment it calls up the Classic View, and I would like to know if there is a way to easily switch between the two views.
    I'd appreciate your assistance.

    Hi,
    I think you can do the same using transaction codes FEBA and FEBAN.
    Thanks
    Aravind

  • I have 2 profiles on one computer. How to share music between the profiles in itunes?, I have 2 profiles on one computer. How to share music between the profiles in itunes?

    I have 2 profiles on one computer. How to share music between the 2 separate profiles in iTunes?

    iTunes: How to share music between different accounts on a single computer
    This might help. info provided by 'b noir'
    iMoz

  • My daughter and I both have an iPhone and we have shared my apple ID. Now her phone is syncing with mine and we want to have different contacts. How do I differentiate between the two phones?

    My daugher and I both have an iPhone and we have shared my apple ID. She just replaced her phone and now our contacts are syncing -- and we don't want that. How do I differentiate between the two phones?

    Is the same Apple iCloud account being accessed on each iPhone?

  • My IPhone has a different ICloud Apple ID than my iPad. How can I stream between the two devices

    My iPhone has a different id than my iPad. How can I stream between the two devices

    I should say that you can add the other account to each device as a seconday account by going to Settings>Mail,Contacts,Calendars>Add Account>iCloud and signing in with the ID the other device is using.  This would allow you to see mail, contacts, calendars, reminders and notes from the other account alongside the same data from the primary account on each device.

  • HT1305 how can i turn down the fan rpm that's between the optical drive and hdd in my power mac g5 dual 2.3?

    how can i turn down the fan rpm that's between the optical drive and hdd in my power mac g5 dual 2.3?

    Ok, I saw that error in your logic. A Dual G5 2.3 or even a Dual Core 2.3 does NOT use LCS at all. Its air cooled and if anything if the OP is experiencing this problems could be due to possible heatsink paste drying up. He might have to re-apply MX 7 or Arctic Silver.
    The only G5's that use LCS are: G5 dual 2.5 from Late 2004, the G5 Dual 2.7 from Early 2005, and lastly the G5 Quad-Core from Late 2005-end of September 2006.
    Hope this helps.

  • How to delete the line between the last point and first point?

    How to delete the line between the last point and first point? 
    I want to draw a curve many times, from first point to the end point. and redraw from first point to the end point.But I hope update point by point. but between the end point and the first point,  there is a line. How to delete the line?
    the code is:
    CNiReal64Vector plotData(50);
    m_graph.ChartLength = 50;
    //m_graph.ClearData();
    for (int j = 0; j < 2; j++)
           for (int i=0; i<50; i++)
                   plotData[i] = ((double)rand()/(double)RAND_MAX)*6 + 4;
                   m_graph.GetPlots().Item("Plot-1").ChartXY(i, plotData[i]);
                   Sleep(100);
    Attachments:
    20150605142608.png ‏31 KB

    Hi Kumar,
    I think you can just delete it in the sales order directly, if you are using make-to-order scenario, then there will be special stock left for the sales order as the production has been goods receipt, you need to use MM transaction move the stock to unrestricted use stock. If you are using make-to-stock scenario, there should be no further problem. If you are using assembly order, please try to reject the sales order item to see if it could fullfill your requirement.
    Regards,
    Rachel

  • My horizontal bar , between the navigation bar and tabs bar is cluttered how do I delete some of these tabs

    i want to delete some tabs from the bar between the navigation bar and the tab bar.
    == This happened ==
    Not sure how often
    == recently

    See [[Deleting bookmarks]]
    You can open the Bookmarks Manager (Library: Bookmarks > Organize Bookmarks) and select in the left pane "All Bookmarks > Bookmarks Toolbar" and select the bookmarks that you want to remove.

  • How can I distinguish between the first and the rest in Smartforms??

    I have made an Invoice in Smartform. I have to take three copies of that. In the first copy it will be printed "ORGINAL INVOICE" and in the next copies it will print "Duplicate copy".  How can I distinguish between the first and the rest in Smartforms??
    Regards,
    Subhasish

    >
    Subhasish Ganguly wrote:
    > I have made an Invoice in Smartform. I have to take three copies of that. In the first copy it will be printed "ORGINAL INVOICE" and in the next copies it will print "Duplicate copy".  How can I distinguish between the first and the rest in Smartforms??
    Hello Vamshi,
    As per the OP's requirement he has to print 3 copies of the invoice. Which according to my understanding should be printed at the same time ? May be i am wrong in interpreting this.
    You must be knowing you can control the print params of the SmartForms in CONTROL_PARAMETERS where you set the NO_DIALOG & in the OUTPUT_OPTIONS pass the number of copies.
    I think the solution you have proposed the "Original Copy" will be printed only once. (Correct me if i am wrong)
    Every time the user prints the invoice again he will be getting a "Duplicate Copy". If this is what the OP wants the logic is perfect
    Cheers,
    SUhas

Maybe you are looking for