fixed mic mute led

This commit is contained in:
paul-loedige
2021-11-05 18:37:17 +01:00
parent e0fa2f3110
commit 618303c2f4
4 changed files with 10 additions and 2 deletions
+3
View File
@@ -1,6 +1,7 @@
import subprocess import subprocess
import psutil import psutil
import re import re
import os
from libqtile import widget, bar from libqtile import widget, bar
@@ -104,8 +105,10 @@ class Mic(widget.base._TextBox):
def _update_drawer(self): def _update_drawer(self):
if self.emoji: if self.emoji:
if self.volume > 0: if self.volume > 0:
subprocess.call([os.path.expanduser('~/.config/qtile/mic_led.sh'), "0"])
self.text = '' self.text = ''
elif self.volume <= 0: elif self.volume <= 0:
subprocess.call([os.path.expanduser('~/.config/qtile/mic_led.sh'), "1"])
self.text = '' self.text = ''
else: else:
if self.volume == -1: if self.volume == -1:
+4
View File
@@ -60,11 +60,15 @@ keys = [
Key(['control'], 'XF86AudioRaiseVolume', lazy.spawn('amixer set Capture 1%+'), desc="increase mic volume"), Key(['control'], 'XF86AudioRaiseVolume', lazy.spawn('amixer set Capture 1%+'), desc="increase mic volume"),
Key(['control'], 'XF86AudioLowerVolume', lazy.spawn('amixer set Capture 1%-'), desc="decrease mic volume"), Key(['control'], 'XF86AudioLowerVolume', lazy.spawn('amixer set Capture 1%-'), desc="decrease mic volume"),
Key(['control'], 'XF86AudioMute', lazy.spawn('amixer set Capture toggle'), desc="toggle mic mute"), Key(['control'], 'XF86AudioMute', lazy.spawn('amixer set Capture toggle'), desc="toggle mic mute"),
Key([], 'XF86AudioMicMute', lazy.spawn('amixer set Capture toggle'), desc="toggle mic mute"),
# Media hotkeys # Media hotkeys
Key([], 'XF86AudioNext', lazy.spawn('playerctl next')), Key([], 'XF86AudioNext', lazy.spawn('playerctl next')),
Key([], 'XF86AudioPrev', lazy.spawn('playerctl previous')), Key([], 'XF86AudioPrev', lazy.spawn('playerctl previous')),
Key([], 'XF86AudioPlay', lazy.spawn('playerctl play-pause')), Key([], 'XF86AudioPlay', lazy.spawn('playerctl play-pause')),
Key([mod], 'Right', lazy.spawn('playerctl next')),
Key([mod], 'Left', lazy.spawn('playerctl previous')),
Key([mod], 'Down', lazy.spawn('playerctl play-pause')),
# backlight keys # backlight keys
Key([], 'XF86MonBrightnessUp', lazy.spawn('xbacklight -inc 5')), Key([], 'XF86MonBrightnessUp', lazy.spawn('xbacklight -inc 5')),
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
echo $1 | tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
+1 -2
View File
@@ -2,5 +2,4 @@
import os import os
import subprocess import subprocess
home = os.path.expanduser('~/.config/qtile/autostart.sh') subprocess.call([os.path.expanduser('~/.config/qtile/mic_led.sh'), "0"])
subprocess.call([home])