DEV Community

loading...
Cover image for Termux: Give me your use cases!

Termux: Give me your use cases!

imthedeveloper profile image ImTheDeveloper ・1 min read

I recently stumbled upon Termux: "the terminal emulator and linux environment for android".

Whilst it sounds pretty cool to have such an app on my phone, especially with my love for Linux I'm wondering what the wonderful use cases people have for such an app.

This especially interested me recently when I found it also has an API version which allows you to access the phone hardware APIs. I assume this could allow me to build some quite clever task runners as seen with other apps like "If this then that" and "Tasker".

I've played with a number of great node.js projects on a raspberry pi such as Node-red which appears to run nicely within Termux. This makes my android smartphone the ultimate IoT hub to play around with integrations without needing to even open up my laptop.

Please feel free to drop in the comments any of your Termux use cases I'll be fascinated to hear what others are doing with the app.

Discussion

pic
Editor guide
Collapse
voyeg3r profile image
Sérgio Luiz Araújo Silva

Install termux-api

apt install termux-api
Enter fullscreen mode Exit fullscreen mode

ssh support

apt install openssh
Enter fullscreen mode Exit fullscreen mode

To get ssh port

logcat -s 'syslog'
Enter fullscreen mode Exit fullscreen mode

your current user:

whoami
Enter fullscreen mode Exit fullscreen mode

Now you have termux-clipboard-get and termux-clipboard-set

apt install python
pip install yturl
pip install neovim
Enter fullscreen mode Exit fullscreen mode

You can listen youtube videos with mpv

mpv --no-video url
Enter fullscreen mode Exit fullscreen mode

or

cat <<-'EOF' >> ~/.bashrc
yt(){
    mpv --no-video "$(yturl $(termux-clipboard-get))"
}
EOF
Enter fullscreen mode Exit fullscreen mode

Access you phone through ssh or copy files like

scp -P 8022 file.mp3 u0_a184@192.168.15.2:~/storage/music
Enter fullscreen mode Exit fullscreen mode

Add your own scripts

echo "PATH=~/bin:$PATH" >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Now you can write some scripts there.

Collapse
33nano profile image
Collapse
rupankarghosh profile image
RupankarGhosh

You can run almost any node apps on termux except the electron build one. It's a great tool to keep personal server up. Nowadays I just use termux for downloading YouTube videos with YouTube-dl and testing some python tools, I made my move to Linux recently 😍

Collapse
33nano profile image
Antisocial Ambassador

Youtube dl is the way to go 👍🏽

Collapse
33nano profile image
Antisocial Ambassador

Its a true extension to the linux experience