Android Sleepを使わずに画面をオフに切り替える方法はありますか?
例えば、眠っているときに落ち着いたアプリを使うのが好きです。しかし、それは常に画面を保持します。 10分間そのアプリを使うだけで、画面を保持するのは素晴らしいことです。しかし、私が何時間も寝ているならば、私はアプリを実行中(サウンドを再生)し続けて画面をオフにしたいと思います。
これはどのように行うことができますか?
Android Sleepを使わずに画面をオフに切り替える方法はありますか?
例えば、眠っているときに落ち着いたアプリを使うのが好きです。しかし、それは常に画面を保持します。 10分間そのアプリを使うだけで、画面を保持するのは素晴らしいことです。しかし、私が何時間も寝ているならば、私はアプリを実行中(サウンドを再生)し続けて画面をオフにしたいと思います。
これはどのように行うことができますか?
Is there any way to quickly toggle the screen off without making Android sleep?
For example, I sometimes like to use the Calm app when I sleep. But it keeps the screen on all the time. When I just use that app for 10 minutes, it's great that it keeps the screen on; but if I'm sleeping for hours, I would like the app to keep on running (playing sounds) and turn the screen off.
How can this be done?
クレジットは基本的な方法でFireLordに行きます。これは、私のデバイスのバックライトをオフにしている時間遅延シェルスクリプトであり、明らかに他の人もいます。
"LCDOFF"という名前のファイルを作成し、次のようにコピーします。
<事前> <コード> /storage0必ず:
99887765544332
にあります(スクリプトは /storage
から実行できません)。ターミナルアプリを開き、 998877666544334
を入力して、10秒の遅延後、<コード> 99888766544335 を30秒間の遅延などして<コード>を30秒間オフにします。プロセッサがオンのままで、単に Android開発者オプション" wakeake "。 編集:滞在覚醒のみ電源に差し込まれている間だけ作用します - この回答代替
端末にコマンドを入力したくない場合は、スクリプトをカスタムアクションとして起動できます。
Credit goes to Firelord for the basic method. Here is a time-delay shell script that turns off the backlight for my device, and apparently others' as well.
Create a file named "lcdoff" and copy the following into it:
#!/system/bin/sh if [ -z "$1" ]; then echo "usage: `basename $0` delay" exit fi su -c 'echo getsu > /dev/null' echo "Tap power button 2x quickly to restore" sleep $1 su -c 'echo 0 > /sys/class/leds/lcd-backlight/brightness'
Make sure:
chmod 755 lcdoff
./system/bin
(scripts cannot be executed from /storage
).Then open a terminal app and enter lcdoff 10
, to turn off the screen after a 10-second delay, lcdoff 30
for a 30-second delay, etc. To ensure that the processor stays on, simply enable the Android developer option "Stay Awake". Edit: Stay Awake only works while plugged into a power source -- see this answer for an alternative.
If you don't want to type the command in a terminal, you can launch the script as a custom action in:
私はAndroid / Unix / Linuxのシェルスクリプティングにぴったりではないので、受け入れられている答えにいくつかの問題を抱えていました。
この作業者または類似している必要がある回線で作業するのは:
<コード> /storage6
Taskerの場合は、「root」が有効になっている「コマンド」フィールドにこれを置き、魅力のように機能します。単純にゼロを1に切り替えるだけで、ERGA:
<事前> <コード> echo 1 > /sys/class/leds/lcd-backlight/brightnessまたはデバイスのロックとロック解除
だからこの動作をすばやく切り替えることについてのあなたの質問に答える。上記の各コマンドをタスクタスクに割り当てて、デバイスをスリープさせずに画面をオンとオフに切り替えるには、最新のTaskerバージョンで新しい長押し切手を利用することができます。あるいは、あなたの条件が満たされたときにトリガーするプロファイルにコマンドを割り当てることができます。
I had some trouble with the accepted answer as I'm not hugely familiar with shell scripting on Android/Unix/Linux so I thought I'd add my experience here for anyone in a similar boat.
To get this working with Tasker or similar the line you need is:
echo 0 > /sys/class/leds/lcd-backlight/brightness
For tasker put this in the 'command' field with 'Use Root' enabled, works like a charm. To disable simply switch the zero out for a 1, ergo:
echo 1 > /sys/class/leds/lcd-backlight/brightness
or lock and unlock the device.
So to answer your question about quickly toggling this behavior. Assign each of the above commands to a tasker task, then you can make use of the new long-press intercept in the latest tasker version to toggle the screen on and off without putting the device to sleep. Alternatively you can assign the command to a profile which triggers when your conditions are met.
© 2022 cndgn.com All Rights Reserved. Q&Aハウス 全著作権所有