From b956895de82703a070fae75b7b055dfc03ee72c3 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 4 Dec 2016 03:39:12 +0100 Subject: [PATCH] termux-tools: Add termux-wake-{lock,unlock} --- packages/termux-tools/termux-wake-lock | 13 +++++++++++++ packages/termux-tools/termux-wake-unlock | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 packages/termux-tools/termux-wake-lock create mode 100755 packages/termux-tools/termux-wake-unlock 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