mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2026-05-08 13:53:28 +02:00
add screen snapshot
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/snap
Executable file
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/snap
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
SNAPSHOT_DIR=/mnt/funkey/snapshots
|
||||
# Check args
|
||||
if [ ${#} -ne 0 ]; then
|
||||
echo "Usage: $(basename ${0})"
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "${SNAPSHOT_DIR}"
|
||||
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_\([0-9]\+\)\.PNG$/\1/')
|
||||
if [ "x${last}" = "x" ]; then
|
||||
last=1
|
||||
else
|
||||
let last++
|
||||
fi
|
||||
snapshot_file=$(printf "IMG_%04d.PNG" $last)
|
||||
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}"
|
||||
notif_disp 1 " CAPTURE TO ${snapshot_file}"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user