@@ -62,11 +62,11 @@ def Field(*args, **kwargs):
6262 return _Field (* args , ** kwargs )
6363
6464
65- class MenuItemNameDict (BaseModel ):
65+ class TargetIsBaseConStr (BaseModel ):
6666 """
67- Variable menu item name .
68- Use this dictionary if the menu item name depends on installation parameters
69- such as the target environment.
67+ Variable that depends on whether or not the the installation is in the base env .
68+
69+ This can help configure the menu item on if the system is in a base environment.
7070 """
7171
7272 target_environment_is_base : Optional [constr (min_length = 1 )] = Field (
@@ -78,6 +78,21 @@ class MenuItemNameDict(BaseModel):
7878 description = ("Name when target environment is not the base environment." ),
7979 )
8080
81+ class TargetIsBaseConList (BaseModel ):
82+ """
83+ Variable that depends on whether or not the the installation is in the base env.
84+
85+ This can help configure the menu item on if the system is in a base environment.
86+ """
87+
88+ target_environment_is_base : Optional [conlist (str , min_items = 1 )] = Field (
89+ None ,
90+ description = ("Name when target environment is the base environment." ),
91+ )
92+ target_environment_is_not_base : Optional [conlist (str , min_items = 1 )] = Field (
93+ None ,
94+ description = ("Name when target environment is not the base environment." ),
95+ )
8196
8297class BasePlatformSpecific (BaseModel ):
8398 """
@@ -105,7 +120,7 @@ class BasePlatformSpecific(BaseModel):
105120 None ,
106121 description = ("Path to the file representing or containing the icon." ),
107122 )
108- command : Optional [conlist (str , min_items = 1 )] = Field (
123+ command : Optional [conlist (str , min_items = 1 ), TargetIsBaseConList ] = Field (
109124 None ,
110125 description = (
111126 """
@@ -119,7 +134,7 @@ class BasePlatformSpecific(BaseModel):
119134 description = (
120135 """
121136 Working directory for the running process.
122- Defaults to user directory on each platform.
137+ Defaults to user recipe/owl-mcam_viewer-menu-unix.jsondirectory on each platform.
123138 """
124139 ),
125140 )
@@ -322,7 +337,7 @@ class Linux(BasePlatformSpecific):
322337 """
323338 ),
324339 )
325- StartupWMClass : Optional [str ] = Field (
340+ StartupWMClass : Optional [str , TargetIsBaseConStr ] ] = Field (
326341 None ,
327342 description = (
328343 """
@@ -331,7 +346,7 @@ class Linux(BasePlatformSpecific):
331346 """
332347 ),
333348 )
334- TryExec : Optional [str ] = Field (
349+ TryExec : Optional [str , TargetIsBaseConStr ] = Field (
335350 None ,
336351 description = (
337352 """
@@ -350,6 +365,10 @@ class Linux(BasePlatformSpecific):
350365 """
351366 ),
352367 )
368+ run_in_bash : Optional [bool ] = Field (
369+ True ,
370+ description = ("Whether to activate the target environment before running `command`." ),
371+ )
353372
354373
355374class MacOS (BasePlatformSpecific ):
@@ -620,7 +639,7 @@ class Platforms(BaseModel):
620639class MenuItem (BaseModel ):
621640 "Instructions to create a menu item across operating systems."
622641
623- name : Union [constr (min_length = 1 ), MenuItemNameDict ] = Field (
642+ name : Union [constr (min_length = 1 ), TargetIsBaseConStr ] = Field (
624643 ...,
625644 description = (
626645 """
@@ -633,7 +652,7 @@ class MenuItem(BaseModel):
633652 ...,
634653 description = ("A longer description of the menu item. Shown on popup messages." ),
635654 )
636- command : conlist (str , min_items = 1 ) = Field (
655+ command : Union [ conlist (str , min_items = 1 ), TargetIsBaseConList ] = Field (
637656 ...,
638657 description = (
639658 """
0 commit comments