Created
March 8, 2025 23:53
-
-
Save FOLLGAD/435ed12244ecdf7262c5bacdbb0a2bbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Save screenshot with timestamp to Desktop | |
| filename="$HOME/Pictures/Screens/Screenshot_$(date +%Y-%m-%d_%H.%M.%S).png" | |
| screencapture -i "$filename" | |
| # Copy the new file to clipboard if it exists (only if you didn't cancel the screenshot) | |
| if [ -f "$filename" ]; then | |
| osascript -e 'set the clipboard to (read (POSIX file "'"$filename"'") as TIFF picture)' | |
| fi | |
| context="{\"notifyOptions\":{\"title\":\"Screenshot taken\",\"subtitle\":\"Saved as $filename\",\"open\":\"file://$filename\",\"sound\":true}}" | |
| deeplink="raycast://extensions/maxnyby/raycast-notification/index?launchType=background&context=$(jq -rR @uri <<< $context)" | |
| open $deeplink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment