Terminal command to turn off/on second screen - LG V20 Questions & Answers

Is there a terminal command to turn off or on the second screen? I'm asking because I want to use MacroDroid to automate its behavior, but AFAIK it doesn't have an appropriate action for it.
I went through all the system/global/secure settings and couldn't find anything relevant.

Related

Disabling authors screensaver

Is it possible to completely disable the automatic activation of the screensaver? I don't see it in settings, the longest interval for this to happen is 1 hour, but no option to disable it completely. I already installed the No Lock app, but this only helped me to get rid of the slide to unlock screen. Thank you for any ideas.
Martin
Martin2603 said:
Is it possible to completely disable the automatic activation of the screensaver? I don't see it in settings, the longest interval for this to happen is 1 hour, but no option to disable it completely. I already installed the No Lock app, but this only helped me to get rid of the slide to unlock screen. Thank you for any ideas.
Martin
Click to expand...
Click to collapse
All settings are here:
http://developer.android.com/reference/android/provider/Settings.System.html
In you case you'll need:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
-- check current value
select * from system where name='screen_off_timeout';
120000 - 2 min
3600000 - 1 hour
2147483647 = 596.5 hours
-- set
update system set value='2147483647' where name='screen_off_timeout';
.q
^d
or you can pull/mod/push alternatively.
Won't disabling the screensaver keep the screen and IR sensors active, thus eating up battery life significantly when not in use?
I know some folks would like to get rid of the swipe, waking up on a screen tap (mostly for accessibility issues), but I think some sort of screen (actually, battery) saver is still important.
Great link, ApokrifX. Would you happen to know if WIFI_SLEEP_POLICY does anything on the NST? I use Tasker to shut wifi off when the screen goes off, but I wonder if that might be easier?
bobstro said:
Great link, ApokrifX. Would you happen to know if WIFI_SLEEP_POLICY does anything on the NST? I use Tasker to shut wifi off when the screen goes off, but I wonder if that might be easier?
Click to expand...
Click to collapse
No idea.
I bet, it won't work...
Try and let us know?
ApokrifX said:
No idea.
I bet, it won't work...
Try and let us know?
Click to expand...
Click to collapse
I need to find a program that will let me know when wifi is on or off relative to the screen. On other devices, I can see that info in the battery status, but I'm not finding a similar option for the NST.
I *did* find a little program that would toggle it, but the NST lasts so long on battery, it's hard to tell if it's making any difference.
Actually, to disable the screensaver completely:
Code:
update system set value=-1 where name='screen_off_timeout';
I haven't found a way to disable the keyguard yet, but if you have one of the side keys set as Menu that dismisses the keyguard.
Renate NST said:
Actually, to disable the screensaver completely:
Code:
update system set value=-1 where name='screen_off_timeout';
Click to expand...
Click to collapse
Hi Renate again ( you adviced me with manual time set in NST
http://forum.xda-developers.com/showthread.php?p=30560605#post30560605, thanks).
I like the tweak (to disable the screensaver completely) also. But not understanding how to do this in internal terminal. Not shell and not busybox know the sqlite3 app and update command?
I fixed it so:
you must install SQLite3 to the NST you can just push it to the device. [unzip sqlite3 (push to n2e).zip]
Code:
adb shell mount -o rw,remount -t ext2 /dev/block/mmcblk0p5 /system
adb push sqlite3 /system/bin
download it from here:
http://forum.xda-developers.com/showpost.php?p=14747007&postcount=2
bobstro said:
Won't disabling the screensaver keep the screen and IR sensors active, thus eating up battery life significantly when not in use?
Click to expand...
Click to collapse
This makes a lot of sense... it explains my battery drain when the screen gets stuck on the "drag to unlock your NOOK" page after a reboot. Basically you have to make sure the Nook really goes to sleep.
Disabling the IR sensors and wifi are then the key to long battery life on the NST.
For anyone trying this technique: I used the pull/mod/push approach and Renate's recommendation of a -1 value, and everything seems to be working well, but I had to powercyle (power down, then power up) my Nook to get the change to take effect.

[APP] Overscan Toggle (one hand mode / reachability)

After reading the about using overscan to move the whole content of the screen into reach of my thumbs, I decided to create a little apk using Tasker. With this app, you can use any kind of trigger to switch from reachability mode and back to normal. It has no user interface, just launch it (in my case, I have customized my home button so a double press will launch it). See screenshots for details. Root is needed.
All this app does is running "wm overscan 0,600,0,0" and "wm overscan reset" alternately.
It's exactly what I'm looking for. Could you please add a config file with custom commands at least? Source would be great for a root app ?
Will look into that. Can't really post a source since I created the app with tasker, but I'll post the tasker config I used as soon as I get home.
This program has reduced 2-3 cm in my screen .
I can't uninstall the program because I can't see anything.
Connect adb (if you don't know how, there will be a guide for your device on XDA), type "adb shell", hit enter, type "wm overscan reset".
Hurray it worked.... But you must write this information to the application page on google play...

[Original Shield Tablet] How to: Screen off when reinserting stylus (Tasker, Root)

Morning!
Personally I use the stylus quite a lot, and it always bothered me that the screen didn't turn off when I put the stylus back in the tablet. Thus, I figured out how to make that happen with Tasker.
Below you'll find a basic description of how to achieve this on your own, and also a link to my tasker profile.
Note that this requires root(Run Shell), and that Tasker is set as a Device Administrator(Screen Off).
This profile detects when the stylus status changes.
Profile: Event -> System -> Intent Received
Action: com.nvidia.intent.action.PEN_CHANGED
This task determines if the stylus is removed or inserted, and acts accordingly.
Task: Code -> Run Shell
Command: settings get system stylus_removal_status
Use Root: Checked
Store Output In: %STYLUS
If the stylus is removed, this task sets %STYLUS to 1. And if not, 0.
Task: Display -> System Lock
If: %STYLUS ~(matches) 0
Obviously there are a lot more things you can do, incl. grouping settings etc. within the Task -> If function, but I figured I'd just explain the basics here.
My profile linked below reacts to when the stylus is inserted assuming I'm not watching Netflix, and gives me 2 seconds to abort the Screen Off countdown with a scene popup button if I want to. It also contains a "safeguard" to avoid the screen turning off as soon as you wake it, which would occur if you reinserted the stylus and then turned off the screen manually by habit.
As I'm a new user, you'll have to copypaste the link, hopefully that's not too annoying.
https://drive.google.com/open?id=0B6AArOv0k9BPbGRfR0dUXzR2ek0

Any way to keep enable One-hand mode after screen off?

Hi
I need to keep enable One-hand mode after screen off.
There is a way to do that?
Here is how to do it :
Simply run this terminal command from any method or script '
am startservice -n com.sec.android.easyonehand/.EasyOneHandService
This works on the galaxy s5. This rune the service to activate the one hand mode.
With Tasker, run this line when turning on the screen

[Solution] Start Tasker after head unit sleep

I was asked by @rigattoni if I could write an app that allows to trigger Tasker after head unit wakes up from sleep (aka fast boot).
Why? Android has no reliable way for apps to be triggered when the device resumes from suspend-to-RAM state (aka fast boot).
Therefore a lot of Tasker users are missing a way to achieve that any Tasker jobs are started in fast boot.
My small little app tries to solve this.
This topic was first mentioned here: https://forum.xda-developers.com/showpost.php?p=82596933&postcount=6133
How it works:
When a USB mass storage device is attached, the app will be triggered by Android, both in cold boot, and also in "fast boot".
Then the app waits for 10 seconds and then fires a Tasker specific intent to Tasker and the app will finish itself.
This allows that any Tasker tasks will be triggered.
In the attachment you find both a ready APK and the source code of it.
Note: I will not maintain this app.
If the APK does not fit your needs, adapt the source code yourself.
If you want to send other intents additionally, adapt the source code yourself.
If you want to change the timeout of 10 seconds, adapt the source code yourself.
If you don't know how to do so, take an online Android App Development training.
Thanks for your effort and this post ?
I've simply used tasker with "Display on" event for starting the app I need, turning wifi on, etc.
Working flawlessly for cold boot or resume... why not this method?
themissionimpossible said:
I've simply used tasker with "Display on" event for starting the app I need, turning wifi on, etc.
Working flawlessly for cold boot or resume... why not this method?
Click to expand...
Click to collapse
For me and others, the Tasker background process is killed on resume so it's not "active" to know that the screen is on or otherwise.
In my case tasker always runs on start.
But if for somebody tasker is killed on resume, how another app instead should be able not to be killed as well?
This app here is started by Android itself if a USB stick is present and so resistent against the 'kill all running apps' issue.
Missing Accessibility activation
On CSN2, CSN2-D, RL7Ac units another issue is visible, according to the Android restrictions starting with Android 8, that accessibility settings are not stored. That means that Tasker is not allowed to work in background... This is a no go for us...
This can be "fixed" if the unit is rooted!
What is needed:
Preparation:
Unit is rooted
Tasker installed
Secure Settings installed and activated
Workflow:
Secure Settings:
Switch to tab "SYSTEM+"
Press the button "DISABLED" and wait until the system is set to "ENABLED"
Close the app
Tasker:
Open "Preferences" in Tasker, switch to tab "MISC", activate "Allow External Access" and deactivate "Reduce Resource Usage". There might be some popups afterwards when closing Tasker about battery usage... As we don´t care about that, please accept these changes.
Task:
Create a profile, Example:
"Screen on" with higher priority (otherwise the task may be scheduled)
Create new task
Press the "+" button to add a command
Choose "Plugin and there "Secure Settings"
Press the stylo and open "System + Action"
Choose "Accessibility Settings" and search for Tasker in the list (on some units, the field is really small to find any app)
Press the "DISABLED" button to get it changed to "ENABLED" and safe the setting.
You can add other accessibility changes too. In this case you need to add a wait of 100ms between the commands.
(FCC needs it, because otherwise some functionality of FCC does not work (automatic light, volume....))
Example added to import in Tasker.
not working for me on android 10 (( (825X_pro)
magicm3n said:
not working for me on android 10 (( (825X_pro)
Click to expand...
Click to collapse
Would you please precise what is not working?
What happens if you start the app manually?
...some information as given would really be useful, right?
rigattoni said:
Would you please precise what is not working?
Click to expand...
Click to collapse
Tasker does not start after waking up.
rigattoni said:
Would you please precise what is not working?
What happens if you start the app manually?
Click to expand...
Click to collapse
If I start app manualy its OK, tasker starts
You need a USB stick being attached to the head unit. Have you done this?
realzoulou said:
You need a USB stick being attached to the head unit. Have you done this?
Click to expand...
Click to collapse
Yes, of course, USB stick attached
magicm3n said:
Yes, of course, USB stick attached
Click to expand...
Click to collapse
If you pull out the stick and put it back in again. Do you get the popup to start the StartTasker automatically?
rigattoni said:
If you pull out the stick and put it back in again. Do you get the popup to start the StartTasker automatically?
Click to expand...
Click to collapse
So, here's what news.
After a long sleep (the car sleep for about 2 hours), I turned on the ACC and received a notification asking whether to launch the StartTasker when the UDisk device was connected. I checked the "allow" box.
But now if I turn off the car for just a couple of minutes, then nothing happens: the unit wakes up, all applications are killed and the StartTasker does not start.
When I take out the stick and insert it again, then OK, the StartTasker starts - I see the correspond popup notice below.
But now there is another problem: the StartTasker itself does not start the Tasker ((. Even if I manually start StartTasker , I can see the startup notification at the bottom, but the Tasker won't start. Hm...
magicm3n said:
So, here's what news.
After a long sleep (the car sleep for about 2 hours), I turned on the ACC and received a notification asking whether to launch the StartTasker when the UDisk device was connected. I checked the "allow" box.
But now if I turn off the car for just a couple of minutes, then nothing happens: the unit wakes up, all applications are killed and the StartTasker does not start.
When I take out the stick and insert it again, then OK, the StartTasker starts - I see the correspond popup notice below.
But now there is another problem: the StartTasker itself does not start the Tasker ((. Even if I manually start StartTasker , I can see the startup notification at the bottom, but the Tasker won't start. Hm...
Click to expand...
Click to collapse
StartTasker is NOT for starting Tasker, it´s to activate Tasker working in background. It just send an Intent, nothing else.
Check if in Accessibility settings Tasker is activated and in Tasker settings if "Allow External Access" is activated and "Reduce Resource Usage" deactivated.
Add a new profile with Display Orientation Landscape, write a short task with a Wait for 10 sec and add a Flash with some text and retest.
This should automatically activated after boot. and should show this flash on your unit.
Yes of course, a profile is written in the Tasker to launch another application. It works. When I rebooted the device, the StartTasker saw the connected USB and launched the Tasker, which completed the task.
But all this does not happen for some reason after exiting sleep mode.
I'll check settings tomorrow. Tnx!
rigattoni said:
StartTasker is NOT for starting Tasker, it´s to activate Tasker working in background. It just send an Intent, nothing else.
Check if in Accessibility settings Tasker is activated and in Tasker settings if "Allow External Access" is activated and "Reduce Resource Usage" deactivated.
Add a new profile with Display Orientation Landscape, write a short task with a Wait for 10 sec and add a Flash with some text and retest.
This should automatically activated after boot. and should show this flash on your unit.
Click to expand...
Click to collapse
My Head unit have not Accessibility settings (
All other is on.
Did not start after sleep.
If I reattach USB stick manually then Starter had starts, I see pop up message, but Tasker is not.
magicm3n said:
My Head unit have not Accessibility settings (
All other is on.
Did not start after sleep.
If I reattach USB stick manually then Starter had starts, I see pop up message, but Tasker is not.
Click to expand...
Click to collapse
I assumed that....
See my posting here: https://forum.xda-developers.com/showpost.php?p=82627859&postcount=7
You can import the task and then export as app afterwards.
In this case you just need a launcher which supports this app on start up. I use Fcc Car Launcher for that.
rigattoni said:
I assumed that....
See my posting here: https://forum.xda-developers.com/showpost.php?p=82627859&postcount=7
You can import the task and then export as app afterwards.
In this case you just need a launcher which supports this app on start up. I use Fcc Car Launcher for that.
Click to expand...
Click to collapse
FCC Car Launcher does not work on my Unit. No widgets support.
magicm3n said:
FCC Car Launcher does not work on my Unit. No widgets support.
Click to expand...
Click to collapse
Which unit?
Please don´t let us tear all information in small parts out of you.
which Unit, MCU version, Android version... please.
Use this app to configure the Accessibility settings and check if this is still activated after deep sleep.
Just now I don´t know any unit which does not work with Fcc... not completely may be with some missing features, but the standard things are working.
...and please read at least the first thread of the Fcc Car Launcher thread...
This thread gives a solution to rework the Tasker issue... and is a real Tasker fault.
I added a solution for getting it working if any Android unit forgets the accessibility setting in deep sleep.
Your problem now is a complete different thing, which needs to be discussed in the related thread.... and this is for fact the Fcc thread.

Categories

Resources