mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools/ratbagctl.in: use RatbagDevice's active_profile property
This commit is contained in:
committed by
Benjamin Tissoires
parent
43f033db80
commit
50dc321b7b
@@ -79,11 +79,7 @@ def find_profile(r, args):
|
||||
print("Invalid profile index {}".format(args.profile_n))
|
||||
sys.exit(1)
|
||||
except AttributeError:
|
||||
for p in d.profiles:
|
||||
if p.is_active:
|
||||
break
|
||||
else:
|
||||
p = None
|
||||
p = d.active_profile
|
||||
return p, d
|
||||
|
||||
|
||||
@@ -488,12 +484,7 @@ def func_profile_name_set(r, args):
|
||||
|
||||
def func_profile_active_get(r, args):
|
||||
d = find_device(r, args)
|
||||
for p in d.profiles:
|
||||
if p.is_active:
|
||||
break
|
||||
else:
|
||||
p = None
|
||||
print(p.index)
|
||||
print(d.active_profile.index)
|
||||
|
||||
|
||||
def func_profile_active_set(r, args):
|
||||
|
||||
Reference in New Issue
Block a user