mirror of
https://github.com/pr0fsmith/rMscreens.git
synced 2025-12-08 14:13:24 +00:00
Add files via upload
This commit is contained in:
42
changescrn
Normal file
42
changescrn
Normal file
@@ -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
|
||||
|
||||
82
rMscreen
Normal file
82
rMscreen
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user