Termux LSD : Install File & Folder Icons in Termux

Hey Guys 🙋‍♂️, So nowadays I am more into terminal styling and there are a lot of tools available that can change the theme of our termux app but In all the theme changing tools and scripts there were no single one that can Add Icons in my termux. So this post is going to be specifically about how you can add icons for your files and folders in your termux with four simple steps 🔥.

What is Termux LSD?

Termux LSD is a more beautified version of termux ls That is used to list all the directories in a folder. In termux lsd you will see all the folders and files in different colour depending upon their file format and all the files and folder will have a proper icon to show its file type, like for all the folders in the termux you will see "📁 folder_name" kind of format.

Termux LSD : Install File & Folder Icons in Termux

This unique way of displaying files is what makes termux lsd so unique. It will change the colours of the ls out put and sort them in colour categories like, all the MP3 files will be in pink colour and all the folders will be in blue colours. It will also give a better tree output too. Termux LSD is just a package that you can install with simple pkg command but to set up it properly we need to follow some steps, the main step is to install font awesome font in termux.


How to Install File & Folder Icons in Termux :

To install File & Folder Icons in Termux you have to follow below simple steps, make sure you do not miss anything because it won't work at all. 

Step 1: Install Termux LSD Package In Termux:

To install lsd package in termux you just have to type below command in termux, and the package will be installed in few seconds, The size of the lsd package is tiny, so you don't have to worry about it even if you are using mobile data.
pkg install lsd
pkg install lsd

Step 2: Install Nerd Font In Termux:

Nerd font is a font that will provide us with the icons that will be added in front of our files and folders, there are different types of nerd fonts, and you can install any font you want from the Nerd font website. In this post, I am going to show you how you can install my favourite nerd font that is hack nerd font. The font installation is really complicated, so Just copy and paste below command in your termux and nerd font will be automatically installed on your termux.
cd && cd .termux && curl -fLo font.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip && mkdir fonts && mv font.zip fonts &&  cd fonts && unzip font.zip && mv "Hack Regular Nerd Font Complete.ttf" .. && cd .. && mv "Hack Regular Nerd Font Complete.ttf" font.ttf && rm -rf fonts
Termux LSD : Install File & Folder Icons in Termux


Step 3: Add alias In Termux:

To get the better output from ls command, we have to add an alias in the bash.bashrc file to get lsd output from ls command. Just paste the below command and the alias will be permanently added.
echo alias ls=lsd >> /data/data/com.termux/files/usr/etc/bash.bashrc

Termux LSD : Install File & Folder Icons in Termux

If you want to remove this alias for some reason, then you can go at  /data/data/com.termux/files/usr/etc/bash.bashrc file and remove the last line.


Step 4: Reload Termux Settings:

Now everything is done, and you just have to reload all the settings so that we can see icons in the terminal. You can also Restart your termux Or just type the below command.
termux-reload-settings
Termux LSD : Install File & Folder Icons in Termux

Now whenever you will type ls command you will see icons next to your files and folders.



Final Look :

Now after doing all the 4 steps properly you will see icons before all the files you have in your termux. The colours will also change depending on upon the file type. I have only few file types below, but almost all the types of file will have different icon, and it will be easier to identify them and the user interface of your terminal will look more aesthetic.

Termux LSD : Install File & Folder Icons in Termux


Conclusion:

Termux LSD is a real grate package when it comes to adding icons in the termux, It's simple and makes your terminal more aesthetic. I have used Hack font, but you can add any font you want. If you are Trying to change your termux look then you should check our [Termux Themes]. I am Going to write more of this specific terminal customization related posts so we all can have unique style of terminal. If you have any idea or questions you can type it in comments, For now thanks for reading guys, and as always Stay Ethical 👾.

Post a Comment

3 Comments