Add support for termux-battery-status#1289
Add support for termux-battery-status#1289Freed-Wu wants to merge 1 commit intoromkatv:masterfrom Freed-Wu:iss803
Conversation
|
maybe this line is problematic: (( bat_percent = `termux-battery-status|jq -r .percentage` ))this is export PREFIX=/data/data/com.termux/files/usr
export PATH=$PREFIX/bin:$PATH
export HOME=/data/data/com.termux/files/home
cd
exec $PREFIX/bin/zsh |
it is because termux-battery-status cannot work normally in adb shell. |
|
termux api only can work for termux user, not root or shell (adb shell user). so should get battery information from acpiclient prior to termux api. Now it can work for whoever termux user or root user. the bug that percentage of battery capcity is 0% will be fixed in #1288. |
|
In addition, please remove all forks from the code you are adding. The only new fork can be the invocation of |
|
i am sorry:( i asked this question to termux, they added an 'enhance' label for it. sorry again. |
Can we add a variable, when user make sure they have installed Termux:API, they set it, p10k will use it to display battery info? Because this variable if unset by default, it will effect other users. |
|
Can you elaborate why you want this segment visible? Doesn't your device already show battery level at the top? |
|
When user input command line in shell, the most of attention will be nearby the cursor, which is after shell prompt, not the top. |
|
Thank you for explaining the motivation for displaying batter charge level in the shell prompt when the same information is available at the top of the screen. The reason you've provided appears to me as a desirable feature rather than an issue issue to be solved or worked around: battery level changes slowly, so there is no need for the battery indicator to insert itself into the active working area of an app. However, if you feel like you need this, you can send me a clean PR (no unnecessary forks, correct and complete code that follows the local style, etc.), and I'll merge it. I don't recommend it but it's an option. |



It's a contiuance of #803 (comment)
Thanks for your review!