Fix snapshot script (#173)
This commit is contained in:
@@ -5,7 +5,7 @@ outputFile="snapshot_$(date +%Y-%m-%d_%H-%M-%S).png"
|
|||||||
outputPath="$outputDir/$outputFile"
|
outputPath="$outputDir/$outputFile"
|
||||||
mkdir -p "$outputDir"
|
mkdir -p "$outputDir"
|
||||||
|
|
||||||
mode=$1
|
mode=${1:-area}
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
active)
|
active)
|
||||||
@@ -18,13 +18,14 @@ area)
|
|||||||
command="grimblast copysave area $outputPath"
|
command="grimblast copysave area $outputPath"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
echo "Invalid option: $mode"
|
||||||
echo "Usage: $0 {active|output|area}"
|
echo "Usage: $0 {active|output|area}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if eval "$command"; then
|
if eval "$command"; then
|
||||||
recentFile=$(ls -t "$outputDir"/snapshot_*.png | head -n 1)
|
recentFile=$(find "$outputDir" -name 'snapshot_*.png' -printf '%T+ %p\n' | sort -r | head -n 1 | cut -d' ' -f2-)
|
||||||
notify-send "Grimblast" "Your snapshot has been saved." \
|
notify-send "Grimblast" "Your snapshot has been saved." \
|
||||||
-i video-x-generic \
|
-i video-x-generic \
|
||||||
-a "Grimblast" \
|
-a "Grimblast" \
|
||||||
|
|||||||
Reference in New Issue
Block a user