From 166bf80ff57acda6a4fdf916838fca77db4d7f07 Mon Sep 17 00:00:00 2001 From: Isaac Wisdom <66286016+isaacwisdom@users.noreply.github.com> Date: Mon, 8 Aug 2022 23:31:00 +0200 Subject: [PATCH 1/3] Add sh scripts for 1 liner installs --- install.sh | 40 ++++++++++++++++++++++++++++++++++++++++ uninstall.sh | 9 +++++++++ 2 files changed, 49 insertions(+) create mode 100644 install.sh create mode 100644 uninstall.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..8f99ea3 --- /dev/null +++ b/install.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +clear +cd ~ + +systemctl stop LamyEraser.service 2&> /dev/null +systemctl disable LamyEraser.service 2&> /dev/null + +echo "Downloading RemarkableLamyEraser Executable to /usr/sbin..." +cd /usr/sbin +rm -f RemarkableLamyEraser +wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/RemarkableLamyEraser/RemarkableLamyEraser +echo "Adding execute privleges..." +chmod +x RemarkableLamyEraser +cd ~ + + +read -p "Would you like RemarkableLamyEraser to start automatically on boot? [y/n]" -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] + then + echo "Downloading service file to /lib/systemd/system..." + cd /lib/systemd/system/ + rm -f LamyEraser.service + wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/RemarkableLamyEraser/LamyEraser.service + read -p "Would you like to edit your configuration now? [y/n]" -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]] + then + nano LamyEraser.service + fi + echo "Setting up RemarkableLamyEraser to start on boot..." + systemctl daemon-reload + systemctl enable LamyEraser.service + echo "Starting RemarkableLamyEraser. Enjoy!" + systemctl start LamyEraser.service +else + echo "You can start RemarkableLamyEraser at any time by running RemarkableLamyEraser" + echo "Enjoy!" +fi diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..6847e74 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,9 @@ +systemctl stop LamyEraser.service +systemctl disable LamyEraser.service +echo "Deleting RemarkableLamyEraser executable" +rm -f /usr/sbin/RemarkableLamyEraser +echo "Deleting service file..." +rm -f /lib/systemd/system/LamyEraser.service +systemctl daemon-reload +systemctl reset-failed +echo "RemarkableLamyEraser uninstalled." \ No newline at end of file From 5345c226cbf7a1b8a7d08e1c40766c73597ef562 Mon Sep 17 00:00:00 2001 From: Isaac Wisdom <66286016+isaacwisdom@users.noreply.github.com> Date: Mon, 8 Aug 2022 23:32:28 +0200 Subject: [PATCH 2/3] add one liner install and uninstall to readme --- README.md | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index aa9b4c2..77c9cb3 100644 --- a/README.md +++ b/README.md @@ -7,34 +7,12 @@ Also confirmed to work with these other styli: The tool will definitely break when the reMarkable updates. When that happens, just reinstall! # Install Instructions -SSH into your reMarkable and make a directory to store our files: -```Shell -cd -mkdir RemarkableLamyEraser +```shell +cd; wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/install.sh; chmod +x install.sh; ./install.sh ``` -Download the binary from the release page, and the .service file from the project page: -```Shell -cd ~/RemarkableLamyEraser -wget https://github.com/isaacwisdom/RemarkableLamyEraser/releases/latest/download/RemarkableLamyEraser -wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/RemarkableLamyEraser/LamyEraser.service -``` -Make the binary exectuable, copy the .service file to systemd file, enable, and start it. This means the tool will automatically start on boot: -```Shell -chmod +x RemarkableLamyEraser -cp LamyEraser.service /lib/systemd/system/ -systemctl daemon-reload -systemctl enable LamyEraser.service -systemctl start LamyEraser.service -``` - # Uninstall Instrucions -```Shell -systemctl stop LamyEraser.service -systemctl disable LamyEraser.service -rm -rf ~/RemarkableLamyEraser -rm /lib/systemd/system/LamyEraser.service -systemctl daemon-reload -systemctl reset-failed +```shell +cd; wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/uninstall.sh; chmod +x uninstall.sh; ./uninstall.sh ``` From c220c822e4c299eb63e8c9f026ec817d204eafdf Mon Sep 17 00:00:00 2001 From: Isaac Wisdom <66286016+isaacwisdom@users.noreply.github.com> Date: Mon, 8 Aug 2022 23:33:23 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77c9cb3..a480e69 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ cd; wget https://github.com/isaacwisdom/RemarkableLamyEraser/raw/v1/uninstall.sh # Usage Press and hold to erase, release to use as a normal pen. Double click the button to undo. Note that at the moment, double pressing to undo only works for portrait orientation documents. -Further customization can be done by adding arguments to ExecStart line of the LamyEraser.service file. This can be opened with `nano ~/RemarkableLamyEraser/LamyEraser.service`. +Further customization can be done by adding arguments to ExecStart line of the LamyEraser.service file. This can be opened with `nano /lib/systemd/system/LamyEraser.service`. The supported arguments are: `--press` Press and hold to erase, release to use as a normal pen. *This is the default behavior.* `--toggle` Press the button to erase, press the button again to swtich back to a normal pen.