diff --git a/.config/i3pystatus/rfkill-bt.py b/.config/i3pystatus/rfkill-bt.py index 1d5406c..109aa55 100755 --- a/.config/i3pystatus/rfkill-bt.py +++ b/.config/i3pystatus/rfkill-bt.py @@ -1,9 +1,16 @@ #!/usr/bin/python -import pyric.utils.rfkill as rfkill -import sys +from subprocess import check_output -devices = rfkill.rfkill_list() + +devices = {} + +for line in check_output(['rfkill', '-rn']).decode('UTF-8').splitlines(): + nr, identifier, device, soft, hard = line.split(' ') + devices[device] = { + 'soft': True if soft == 'blocked' else False, + 'hard': True if hard == 'blocked' else False, + } if devices['tpacpi_bluetooth_sw']['hard']: bt = '#FF0000' diff --git a/.config/i3pystatus/rfkill-wifi.py b/.config/i3pystatus/rfkill-wifi.py index 70150d7..29f9b63 100755 --- a/.config/i3pystatus/rfkill-wifi.py +++ b/.config/i3pystatus/rfkill-wifi.py @@ -1,9 +1,16 @@ #!/usr/bin/python -import pyric.utils.rfkill as rfkill -import sys +from subprocess import check_output -devices = rfkill.rfkill_list() + +devices = {} + +for line in check_output(['rfkill', '-rn']).decode('UTF-8').splitlines(): + nr, identifier, device, soft, hard = line.split(' ') + devices[device] = { + 'soft': True if soft == 'blocked' else False, + 'hard': True if hard == 'blocked' else False, + } if devices['phy0']['hard']: wlan = '#FF0000'