mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
ratbagctl: check if there is an active profile
This commit is contained in:
@@ -82,6 +82,9 @@ def find_profile(r, args):
|
||||
sys.exit(1)
|
||||
except AttributeError:
|
||||
p = d.active_profile
|
||||
if r is None:
|
||||
print("The device has no active profile")
|
||||
sys.exit(1)
|
||||
return p, d
|
||||
|
||||
|
||||
@@ -530,7 +533,11 @@ def func_profile_name_set(r, args):
|
||||
|
||||
def func_profile_active_get(r, args):
|
||||
d = find_device(r, args)
|
||||
print(d.active_profile.index)
|
||||
profile = d.active_profile
|
||||
if profile is None:
|
||||
print("The device has no active profile")
|
||||
sys.exit(1)
|
||||
print(profile.index)
|
||||
|
||||
|
||||
def func_profile_active_set(r, args):
|
||||
|
||||
Reference in New Issue
Block a user