From 502a215167a2cd974393b447993d3e1e29491f3e Mon Sep 17 00:00:00 2001 From: Victor Phan Date: Tue, 21 Jul 2026 10:47:25 +0700 Subject: [PATCH] feat: add scripts to enable and disable screen sessions --- serverPython/disable_screen.sh | 10 ++++++++++ serverPython/enable_screen.sh | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 serverPython/disable_screen.sh create mode 100644 serverPython/enable_screen.sh diff --git a/serverPython/disable_screen.sh b/serverPython/disable_screen.sh new file mode 100644 index 0000000..2357a25 --- /dev/null +++ b/serverPython/disable_screen.sh @@ -0,0 +1,10 @@ +#!/bin/bash +DEVICE_IP="10.160.138.2:5555" + +# Dọn dẹp tiến trình cũ nếu có +pkill -f scrcpy + +echo "Đang tắt màn hình và khóa cảm ứng trên thiết bị $DEVICE_IP..." +# Chạy scrcpy ẩn dưới nền (nohup) +nohup scrcpy -s $DEVICE_IP --turn-screen-off --no-window > /dev/null 2>&1 & +echo "✅ Thành công! Màn hình đã tối đen, Bot vẫn hoạt động ẩn." diff --git a/serverPython/enable_screen.sh b/serverPython/enable_screen.sh new file mode 100644 index 0000000..a9e2f52 --- /dev/null +++ b/serverPython/enable_screen.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo "Đang khôi phục màn hình sáng và cảm ứng..." + +# Chỉ cần Kill tiến trình scrcpy, màn hình sẽ tự động sáng lại +pkill -f scrcpy + +echo "✅ Thành công! Điện thoại đã sáng đèn và có thể chạm lại bình thường."