Zooper Widget headphone variable [req. tasker]

Posted: 2014/04/09 in Tasker, Zooper Tutes
Tags: , , ,

This is a guide [using Tasker] to make a widget, or elements of a widget appear when headphones are plugged in and hide when headphones are taken out.

Things you will need:

Setting up the tasks in Tasker:

  • Task1 (Name it HeadIn)
    1. Add an action
    2. Choose: Plugin -> Zooper Widget Pro
    3. Configuration: ZW Variable = HEAD | ZW Text = 1
    4. Task should look like this when done

  • Task2 (Name it HeadOut)
    1. Add an action
    2. Choose: Plugin -> Zooper Widget Pro
    3. Configuration: ZW Variable = HEAD | ZW Text = 0
    4. Task should look like this when done:

Headout

Setting up the Profile in Tasker:

  1. Add profile – name it ‘Headphone Variable’
  2. Choose: State ->Hardware -> Headset Plugged -> Any
  3. Pick the first task you created (HeadIn)
  4. Long press that task and press ‘Add Exit Task’ (see screenshot below)

ExitTask

  1. Choose the second task you created (HeadOut)
  2. That’s it you’re done with tasker.  Now when you insert your headset, the variable #THEAD# will toggle to 1 and when you unplug it will go back to 0.

Now we’re on to setting up the Widget to deal with the variable:

Setting up the widget:

  1. Create a zooper widget that you like as you normally would (probably makes sense for it to be a media widget).
  2. Now you’ll want to use the #THEAD# variable to hide any modules that you don’t want shown when the headset isn’t plugged in (this might be all elements).
  3. To do this add [ox]$#THEAD#=0?5000[/ox] to the Advanced Parameters of all the elements you want to hide when the headset is not plugged in (the AP says, If Headphones unplugged, offset the element by 5000 i.e. off screen).
  4. Now give it a go. Plug your headset in, and see if all the elements appear as they should.  Unplug and they should disappear.
  5. If not, go back to the widget and check you’ve done it all correctly.

Once you’ve done this you should get a nice dynamic widget as see below:

HPMedia

You can see this in action in my Carded (HiddenMedia & Media/Event), HexyBeast (hexMediaHP), and xdaZooper Pro (xdaMediaEvent) Skins on the Play Store.

Advertisements

Comments are closed.