mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 14:59:29 -05:00
record: add extraArgs config
This commit is contained in:
@@ -130,6 +130,9 @@ All configuration options are in `~/.config/caelestia/cli.json`.
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"record": {
|
||||||
|
"extraArgs": []
|
||||||
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"enableTerm": true,
|
"enableTerm": true,
|
||||||
"enableHypr": true,
|
"enableHypr": true,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from argparse import Namespace
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from caelestia.utils.notify import close_notification, notify
|
from caelestia.utils.notify import close_notification, notify
|
||||||
from caelestia.utils.paths import recording_notif_path, recording_path, recordings_dir
|
from caelestia.utils.paths import recording_notif_path, recording_path, recordings_dir, user_config_path
|
||||||
|
|
||||||
RECORDER = "gpu-screen-recorder"
|
RECORDER = "gpu-screen-recorder"
|
||||||
|
|
||||||
@@ -63,6 +63,15 @@ class Command:
|
|||||||
if self.args.sound:
|
if self.args.sound:
|
||||||
args += ["-a", "default_output"]
|
args += ["-a", "default_output"]
|
||||||
|
|
||||||
|
try:
|
||||||
|
config = json.loads(user_config_path.read_text())
|
||||||
|
if "record" in config and "extraArgs" in config["record"]:
|
||||||
|
args += config["record"]["extraArgs"]
|
||||||
|
except (json.JSONDecodeError, FileNotFoundError):
|
||||||
|
pass
|
||||||
|
except TypeError as e:
|
||||||
|
raise ValueError(f"Config option 'record.extraArgs' should be an array: {e}")
|
||||||
|
|
||||||
recording_path.parent.mkdir(parents=True, exist_ok=True)
|
recording_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
proc = subprocess.Popen([RECORDER, *args, "-o", str(recording_path)], start_new_session=True)
|
proc = subprocess.Popen([RECORDER, *args, "-o", str(recording_path)], start_new_session=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user