termux-tools: Add termux-wake-{lock,unlock}

This commit is contained in:
Fredrik Fornwall 2016-12-04 03:39:12 +01:00
parent 33b944c8a2
commit b956895de8
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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