maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Android (https://talk.maemo.org/forumdisplay.php?f=54)
-   -   Termux and Termux:API apps (https://talk.maemo.org/showthread.php?t=97996)

switch-hitter 2016-10-24 18:05

Termux and Termux:API apps
 
I've just found the Termux and Termux:API apps in Google Play and I thought I'd point them out because they add some interesting goodness to your Android 5.0+ device (root not required).

Once you've installed Termux you can open it and run:
$ apt install python
to install Python 3.5. I think Ruby, Lua and others are also available.

Installing Termux:API gives you CLI utilities with the ability to access device capabilities like camera, gps, sms, etc... I haven't tested it yet but I think you should be able to access these from your Python scripts using subprocess / shlex.

Both of the above are free and there's an additional modestly priced app, Termux:Widget, that adds a widget to your homescreen that you can use to provide shortcuts to your scripts.

bandora 2016-10-24 18:24

Re: Termux and Termux:API apps
 
Nice! I usually use JuiceSSH to SSH into my linux box and do stuff there.. But this is nice too! :)

maegon9y00 2017-11-28 12:32

Re: Termux and Termux:API apps
 
Hi, I installed all the apps availables about Termux from f-droid on a Xiaomi Redmi 4a Android 6

It's good this. No requires root, and you can do many things, like executing a script, install man, python. Now I installed the default version

Code:

Python 3.6.3 (default, Oct  6 2017, 07:46:32)
[GCC 4.2.1 Compatible Android Clang 5.0.300080 ] on linux
Type "help", "copyright", "credits" or "license" for more information.

But it doesn't have the SimpleHTTPServer module

Code:

$ python -m SimpleHTTPServer
/data/data/com.termux/files/usr/bin/python: No module named SimpleHTTPServer

Any idea how to get/add this module?


Still I am unable to reproduce audio .wav
Installed paplay (i couldn't find aplay)
but
Code:

$ paplay C4.wav
W: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.

When audio issue get solved I could use espeak (actually installed but no audio )

endsormeans 2017-11-28 13:21

Re: Termux and Termux:API apps
 
.wav ?

hm.
is it critical for you to be able to play .wav?
it is after all in fact proprietary in nature .
As in ..."owned by microswift and IBM "
so getting the right to develop any software to run .wav has to go through them naturally.
Meaning...no one really wants to pay either or both of them money to use their format.

considering termux "is" terminal...
shouldn't CMUS or MOC run fine?
Normally fine ...I mean...
As in ..any of the other formats?
Both are more than adequate audio players...
there are others ...but those two are pretty decent...

update:

In fact ...come to think of it...
aplay most assuredly should play .wav ....through ALSA
but not pulse
Pulse is a No go.
No one is going to "fix" it.
This is Pulse's issue ..
Pulse's decision..
their dominion so to speak...

...and the state of Pulse and .wav has pretty much been this way for ...what...ever? ...I think...
It isn't about to get "fixed" ...since it was never broken to begin with...
since Pulseaudio doesn't run .wav

And yup...aplay should be running the .wav via ALSA
but...
not via Pulseaudio.
Pulseaudio in the mix just mucks things up for you.

the routing is not right ...(at least not right for running .wav)

I am sure there is some obscure freakin' weird ***** fix out there ...where you can run .wav through pulse ...but the brain tumour you will develop in trying to "fix" this so it runs through Pulse...may not be worth it.

maegon9y00 2017-11-28 13:30

Re: Termux and Termux:API apps
 
What I really want is to use terminal as I use it in n900.
my purpose is use the espeak in the way worked on n900.
You could set a simple reminder like

Code:

$ sleep 600; espeak "hey buddy, 10 minutes of nap is enough. Go back to work now"
This kind of use i am pointing in. But actually, espeak
Doesn't make a sound in termux

brunelli 2017-11-28 13:45

Re: Termux and Termux:API apps
 
Quote:

Originally Posted by maegon9y00 (Post 1538857)
But it doesn't have the SimpleHTTPServer module

Code:

$ python -m SimpleHTTPServer
/data/data/com.termux/files/usr/bin/python: No module named SimpleHTTPServer

Any idea how to get/add this module?

SimpleHTTPServer is a Python 2 module.

Code:

$ apt install python2
$ python2 -m SimpleHTTPServer


maegon9y00 2017-11-28 14:02

Re: Termux and Termux:API apps
 
Excellent! THANKS brunelli

$ python2 -m SimpleHTTPServer running!

Code:

python2 -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...


Ken-Young 2017-11-29 00:15

Re: Termux and Termux:API apps
 
Quote:

Originally Posted by maegon9y00 (Post 1538859)
What I really want is to use terminal as I use it in n900.
my purpose is use the espeak in the way worked on n900.
You could set a simple reminder like

Code:

$ sleep 600; espeak "hey buddy, 10 minutes of nap is enough. Go back to work now"
This kind of use i am pointing in. But actually, espeak
Doesn't make a sound in termux

espeak won't directly produce audio under termux, for some reason. But you can produce a .wav file, and play it with play-audio:

Code:

$ sleep 600; espeak -w temp.wav "hey buddy, 10 minutes of nap is enough. Go back to work now";play-audio temp.wav;rm temp.wav
That works, at least on my Pixel XL.

maegon9y00 2017-11-29 00:44

Re: Termux and Termux:API apps
 
Great!. Yes, it works here also. Xiaomi Redmi 4a.

I have another script I wanna run on termux. It's about the number of days passed since birthday. The next week or perhaps this weekend I'll do the tests


All times are GMT. The time now is 10:53.

vBulletin® Version 3.8.8