reHackable / scripts

[ THIS PROJECT IS CURRENTLY ON HALT :( ] A set of bash scripts that may enhance your reMarkable experience
GNU General Public License v3.0
236 stars 30 forks source link

resnap.sh: Adds support for the remarkable 2 #33

Open emerinohdz opened 3 years ago

emerinohdz commented 3 years ago

Uses the original approach discussed in https://github.com/rien/reStream/issues/28 to dump the frame buffer on the remarkable 2. It's a bit slow though, since I couldn't get it to work reliably while dynamically calculating a better bs, count and skip values for dd.

Baccanno commented 3 years ago

In my version of RM2 (last 2.6) there is no "/dev/fb0" in the /proc/$pid/maps but there is a "/dev/shm/swtfb.01" That looks like rm2 fb shime. That might have change due to the update. I'll try with this change and report

Baccanno commented 3 years ago

I tried the following

pid=$(pidof xochitl)
offset=$(grep "/dev/shm/swtfb.01" /proc/$pid/maps | awk -F '-' '{print substr($2, 0, 8)}')
dd if=/proc/$pid/mem bs=1 count=2628288 skip=$((0x$offset + 8)) 2>/dev/null > raw
gm convert -depth 8 -size 1872x1404+0 gray:raw out.pdf

Well the output pdf is ugly and nothing close to the fb right now ...