Skip to content

Instantly share code, notes, and snippets.

@pulsar256
Last active December 2, 2025 15:58
Show Gist options
  • Select an option

  • Save pulsar256/a6a6d4d04afe4a8ef8edaada4cd76681 to your computer and use it in GitHub Desktop.

Select an option

Save pulsar256/a6a6d4d04afe4a8ef8edaada4cd76681 to your computer and use it in GitHub Desktop.
#!/bin/bash
niri msg -j event-stream | while IFS= read -r line; do
[[ -n "$line" ]] || continue
jq -e 'has("ScreenshotCaptured")' <<<"$line" >/dev/null || continue
filepath=$(echo "$line" | jq -r ".ScreenshotCaptured.path")
[[ -n "$filepath" ]] || continue
satty -f "$filepath" &
if [ $? -ne 0 ]; then
echo "ERROR: satty failed." >&2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment