feat: adds an option to run a script after a screenshot

This commit is contained in:
Giovane Perlin
2025-11-30 22:04:30 -04:00
committed by dec05eba
parent d7be9b38b1
commit 11aa237821
5 changed files with 44 additions and 7 deletions

View File

@@ -2176,6 +2176,11 @@ namespace gsr {
if(led_indicator && config.screenshot_config.use_led_indicator)
led_indicator->blink();
if(!strip(config.screenshot_config.custom_script).empty()) {
const char *args[] = { config.screenshot_config.custom_script.c_str(), screenshot_filepath.c_str(), nullptr };
exec_program_on_host_daemonized(args);
}
} else {
fprintf(stderr, "Warning: gpu-screen-recorder (%d) exited with exit status %d\n", (int)gpu_screen_recorder_screenshot_process, exit_code);
show_notification("Failed to take a screenshot. Verify if settings are correct", notification_timeout_seconds, mgl::Color(255, 0, 0), mgl::Color(255, 0, 0), NotificationType::SCREENSHOT, nullptr, NotificationLevel::ERROR);