automatically try get wakelock

This commit is contained in:
Your Name 2024-12-18 23:42:15 +03:00
parent 403a377374
commit 6cffcf3f11

3
s.py
View file

@ -11,7 +11,8 @@ import json
is_termux = os.environ.get('TERMUX_APP__PACKAGE_NAME') or os.environ.get('TERMUX_APK_RELEASE') is_termux = os.environ.get('TERMUX_APP__PACKAGE_NAME') or os.environ.get('TERMUX_APK_RELEASE')
if is_termux: if is_termux:
logger.info('Termux detected, checking permissions...') 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!') 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'): 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...') logger.warning('You use not f-droid/github apk release, it may have problems...')