Skip to content

Commit

Permalink
add configuration options for brightness and disable for rM1
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudsftp committed Jul 30, 2023
1 parent aafdd04 commit 126e907
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@ Remember to run `toltecctl reenable` on your reMarkable tablet after each softwa
- `-l --landscape` Snapshot has now the landscape orientation.
- `-d --display` Force program to display the snapshot. (overwrites environment variable)
- `-n --no-display` Force program to not display the snapshot.
- `-c --og-color` Turn off color correction (color correction is only active for the reMarkable2)
- `-v --version` Displays version.
- `-h --help` Displays help information.

## Environment Variables

- `REMARKABLE_IP` Default IP of your reMarkable.
- `RESNAP_DISPLAY` Default behavior of reSnap. See option `-d and -n`.
- `RESNAP_DISPLAY` Default behavior of displaying the snapshot. See options `-d` and `-n`.
- `RESNAP_COLOR_CORRECTION` Default behavior of color correction on the reMarkable2. See option `-c`.

`RESNAP_DISPLAY` and `RESNAP_COLOR_CORRECTION` are boolean parameters.
Everything other than `true` is interpreted as `false`!

### Disclaimer

Expand Down
23 changes: 19 additions & 4 deletions reSnap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ip="${REMARKABLE_IP:-10.11.99.1}"
output_file="$tmp_dir/snapshot_$(date +%F_%H-%M-%S).png"
delete_output_file="true"
display_output_file="${RESNAP_DISPLAY:-true}"
filters="curves=all=0.045/0 0.06/1"
color_correction="${RESNAP_COLOR_CORRECTION:-true}"
filters="null"

# parsing arguments
while [ $# -gt 0 ]; do
Expand Down Expand Up @@ -41,6 +42,10 @@ while [ $# -gt 0 ]; do
display_output_file="false"
shift
;;
-c | --og-color)
color_correction="false"
shift
;;
-v | --version)
echo "$0 version $version"
exit 0
Expand All @@ -52,16 +57,21 @@ 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 -d # force display the file (requires feh)"
echo " $0 -n # force don't display the file"
echo " $0 -d # display the file"
echo " $0 -n # don't display the file"
echo " $0 -c # no color correction (reMarkable2)"
echo " $0 -v # displays version"
echo " $0 -h # displays help information (this)"
exit 2
;;
esac
done

if [ "$delete_output_file" = "true" ] && [ "$display_output_file" = "true" ]; then
if [ "$display_output_file" != "true" ]; then
delete_output_file="false"
fi

if [ "$delete_output_file" = "true" ]; then
# delete temporary file on exit
trap 'rm -f $output_file' EXIT
fi
Expand Down Expand Up @@ -138,6 +148,11 @@ elif [ "$rm_version" = "reMarkable 2.0" ]; then
# rotate by 90 degrees to the right
filters="$filters,transpose=2"

# color correction
if [ "$color_correction" = "true" ]; then
filters="$filters,curves=all=0.045/0 0.06/1"
fi

else

echo "$rm_version not supported"
Expand Down

0 comments on commit 126e907

Please sign in to comment.