fixes to get_volume

This commit is contained in:
piotr
2021-02-21 13:06:26 +01:00
parent e1ecc0fd0c
commit c002a736b1
2 changed files with 13 additions and 5 deletions

View File

@@ -293,13 +293,21 @@ def get_volume():
if result:
lines = result.splitlines()
for line in lines:
if "Front Left:" in line:
if line.strip().startswith("Mono:"):
try:
vol = int(line.split()[4][1:-2])
vol = int(line.split()[3][1:-2])
switch = "on" in line.split()[4]
break
except:
pass
if line.strip().startswith("Front Left:"):
try:
vol = int(line.split()[4][1:-2])
switch = "on" in line.split()[5]
break
except:
pass
return vol, switch

View File

@@ -8,7 +8,7 @@ def read(f_name):
setup(
name='nwg-panel',
version='0.1.2',
version='0.1.3',
description='GTK3-based panel for sway window manager',
packages=find_packages(),
include_package_data=True,