From 4b221e2fd5b7faf4747cff6c590b6ddc38870901 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 14 Sep 2025 16:59:19 +1000 Subject: utilities: add recording control --- services/Recorder.qml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 services/Recorder.qml (limited to 'services') diff --git a/services/Recorder.qml b/services/Recorder.qml new file mode 100644 index 0000000..370bfd8 --- /dev/null +++ b/services/Recorder.qml @@ -0,0 +1,38 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io + +Singleton { + id: root + + readonly property alias running: props.running + readonly property alias paused: props.paused + + function toggle(): void { + Quickshell.execDetached(["caelestia", "record"]); + props.running = !props.running; + if (!props.running) + props.paused = false; + } + + function togglePause(): void { + Quickshell.execDetached(["caelestia", "record", "-p"]); + props.paused = !props.paused; + } + + PersistentProperties { + id: props + + property bool running: false + property bool paused: false + + reloadableId: "recorder" + } + + Process { + running: true + command: ["pidof", "gpu-screen-recorder"] + onExited: code => props.running = code === 0 + } +} -- cgit v1.2.3-freya