Beispiel #1
0
 def format(self, volume, muted, var, card_name, mixer_name):
     """ Format notification body """
     message = self.config.get(self.config.get_default_section(), "notify_body")
     volume = Icons.get_volume_name(volume, muted)
     message = message.replace('{volume}', '%s%s' % (volume, var))
     message = message.replace('{card}', '%s: %s' % (_("Card"), card_name))
     message = message.replace('{mixer}', '%s: %s' % (_("Mixer"), mixer_name))
     return message
Beispiel #2
0
 def update(self, info):
     """ Update icon """
     [volume, muted, var, card_name, mixer_name] = info
     vol = volume[0]
     if (muted):
         vol = 0
     icon = Icons.get_icon_name_by_volume(vol)
     self.set_from_icon_name(icon)
     
     #""" Update tooltip """
     tooltip = "<b>%s: %s%s </b>\n<small>%s: %s\n%s: %s</small>" % (
             _("Output"), Icons.get_volume_name(vol, muted),
             var, _("Card"), card_name,
             _("Mixer"), mixer_name)
     self.set_tooltip_markup(tooltip)