From 6cffcf3f112a875832ac5fb75f5825cdee646a89 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Dec 2024 23:42:15 +0300 Subject: [PATCH] automatically try get wakelock --- s.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/s.py b/s.py index 7d5622a..b2e9a60 100644 --- a/s.py +++ b/s.py @@ -11,7 +11,8 @@ import json is_termux = os.environ.get('TERMUX_APP__PACKAGE_NAME') or os.environ.get('TERMUX_APK_RELEASE') if is_termux: logger.info('Termux detected, checking permissions...') - logger.info('If you want prevent killing termux by android, get wake lock: check your notifications, find termux app and press "ACQUIRE WAKELOCK"') + logger.info('Prevent killing termux by android, getting wakelock...') + os.system('termux-wake-lock') logger.warning('This can cause battery drain!') if (os.environ.get('TERMUX_APP__APK_RELEASE') or os.environ.get('TERMUX_APK_RELEASE')) not in ('F_DROID', 'GITHUB'): logger.warning('You use not f-droid/github apk release, it may have problems...')