Merge pull request #2310 from porschemad911/screenshot-mako

input_sense / rocknix-screenshot - handle failure exit code for mako-notify
This commit is contained in:
John Williams
2026-02-13 10:28:17 +11:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ if [ "${ROCKNIX_SCREENSHOT}" == "1" ]; then
# Disable rocknix-screenshot while retroarch is running
if pgrep -f "retroarch" > /dev/null; then
echo "RetroArch is running, skipping screenshot."
# 'failure' (screenshot not taken) exit code
exit 1
fi
@@ -37,4 +38,11 @@ if [ "${ROCKNIX_SCREENSHOT}" == "1" ]; then
# Take screenshot of the focused window
grim -g "$GEOMETRY" "$FULL_PATH"
# 'success' (screenshot taken) exit code
exit 0
else
echo "rocknix-screenshot is not enabled, skipping screenshot."
# 'failure' (screenshot not taken) exit code
exit 1
fi

View File

@@ -469,9 +469,11 @@ set +e
;;
(${FUNCTION_HOTKEY_BTN_EAST_EVENT})
if [ "${HOTKEY_A_PRESSED}" = true ]; then
${DEBUG} && log $0 "${FUNCTION_HOTKEY_BTN_EAST_EVENT}: Screenshot Taken"
${DEBUG} && log $0 "${FUNCTION_HOTKEY_BTN_EAST_EVENT}: Screenshot"
/usr/bin/rocknix-screenshot
/usr/bin/mako-notify "Screenshot Saved" -no-ra
# Display notification if 'success' exit code
SCREENSHOT_SUCCESS=$?
[ "$SCREENSHOT_SUCCESS" -eq 0 ] && /usr/bin/mako-notify "Screenshot Saved" -no-ra
fi
;;
(${FUNCTION_HOTKEY_BTN_WEST_EVENT})