summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-15 23:18:08 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-15 23:18:08 +1000
commitad6df1c9d28a7b1c60f41fc3faf5bb1e34b275f4 (patch)
tree3d98c9d2dae2495d1ca9d65795f95fbfafffc8ee
parent[CI] chore: update flake (diff)
downloadcaelestia-cli-ad6df1c9d28a7b1c60f41fc3faf5bb1e34b275f4.tar.gz
caelestia-cli-ad6df1c9d28a7b1c60f41fc3faf5bb1e34b275f4.tar.bz2
caelestia-cli-ad6df1c9d28a7b1c60f41fc3faf5bb1e34b275f4.zip
record: add extraArgs config
Diffstat (limited to '')
-rw-r--r--README.md3
-rw-r--r--src/caelestia/subcommands/record.py11
2 files changed, 13 insertions, 1 deletions
diff --git a/README.md b/README.md
index fdffbc2..f4006a3 100644
--- a/README.md
+++ b/README.md
@@ -130,6 +130,9 @@ All configuration options are in `~/.config/caelestia/cli.json`.
```json
{
+ "record": {
+ "extraArgs": []
+ },
"theme": {
"enableTerm": true,
"enableHypr": true,
diff --git a/src/caelestia/subcommands/record.py b/src/caelestia/subcommands/record.py
index 2b946c6..867eb1b 100644
--- a/src/caelestia/subcommands/record.py
+++ b/src/caelestia/subcommands/record.py
@@ -7,7 +7,7 @@ from argparse import Namespace
from datetime import datetime
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"
@@ -63,6 +63,15 @@ class Command:
if self.args.sound:
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)
proc = subprocess.Popen([RECORDER, *args, "-o", str(recording_path)], start_new_session=True)