Skip to content

Commit

Permalink
add option for autogenerated file name
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudsftp committed Aug 16, 2024
1 parent e154fc8 commit 14a5b74
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions reSnap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi

# default values
ip="${REMARKABLE_IP:-10.11.99.1}"
output_file="$tmp_dir/snapshot_$(date +%F_%H-%M-%S).png"
output_file="$tmp_dir/reSnap_$(date +%F_%H-%M-%S).png"
delete_output_file="true"
display_output_file="${RESNAP_DISPLAY:-true}"
color_correction="${RESNAP_COLOR_CORRECTION:-true}"
Expand All @@ -33,9 +33,14 @@ while [ $# -gt 0 ]; do
shift
;;
-o | --output)
output_file="$2"
delete_output_file="false"
shift
if [ $# -gt 1 ] && ! [[ "$2" =~ "-" ]]; then
echo here
output_file="$2"
shift
else
output_file="" # empty means compute from notebook name
fi
shift
;;
-d | --display)
Expand Down Expand Up @@ -76,6 +81,7 @@ while [ $# -gt 0 ]; do
echo " $0 -l # snapshot in landscape"
echo " $0 -s 192.168.2.104 # snapshot over wifi"
echo " $0 -o snapshot.png # saves the snapshot in the current directory"
echo " $0 -o # same as above, but named after the notebook"
echo " $0 -d # display the file"
echo " $0 -n # don't display the file"
echo " $0 -c # no color correction (reMarkable2)"
Expand Down

0 comments on commit 14a5b74

Please sign in to comment.