termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

can we set *keep screen on* option through command line ?

Open remo7777 opened this issue 5 years ago • 5 comments

Feature description Describe the feature and why you want it.

Reference implementation Does another app/terminal emulator have this feature? Provide links to more background information

remo7777 avatar Jan 06 '20 03:01 remo7777

Would probably be difficult to do as this would be implemented through termux-api. But the api for it requires the WindowManager (which only termux-app would have access to as far as I know) https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON

schoentoon avatar Mar 09 '20 10:03 schoentoon

Probably doable with custom escape sequences. @agnostic-apollo?

twaik avatar Dec 23 '23 14:12 twaik

Command line api would be the way to go here too, screens are independent of a terminal.

agnostic-apollo avatar Dec 23 '23 22:12 agnostic-apollo

Yeah, but escape sequence can let terminal emulator know which session exactly asked to keep screen on and not apply this option to other sessions. Also command line api can invoke escape sequences so there will be no conflict there.

twaik avatar Dec 23 '23 22:12 twaik

Screen on is not done per session, but for all sessions shown by the terminal view. Doing it per session would require management of states. Escape sequence api also needs to be implemented in future, so can see then.

https://github.com/termux/termux-app/blob/3b5018b4c79a2c2d218eb6fd570b2f2bebb8415a/app/src/main/java/com/termux/app/TermuxActivity.java#L753

agnostic-apollo avatar Dec 23 '23 22:12 agnostic-apollo