Skip to content

Commit 799ba8d

Browse files
committed
Cleanup previous PR
1 parent f3bc876 commit 799ba8d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

kitty/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,10 @@ def list_monitors(json_output: bool = False) -> None:
233233

234234
if json_output:
235235
if has_descriptions:
236-
monitors_list_of_dict = [{'name': name, 'desc': desc} for name, desc in monitor_names]
236+
monitors_list_of_dict = [{'name': name, 'description': desc} for name, desc in monitor_names]
237237
else:
238238
monitors_list_of_dict = [{'name': name} for name, _ in monitor_names]
239-
240-
json.dump(monitors_list_of_dict, sys.stdout)
239+
json.dump(monitors_list_of_dict, sys.stdout, indent=2, sort_keys=True)
241240
print()
242241
return
243242

@@ -255,9 +254,8 @@ def list_monitors(json_output: bool = False) -> None:
255254
def _run_app(opts: Options, args: CLIOptions, bad_lines: Sequence[BadLine] = (), talk_fd: int = -1) -> None:
256255
global _is_panel_kitten
257256
_is_panel_kitten = run_app.cached_values_name == 'panel'
258-
if _is_panel_kitten and run_app.layer_shell_config and run_app.layer_shell_config.output_name in ['list', 'listjson']:
259-
is_json_output = run_app.layer_shell_config.output_name == 'listjson'
260-
list_monitors(is_json_output)
257+
if _is_panel_kitten and run_app.layer_shell_config and run_app.layer_shell_config.output_name in ('list', 'listjson'):
258+
list_monitors(run_app.layer_shell_config.output_name == 'listjson')
261259
return
262260
if is_macos:
263261
global_shortcuts = set_cocoa_global_shortcuts(opts)

0 commit comments

Comments
 (0)