Skip to content

Commit

Permalink
Merge branch 'release/2.5.1' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudsftp committed Sep 21, 2023
2 parents 7412331 + 686610a commit 8e16490
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
name: Check

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
- push
- pull_request

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
shellchecker:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Shell Formatter
uses: luizm/[email protected]
env:
SHFMT_OPTS: -i 2
- name: Shell Formatter
uses: luizm/[email protected]
env:
SHFMT_OPTS: -i 2
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# reSnap ![version](https://img.shields.io/badge/RS-2.5-blue)
# reSnap ![version](https://img.shields.io/badge/version-2.5.1-blue)

reMarkable screenshots over ssh.

Expand Down Expand Up @@ -35,6 +35,7 @@ reMarkable screenshots over ssh.
- `-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)
- `-p --og-pixel-format` Turns off the byte correction (use this if your reMarkable is on version < 3.6)
- `-v --version` Displays version.
- `-h --help` Displays help information.

Expand All @@ -43,8 +44,9 @@ reMarkable screenshots over ssh.
- `REMARKABLE_IP` Default IP of your reMarkable.
- `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_BYTE_CORRECTION` Default behavior of color correction on the reMarkable2 version >= 3.6. See option `-b`.

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

## Recommended for better performance
Expand Down
25 changes: 17 additions & 8 deletions reSnap.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

version="2.5"
version="v2.5.1"

# create temporary directory
tmp_dir="/tmp/reSnap"
Expand All @@ -14,6 +14,7 @@ output_file="$tmp_dir/snapshot_$(date +%F_%H-%M-%S).png"
delete_output_file="true"
display_output_file="${RESNAP_DISPLAY:-true}"
color_correction="${RESNAP_COLOR_CORRECTION:-true}"
byte_correction="${RESNAP_BYTE_CORRECTION:-true}"
filters="null"

# parsing arguments
Expand Down Expand Up @@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do
color_correction="false"
shift
;;
-p | --og-pixel-format)
byte_correction="false"
shift
;;
-v | --version)
echo "$0 version $version"
exit 0
Expand All @@ -60,6 +65,7 @@ while [ $# -gt 0 ]; do
echo " $0 -d # display the file"
echo " $0 -n # don't display the file"
echo " $0 -c # no color correction (reMarkable2)"
echo " $0 -p # no pixel format correction (reMarkable2 version < 3.6)"
echo " $0 -v # displays version"
echo " $0 -h # displays help information (this)"
exit 2
Expand Down Expand Up @@ -111,7 +117,16 @@ elif [ "$rm_version" = "reMarkable 2.0" ]; then
# calculate how much bytes the window is
width=1872
height=1404
bytes_per_pixel=1
# pixel format
if [ "$byte_correction" = "true" ]; then
bytes_per_pixel=2
pixel_format="gray16"
filters="$filters,transpose=3" # 90° clockwise and vertical flip
else
bytes_per_pixel=1
pixel_format="gray8"
filters="$filters,transpose=2" # 90° counter-clockwise
fi

window_bytes="$((width * height * bytes_per_pixel))"

Expand Down Expand Up @@ -142,12 +157,6 @@ elif [ "$rm_version" = "reMarkable 2.0" ]; then
tail -c+$window_offset |
cut -b -$window_bytes"

# pixel format
pixel_format="gray8"

# 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"
Expand Down

0 comments on commit 8e16490

Please sign in to comment.