Ejemplo n.º 1
0
 def __inner(qtile):
     symbol = 'A' if vlu > 0 else 'U'
     subprocess.Popen(f"light -{symbol} {abs(vlu)}", shell=True, text=True)
     if not FAILED_NOTIFY:
         cur_bright = float(
             subprocess.Popen('light',
                              shell=True,
                              text=True,
                              stdout=subprocess.PIPE).communicate()[0][:-1])
         icon = 'display-brightness-off'
         if cur_bright >= 70:
             icon = 'display-brightness-high'
         elif cur_bright >= 40:
             icon = 'display-brightness-medium'
         elif cur_bright > 0:
             icon = 'display-brightness-low'
         notification.update('Brightness Changed', '', icon)
         notification.set_hint('value', gi_variant.new_int32(cur_bright))
         notification.show()
Ejemplo n.º 2
0
 def __inner(qtile):
     sign = '+' if vol > 0 else '-'
     subprocess.Popen(
         f"pactl set-sink-volume @DEFAULT_SINK@ {sign}{abs(vol)}%",
         shell=True,
         text=True)
     if not FAILED_NOTIFY:
         cur_vol = int(
             subprocess.Popen('pamixer --get-volume',
                              shell=True,
                              text=True,
                              stdout=subprocess.PIPE).communicate()[0][:-1])
         icon = 'audio-volume-muted'
         if cur_vol >= 70:
             icon = 'audio-volume-high'
         elif cur_vol >= 40:
             icon = 'audio-volume-medium'
         elif cur_vol > 0:
             icon = 'audio-volume-low'
         notification.update('Volume Changed', '', icon)
         notification.set_hint('value', gi_variant.new_int32(cur_vol))
         notification.show()