Skip to content

Instantly share code, notes, and snippets.

@ryukinix
Created May 20, 2025 03:53
Show Gist options
  • Save ryukinix/4e4259028002d05fbbad0c574c86c082 to your computer and use it in GitHub Desktop.
Save ryukinix/4e4259028002d05fbbad0c574c86c082 to your computer and use it in GitHub Desktop.
#!/bin/bash
# dump screenshots to telegram and delete from filesystem
set -e
get-pictures() {
# get screenshots
find /mnt/mmc/Roms /mnt/sdcard/Roms -type f -regex ".*-[0-9]+-[0-9]+.png\$"
}
send-pic() {
# send to telegram
local fpath="$1"
local fname=`basename "$fpath"`
telegram-owl -m "$fname" -a "$fpath"
}
delete-pic() {
# delete from filesystem
local fpath="$1"
rm -rfv "$fpath"
}
main() {
get-pictures | while read pic; do
send-pic "$pic"
delete-pic "$pic"
done
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment