mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +01:00
Merge branch 'develop' of https://github.com/FunKey-Project/FunKey-OS into develop
This commit is contained in:
commit
4243dd85b6
@ -20,12 +20,8 @@ touch "${LOCK_FILE}"
|
|||||||
# Increment name and save snapshot
|
# Increment name and save snapshot
|
||||||
SNAPSHOT_DIR=/mnt/funkey/snapshots
|
SNAPSHOT_DIR=/mnt/funkey/snapshots
|
||||||
mkdir -p "${SNAPSHOT_DIR}"
|
mkdir -p "${SNAPSHOT_DIR}"
|
||||||
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_\([0-9]\+\)\.PNG$/\1/')
|
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.PNG$/\1/')
|
||||||
if [ "x${last}" = "x" ]; then
|
let last=${last}+1
|
||||||
last=1
|
|
||||||
else
|
|
||||||
last=$(expr $last + 1)
|
|
||||||
fi
|
|
||||||
snapshot_file=$(printf "IMG_%04d.PNG" $last)
|
snapshot_file=$(printf "IMG_%04d.PNG" $last)
|
||||||
notif_set 2 " NEW SCREEENSHOT ${snapshot_file}"
|
notif_set 2 " NEW SCREEENSHOT ${snapshot_file}"
|
||||||
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" &
|
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" &
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
SNAPSHOT_DIR=/mnt/funkey/snapshots
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
# Check args
|
# Check args
|
||||||
if [ ${#} -ne 0 ]; then
|
if [ ${#} -ne 0 ]; then
|
||||||
@ -8,14 +9,24 @@ if [ ${#} -ne 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${SNAPSHOT_DIR}"
|
# Lock file (necessary since fbgrab must run in bg not to block the buttons while gaming)
|
||||||
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_\([0-9]\+\)\.PNG$/\1/')
|
LOCK_FILE="/var/lock/snap.lock"
|
||||||
if [ "x${last}" = "x" ]; then
|
if [ -f "${LOCK_FILE}" ]; then
|
||||||
last=1
|
#echo "${LOCK_FILE} already exists"
|
||||||
else
|
exit 1
|
||||||
let last++
|
|
||||||
fi
|
fi
|
||||||
|
touch "${LOCK_FILE}"
|
||||||
|
|
||||||
|
# Increment name and save snapshot
|
||||||
|
SNAPSHOT_DIR=/mnt/funkey/snapshots
|
||||||
|
mkdir -p "${SNAPSHOT_DIR}"
|
||||||
|
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.PNG 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.PNG$/\1/')
|
||||||
|
let last=${last}+1
|
||||||
snapshot_file=$(printf "IMG_%04d.PNG" $last)
|
snapshot_file=$(printf "IMG_%04d.PNG" $last)
|
||||||
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}"
|
notif_set 2 " NEW SCREEENSHOT ${snapshot_file}"
|
||||||
notif_disp 1 " CAPTURE TO ${snapshot_file}"
|
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" &
|
||||||
|
|
||||||
|
# Remove lock file
|
||||||
|
rm -f "${LOCK_FILE}"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user