├── images ├── a └── custom_screenshot.jpeg ├── refresh_template.sh └── README.md /images/a: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/custom_screenshot.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thamarnan/remarkable-custom-template-refresh/HEAD/images/custom_screenshot.jpeg -------------------------------------------------------------------------------- /refresh_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /usr/share/remarkable/templates/ 4 | 5 | #md5sum of templates.json version 1.4.0.7 6 | original_md5=0e7d0b7175e8d99028e0b66756f27f08 7 | original_file="templates.json.original" 8 | current_file="templates.json" 9 | 10 | if [ `md5sum templates.json | awk {'print $1'}` = $original_md5 ]; then 11 | echo "[INFO] found factory codex 1.4.0.7 templates.json" 12 | echo "[INFO] Backing up to templates.json.factory" 13 | cp templates.json templates.json.factory 14 | cp templates.json templates.json.original 15 | else 16 | 17 | 18 | cp templates.json templates.json.original 19 | fi 20 | # echo "[INFO] Modified version temlates.json.. backing with date" 21 | # you can comment this section below out if you dont need to backup everytime the script run 22 | today=`date +%Y-%m-%d-%H_%M_%S` 23 | cp templates.json templates_$today.json 24 | 25 | lastlinen=`expr $(wc -l templates.json.original | awk '{print $1}') - 2` 26 | sed -n "1,$lastlinen p" templates.json.original > templates.json 27 | 28 | for templatefile in *.png ; do 29 | # echo $templatefile 30 | name="${templatefile%.*}" 31 | ext="${templatefile##*.}" 32 | 33 | #Check if this is in factory list 34 | grep -w "$name" $original_file > /dev/null 35 | if [ $? -eq '0' ] 36 | then 37 | A="original" 38 | #echo "[INFO] $templatefile is in $original_file skipped" 39 | else 40 | echo "[INFO] $templatefile is new." 41 | # Appending custom list 42 | 43 | printf "\n\t,{">> $current_file 44 | printf "\t\t\"name\": \"%s\",\n" "$name" >> $current_file 45 | printf "\t\t\"filename\": \"%s\",\n" "$name" >> $current_file 46 | 47 | #Adding landscape = true if LS is in the name (case sensitive) 48 | if [[ $name = *"LS"* ]]; then 49 | printf "\t\t\"iconCode\": \"%s\",\n" "\\ue9fd" >> $current_file 50 | printf "\t\t\"landscape\": true,\n" >> $current_file 51 | else 52 | printf "\t\t\"iconCode\": \"%s\",\n" "\\ue9fe" >> $current_file 53 | fi 54 | 55 | #Tagging to custom cateogry 56 | printf "\t\t\"categories\": [\n" >> $current_file 57 | printf "\t\t\t\"Custom\"\n" >> $current_file 58 | printf "\t\t]\n" >> $current_file 59 | printf "\t}" >> $current_file 60 | 61 | fi 62 | done 63 | 64 | printf "\n\t]\n" >> $current_file 65 | printf "}\t\n" >> $current_file 66 | 67 | echo "Restarting application service" 68 | systemctl restart xochitl 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Refreshing Custom Template Manifest file 2 | After reMarkable tablet update to version 1.4.0.7 and above 3 | They now added another layer of templates.json 4 | to make the rendering of template faster and nicer, but result in harder with more steps required before adding the custom template file. 5 | 6 | This script will help manage the json manifest of the new file you added. 7 | 8 | This is the instruction how to add the template with the help of some script. 9 | # Usage: 10 | 11 | First copy "refresh_template.sh" from this repository to the same folder level as you have custom template 12 | (Any method from ssh, scp, or even copy and paste, but make sure all characters from the code get the unit) 13 | 14 | This is the path where the script should be: 15 | 16 | /usr/share/remarkable/templates/refresh_template.sh 17 | .. 18 | # same path along with other templates 19 | .. 20 | /usr/share/remarkable/templates/yourtemplate1.png 21 | /usr/share/remarkable/templates/yourtemplate2.png 22 | 23 | 24 | After copied script to the unit 25 | then we going to run it. 26 | To run, you can use any ssh client, For Windows checkout'putty', For Mac/Unix, just use built-in terminal 27 | 28 | username is root 29 | password is in the Settings/About/Copyright Notice/{Bottom Section of the Page} 30 | 31 | root@192.168.1.99's password: 32 | reMarkable 33 | ╺━┓┏━╸┏━┓┏━┓ ┏━╸┏━┓┏━┓╻ ╻╻╺┳╸┏━┓┏━┓ 34 | ┏━┛┣╸ ┣┳┛┃ ┃ ┃╺┓┣┳┛┣━┫┃┏┛┃ ┃ ┣━┫┗━┓ 35 | ┗━╸┗━╸╹┗╸┗━┛ ┗━┛╹┗╸╹ ╹┗┛ ╹ ╹ ╹ ╹┗━┛ 36 | remarkable: ~/ 37 | 38 | Once login, 39 | navigator the template folder: 40 | 41 | `cd /usr/share/remarkable/templates` 42 | 43 | then run 44 | 45 | `chmod u+x ./refresh_template.sh` 46 | 47 | (This chmod command - only need to run once to make file executable. 48 | Next time if you are using the same file, you dont need to run it again, but it doesn't hurt if you accidentally run more than once) 49 | 50 | And then... 51 | 52 | `./refresh_template.sh` 53 | :warning: Please save your work on your tablet by go to main screen before run this command. 54 | 55 | Once the template is finished, it will restart the application service; so no need to restart it manually 56 | 57 | You will see the result of new template added, to be something like this: 58 | 59 | remarkable: /usr/share/remarkable/templates/ ./refresh_template.sh 60 | [INFO] Custom Template.png is new. 61 | [INFO] P Black dots.png is new. 62 | [INFO] P Black grid.png is new. 63 | [INFO] P Black lines.png is new. 64 | [INFO] P Black.png is new. 65 | remarkable: /usr/share/remarkable/templates/ 66 | 67 | :white_check_mark: After restarted completed, check on the tablet itself: You'll see custom template under "Custom" Category when choosing template 68 | 69 | ![](https://github.com/thamarnan/remarkable-custom-template-refresh/blob/master/images/custom_screenshot.jpeg?raw=true) 70 | 71 | # Tips 72 | if you put the LS in front of your custom filename, 73 | The script will mark as Landscape as well. 74 | `LS_Mytodolist.png` 75 | or 76 | `My workoutsheet LS.png` 77 | both works. 78 | --------------------------------------------------------------------------------