Termux:Widget - User Termux Widget Like a Pro in 2022

Hey guys πŸ™‹‍♂️, Termux is one of the best tool when it comes to android Hacking and Scripting and the one measure issue that we face with termux is that sometimes it takes multiple command just to do a single task. In this post, we will see how we can overcome this problem and make scripts run with just one click from your home screen πŸ“².

Termux:Widget -  User Termux Widget Like a Pro in 2022

What is Termux Widget?

Termux Widget is a plugin created for termux that will allow users to run termux scripts and files using a shortcut on your home screen. After installing this plugin, you can check your phone for widgets, and you will see a new termux widget that you can simply place on your screen to run bash files inside your termux application. 

Termux:Widget -  User Termux Widget Like a Pro in 2022

To use termux widgets in an advance way, it's better if you know basics about the bash programming. You can use termux widget shortcut to run your APACHE server by just a single tap, you can activate any web bot or Crypto miner from your home screen, you can also launch scripts like YouTube Downloader, Termux Games or Any Phishing Script so that you can directly do these task with minimum effort and make your termux more time efficient.


How to Download Termux Widget for Free?

Make sure you have downloaded the Termux from the f-droid and not from playstore or else the add-ons will not get installed. If you wanna know how to install termux latest updated version then read : Download Termux : Install latest version of Termux - 2022 ]

1st Method:

To download termux widget, you Just have to click on the download button below and the APK will be downloaded in your phone,

Download Termux Widget for Free

Just install that APK and if you see a successful installation, then you are done with the download part.

2nd Method:

If the above downloaded APK is not working or it is showing "app not installed error" then you can just go to the F-Droid Termux widget page and try to download the latest version available.


How to Use Termux Widget?

Before following the below steps, make sure you have installed the termux widget plugin in your phone using the above method.

Step 1:

Open termux app and type the below command to create a hidden folder name shortcuts, this will be the folder that will contain all the shortcut bash files that we will run using the termux widget.
cd && mkdir .shortcut 
This simple command will create a hidden folder in the home directory of termux.

Step 2:

Now, to see if the .shortcuts directory is present or not, you have to type ls -a command. In this step, you just have to type the below command to get inside the .shortcuts directory.
cd .shortcuts

Now you will be inside the .shortcuts directory, you can type pwd to check your path.


Step 3:

This is a complex part where we will create a .bash file in this .shortcut folder. Type below command to install nano in your termux.
pkg install nano

If you are facing repository is under maintenance or down error, then read this post for a quick fix.  Termux Repository Under Maintenance Issue SOLVED ✅


Step 4 (Create a Bash Script):

For this step you must be inside the .shortcuts folder, if you have followed the above commands then you will be at the right path.

Here you can create any shortcut script you want, and you will be able to run it with a shortcut from your home screen, for the tutorial I am gonna write a script to check memory usage in my phone.

Type below command and press enter to create a text file name MemoryCheck.bash
nano MemoryCheck.bash
After entering this command you will see nano text editor, just type the below line the text editor
free -h -t ; read b 

and press CTRL+X and then Y to save the file.

If You don't know about the termux basic command, then it is recommended to read [ Basic commands in termux | Termux command list ]


Step 5:

The scripting part is done, and now we just have to do a last thing, Go to your home screen and add termux widget, since every brand of phone have little different method for adding widget I can't show them all. Just go to the widget option of your phone and in the last you will find termux widget, just add it on your screen.
Termux:Widget -  User Termux Widget Like a Pro in 2022

After adding it to your screen you will see MemoryCheck.bash listed on the widget, if not just refresh the widget using the refresh button on it and now tap on the MemoryCheck.bash file to check your memory usage.
Termux:Widget -  User Termux Widget Like a Pro in 2022

Extra Tips :

You can cd to .shortcuts folder and add as many scripts as you want, make sure you follow the steps right to make it work. 



Conclusion:

Termux Widget is an excellent solution to making the termux script more accessible, using this we can set up some scripts for our non-technical friends and family, so they can also use the termux tools without knowing any commands. For this post I have made a memory checker scrip, but you can add shortcuts for all the tools that you have in your temux like, Phishing tools, flooding tools, python console launcher, ping any site, play temux games or download YouTube videos, the possibility are endless. If you want me to write scrips for termux widget, then just comment your ideas. also, if you have any questions, you can ask me in the comments below. Thanks for reading guys and as always stay ethicalπŸ‘Ύ.

Post a Comment

0 Comments