From ad7399943328f0159ce3b5aaf39df6a464519695 Mon Sep 17 00:00:00 2001 From: pr0fsmith <54153368+pr0fsmith@users.noreply.github.com> Date: Thu, 10 Mar 2022 23:30:54 -0500 Subject: [PATCH] Add files via upload --- changescrn | 42 ++++++++++++++++++++++++++++ rMscreen | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 changescrn create mode 100644 rMscreen diff --git a/changescrn b/changescrn new file mode 100644 index 0000000..97f0f87 --- /dev/null +++ b/changescrn @@ -0,0 +1,42 @@ +#! /bin/bash + +#Arguments +OLDPNG=$1 #name of screen you'd like to change. Screen names are default names without the .png +NEWPNG=$2 #path/to new .png file + +#Replace the old screen with the new png you specify. Each option is the name of the default png file. + + case $OLDPNG in + batteryempty) + cp $NEWPNG /usr/share/remarkable/batteryempty.png + ;; + lowbattery) + cp $NEWPNG /usr/share/remarkable/lowbattery.png + ;; + overheating) + cp $NEWPNG /usr/share/remarkable/overheating.png + ;; + poweroff) + cp $NEWPNG /usr/share/remarkable/poweroff.png + ;; + rebooting) + cp $NEWPNG /usr/share/remarkable/rebooting.png + ;; + recovery) + cp $NEWPNG /usr/share/remarkable/recovery.png + ;; + splash) + cp $NEWPNG /usr/share/remarkable/splash.png + ;; + starting) + cp $NEWPNG /usr/share/remarkable/starting.png + ;; + suspended) + cp $NEWPNG /usr/share/remarkable/suspended.png + ;; + *) + echo "Usage: changescrn [Screen Options] [New .png location]" + echo "Screen Options: mv batteryempty lowbattery overheating poweroff rebooting recovery splash starting suspended" + ;; + esac + diff --git a/rMscreen b/rMscreen new file mode 100644 index 0000000..eb97800 --- /dev/null +++ b/rMscreen @@ -0,0 +1,82 @@ +#! /bin/bash + +MY_DIR=$(dirname $0) #Used so that script will work no matter where the script folder is put. + +#Changes selected screen screen by replacing .png in /usr/share/remarkable/ +function replacepng(){ + echo "choose a file you would like to replace $OLDPNG with:" + cd ~/Pictures/rMscreens + select NEWPNG in $(ls *.png) + do + case $NEWPNG in + *) break + ;; + esac + done + echo "You selected $NEWPNG" + echo "" + echo "Are you sure you want to change $OLDPNG ?" + select CHOICE in yes no + do + case $CHOICE in + yes) + scp $NEWPNG root@10.11.99.1:/tmp + ssh root@10.11.99.1 /opt/bin/changescrn $OLDPNG /tmp/$NEWPNG #Calls 'changscrn' to replace the old screen with the new one + echo "All done!" + echo "" + ssh root@10.11.99.1 rm /tmp/$NEWPNG #removes orginal .png file from device to save space. + mainmenu + ;; + no) + mainmenu + ;; + *) + echo "Please choose 1 for yes or 2 for no" + ;; + esac + done +} + +#Restore default screens +function restoredefaults(){ + echo "Select a screen you'd like to restore to its default" + select OLDPNG in batteryempty lowbattery overheating poweroff rebooting recovery splash starting suspended + do + scp ~/Pictures/rMscreens/$OLDPNG.png root@10.11.99.1:/tmp + echo "Copied file to rM" + ssh root@10.11.99.1 /opt/bin/changescrn $OLDPNG /tmp/$OLDPNG.png + echo "restored $OLDPNG screen to default" + echo "" + mainmenu + done + +} + +#Main menu +function mainmenu(){ +echo "Choose the screen you would like to replace or quit:" +select OLDPNG in batteryempty lowbattery overheating poweroff rebooting recovery splash starting suspended Restore_Defaults Quit +do + case $OLDPNG in + Restore_Defaults) + restoredefaults + ;; + Quit) + exit + ;; + batteryempty | lowbattery | overheating | poweroff | rebooting | recovery | splash | starting | suspended) + echo "You chose $OLDPNG" + echo "" + replacepng + ;; + *) + echo "Please choose from available options" + mainmenu + ;; + esac +done +} + + +#MAIN SCRIPT STARTS HERE +mainmenu