Add parameters to README, ssh timeout to 1s
Changed the README to reflect the command line options added with bcf62e3. Also incorporates the SSH timeout of 1 second added by the initial PR (#10). Co-authored-by: Aaron David Schneider <aaron.david.schneider@gmail.com>
This commit is contained in:
parent
bcf62e3ae7
commit
382944058e
@ -14,9 +14,14 @@ reMarkable screen sharing over SSH.
|
|||||||
|
|
||||||
1. Connect your reMarkable with the USB cable.
|
1. Connect your reMarkable with the USB cable.
|
||||||
2. Make sure you can [open an SSH connection](https://remarkablewiki.com/tech/ssh).
|
2. Make sure you can [open an SSH connection](https://remarkablewiki.com/tech/ssh).
|
||||||
3. Run `./reStream.sh` for landscape mode, or `./reStram.sh -p` for portrait mode.
|
3. Run `./reStream.sh`
|
||||||
4. A screen will pop-up on your local machine, with a live view of your reMarkable!
|
4. A screen will pop-up on your local machine, with a live view of your reMarkable!
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
- `-p --portrait`: shows the reMarkable screen in portrait mode (the default is landscape mode, 90 degrees rotated tot the right)
|
||||||
|
- `-d --destination`: the ssh destination of the reMarkable (default: `root@10.11.99.1`)
|
||||||
|
|
||||||
If you have problems, don't hesitate to [open an issue](https://github.com/rien/reStream/issues/new) or [send me an email](mailto:rien.maertens@posteo.be).
|
If you have problems, don't hesitate to [open an issue](https://github.com/rien/reStream/issues/new) or [send me an email](mailto:rien.maertens@posteo.be).
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
33
reStream.sh
33
reStream.sh
@ -1,23 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# these are probably the only two parameters you need to change
|
# default values for arguments
|
||||||
ssh_host="root@10.11.99.1" # location of the remarkable
|
ssh_host="root@10.11.99.1" # remarkable connected trough USB
|
||||||
landscape=true # default vertical
|
landscape=true # rotate 90 degrees to the right
|
||||||
|
|
||||||
# Loop through arguments and process them
|
# loop through arguments and process them
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
-p|--portrait)
|
-p|--portrait)
|
||||||
landscape=false
|
landscape=false
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-d|--destination)
|
-d|--destination)
|
||||||
ssh_host="$2"
|
ssh_host="$2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
echo "Usage: $0 [-p] [-d <destination>]"
|
||||||
|
exit 1
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -27,9 +29,10 @@ height=1872
|
|||||||
bytes_per_pixel=2
|
bytes_per_pixel=2
|
||||||
loop_wait="true"
|
loop_wait="true"
|
||||||
loglevel="info"
|
loglevel="info"
|
||||||
|
ssh_cmd="ssh -o ConnectTimeout=1 "$ssh_host""
|
||||||
|
|
||||||
# check if we are able to reach the remarkable
|
# check if we are able to reach the remarkable
|
||||||
if ! ssh "$ssh_host" true; then
|
if ! $ssh_cmd true; then
|
||||||
echo "$ssh_host unreachable"
|
echo "$ssh_host unreachable"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -44,9 +47,9 @@ fallback_to_gzip() {
|
|||||||
|
|
||||||
|
|
||||||
# check if lz4 is present on remarkable
|
# check if lz4 is present on remarkable
|
||||||
if ssh "$ssh_host" "[ -f /opt/bin/lz4 ]"; then
|
if $ssh_cmd "[ -f /opt/bin/lz4 ]"; then
|
||||||
compress="/opt/bin/lz4"
|
compress="/opt/bin/lz4"
|
||||||
elif ssh "$ssh_host" "[ -f ~/lz4 ]"; then
|
elif $ssh_cmd "[ -f ~/lz4 ]"; then
|
||||||
compress="~/lz4"
|
compress="~/lz4"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -78,7 +81,7 @@ read_loop="while $head_fb0; do $loop_wait; done | $compress"
|
|||||||
|
|
||||||
set -e # stop if an error occurs
|
set -e # stop if an error occurs
|
||||||
|
|
||||||
ssh "$ssh_host" "$read_loop" \
|
$ssh_cmd "$read_loop" \
|
||||||
| $decompress \
|
| $decompress \
|
||||||
| ffplay -vcodec rawvideo \
|
| ffplay -vcodec rawvideo \
|
||||||
-loglevel "$loglevel" \
|
-loglevel "$loglevel" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user