shell: add restart command, fix call None arg, add tests
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
# import json
|
||||
# import typer
|
||||
# from zshell.assets.schemes.catppuccin import catppuccin
|
||||
#
|
||||
# app = typer.Typer()
|
||||
#
|
||||
# SCHEMES = catppuccin.variants.flavors
|
||||
#
|
||||
#
|
||||
# @app.command()
|
||||
# def set():
|
||||
|
||||
# TODO: Currently unsused
|
||||
@@ -1,16 +0,0 @@
|
||||
# import typer
|
||||
# import subprocess
|
||||
#
|
||||
# from typing import Optional
|
||||
#
|
||||
# app = typer.Typer()
|
||||
#
|
||||
# RECORDER = "gpu-screen-recorder"
|
||||
# HOME = str(os.getenv("HOME"))
|
||||
# CONFIG = Path(HOME + "/.config/zshell/config.json")
|
||||
#
|
||||
#
|
||||
# @app.command()
|
||||
# def start():
|
||||
|
||||
# TODO: Currently unused
|
||||
@@ -16,6 +16,12 @@ def start(no_daemon: bool = False):
|
||||
subprocess.run(args + ["-n"] + ([] if no_daemon else ["-d"]), check=True)
|
||||
|
||||
|
||||
@app.command()
|
||||
def restart(no_daemon: bool = False):
|
||||
subprocess.run(args + ["kill"], check=False)
|
||||
subprocess.run(args + ["-n"] + ([] if no_daemon else ["-d"]), check=True)
|
||||
|
||||
|
||||
@app.command()
|
||||
def show():
|
||||
subprocess.run(args + ["ipc"] + ["show"], check=True)
|
||||
@@ -33,4 +39,4 @@ def lock():
|
||||
|
||||
@app.command()
|
||||
def call(target: str, method: str, method_args: list[str] = typer.Argument(None)):
|
||||
subprocess.run(args + ["ipc"] + ["call"] + [target] + [method] + method_args, check=True)
|
||||
subprocess.run(args + ["ipc"] + ["call"] + [target] + [method] + (method_args or []), check=True)
|
||||
|
||||
Reference in New Issue
Block a user