diff --git a/linux-install.sh b/linux-install.sh new file mode 100644 index 0000000..a14ea1e --- /dev/null +++ b/linux-install.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Author: sickcodes +# Repo: https://github.com/konrad91/OneDarkArduino +# Contact: https://twitter.com/sickcodes +# Copyright: sickcodes (C) 2021 +# License: GPLv3+ + +set -e + +IDE_PATH=/usr/share/arduino/lib + +if [ "$(pgrep arduino)" ]; then + echo "Please close Arduino IDE first." + exit 1 +fi + +if ! [ "$(stat ./theme)" ]; then + echo "No theme folder found in your current directory." + echo "Download again from Github, and run this from inside that directory." + exit 1 +fi + +echo "Moving OLD theme folder to ${IDE_PATH}/theme.bak" +mv "${IDE_PATH}/theme" "${IDE_PATH}/theme.bak" + +echo "Moving NEW theme folder to ${IDE_PATH}/theme" +cp -r ./theme "${IDE_PATH}/theme" + +exit 0 \ No newline at end of file diff --git a/linux-uninstall.sh b/linux-uninstall.sh new file mode 100644 index 0000000..8f14d7a --- /dev/null +++ b/linux-uninstall.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Author: sickcodes +# Repo: https://github.com/konrad91/OneDarkArduino +# Contact: https://twitter.com/sickcodes +# Copyright: sickcodes (C) 2021 +# License: GPLv3+ + +set -e + +IDE_PATH=/usr/share/arduino/lib + +if [ "$(pgrep arduino)" ]; then + echo "Please close Arduino IDE first." + exit 1 +fi + +if ! [ "$(stat ${IDE_PATH}/theme.bak)" ]; then + echo "No old theme folder found in your Arduino libraries." + echo "Simply reinstalling Arduino (overwrite) will fix this." + exit 1 +fi + +echo "Removing the installed theme folder..." +rm -rf "${IDE_PATH}/theme" + +echo "Moving OLD theme folder back ${IDE_PATH}/theme" +mv "${IDE_PATH}/theme.bak" "${IDE_PATH}/theme" + +exit 0 \ No newline at end of file