diff --git a/Software/dashboard/Makefile b/Software/dashboard/Makefile index a54f669..43b6558 100644 --- a/Software/dashboard/Makefile +++ b/Software/dashboard/Makefile @@ -1,6 +1,7 @@ TARGET_USER := a2nr TARGET_HOST := tritium-h5 -TARGET_PATH := /home/$(TARGET_USER)/Documents/dashboard +TARGET_PATH := /home/$(TARGET_USER)/heartbeatmice/dashboard +TARGET_PATH_STR := \/home\/$(TARGET_USER)\/heartbeatmice\/dashboard TARGET_PASS := 'a2nr' PROBE_USER := a2nr PROBE_HOST := mekatronika @@ -10,7 +11,9 @@ PROBE_PASS := 'Bismillah...' all: comp up run debug: comp_debug up run_debug init: install_dep install_flutter_pi -up: comp copy_target +up: copy_target +install: comp up install_app +uninstall: uninstall_app clean: rm -rf ./build/* && sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'echo $(TARGET_PASS) | sudo -S rm -rf $(TARGET_PATH)/*' @@ -19,11 +22,17 @@ comp_debug: comp: flutterpi_tool build --arch=arm64 --release copy_target: - sshpass -p $(TARGET_PASS) rsync -a --info=progress2 ./build/flutter_assets $(TARGET_USER)@$(TARGET_HOST):$(TARGET_PATH) + sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'mkdir -p $(TARGET_PATH)' \ + && sshpass -p $(TARGET_PASS) rsync -a --info=progress2 ./build/flutter_assets $(TARGET_USER)@$(TARGET_HOST):$(TARGET_PATH) run: sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'echo $(TARGET_PASS) | sudo -S flutter-pi -r 270 --release $(TARGET_PATH)/flutter_assets' run_debug: sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'echo $(TARGET_PASS) | sudo -S flutter-pi -o landscape_left $(TARGET_PATH)/flutter_assets' +install_app: + sshpass -p $(TARGET_PASS) rsync -a --info=progress2 ./heartbeatmice.service $(TARGET_USER)@$(TARGET_HOST):$(TARGET_PATH) \ + && sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'sed -i -e "s/@thepath/$(TARGET_PATH_STR)/g" $(TARGET_PATH)/heartbeatmice.service && echo $(TARGET_PASS) | sudo -S cp $(TARGET_PATH)/heartbeatmice.service /lib/systemd/system/ && echo $(TARGET_PASS) | sudo -S systemctl enable heartbeatmice.service && echo $(TARGET_PASS) | sudo -S systemctl start heartbeatmice.service' +uninstall_app: + sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'echo $(TARGET_PASS) | sudo -S systemctl stop heartbeatmice.service && echo $(TARGET_PASS) | sudo -S systemctl disable heartbeatmice.service && echo $(TARGET_PASS) | sudo -S rm /lib/systemd/system/heartbeatmice.service' install_dep: sshpass -p $(TARGET_PASS) ssh -t $(TARGET_USER)@$(TARGET_HOST) 'echo $(TARGET_PASS) | sudo -S apt-get -y install cmake libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev ttf-mscorefonts-installer fontconfig libsystemd-dev libinput-dev libudev-dev libxkbcommon-dev \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa' diff --git a/Software/dashboard/heartbeatmice.service b/Software/dashboard/heartbeatmice.service new file mode 100644 index 0000000..331d5ee --- /dev/null +++ b/Software/dashboard/heartbeatmice.service @@ -0,0 +1,9 @@ +[Unit] +Description=Heartbeatmice dari UM + +[Service] +Type=simple +ExecStart=flutter-pi -r 90 --release @thepath/flutter_assets + +[Install] +WantedBy=multi-user.target