From f547fcc354671c672fffb20092e72d231e6ed1e4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 2 Aug 2026 01:36:33 +0200 Subject: Add gsr-cli program that sends ipc commands to gpu-screen-recorder gsr-cli sends a command to the ipc socket of a running GPU Screen Recorder and exits with 0 when it replied with ok, printing the reason to stderr when it didn't, which means the commands don't have to be sent blindly like signals are. The status command checks if GPU Screen Recorder is running by connecting to the socket without sending a command, so it's also correct when a killed instance left the socket behind. The json helpers moved into src/json.c to be shared between the two programs. --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index bddfc02..7b0c14e 100644 --- a/meson.build +++ b/meson.build @@ -31,6 +31,7 @@ src = [ 'src/replay_buffer/replay_buffer_ram.c', 'src/replay_buffer/replay_buffer_disk.c', 'src/log.c', + 'src/json.c', 'src/ffmpeg_utils.c', 'src/recorder/audio_codec.c', 'src/recorder/video_codec.c', @@ -131,10 +132,11 @@ endif add_project_arguments('-DGSR_VERSION="' + meson.project_version() + '"', language: 'c') executable('gsr-kms-server', 'kms/server/kms_server.c', dependencies : dependency('libdrm'), c_args : '-fstack-protector-all', install : true) +executable('gsr-cli', ['src/gsr_cli/main.c', 'src/json.c', 'src/log.c'], install : true) executable('gpu-screen-recorder', src, dependencies : dep, install : true) install_headers('plugin/plugin.h', install_dir : 'include/gsr') -install_man('gpu-screen-recorder.1', 'gsr-kms-server.1') +install_man('gpu-screen-recorder.1', 'gsr-cli.1', 'gsr-kms-server.1') install_subdir('scripts', install_dir: 'share/gpu-screen-recorder') if get_option('systemd') == true -- cgit v1.2.3