diff --git a/packages/termux-tools/termux-wake-lock b/packages/termux-tools/termux-wake-lock new file mode 100755 index 000000000..d03b0a58a --- /dev/null +++ b/packages/termux-tools/termux-wake-lock @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ $# != 0 ]; then + echo 'usage: termux-wake-lock' + echo 'Acquire the Termux wake lock to prevent the CPU from sleeping.' + exit 1 +fi + +am startservice \ + --user 0 \ + -a com.termux.service_wake_lock \ + com.termux/com.termux.app.TermuxService \ + > /dev/null diff --git a/packages/termux-tools/termux-wake-unlock b/packages/termux-tools/termux-wake-unlock new file mode 100755 index 000000000..a1dfee9c5 --- /dev/null +++ b/packages/termux-tools/termux-wake-unlock @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ $# != 0 ]; then + echo 'usage: termux-wake-unlock' + echo 'Release the Termux wake lock to allow the CPU to sleep.' + exit 1 +fi + +am startservice \ + --user 0 \ + -a com.termux.service_wake_unlock \ + com.termux/com.termux.app.TermuxService \ + > /dev/null