How to spice up your Linux (Ubuntu) terminal prompt (using powerlevel10k and oh-my-zsh) in 2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys so in this video what i'm going to do is i'm going to take the ubuntu terminal and take it from this this simple bash prompt and convert it into something like this so it shows the the icon of the distro that you're on your directory you can see there are these nice icons it also shows that this particular repository is being hosted on github it shows the name of the branch it shows that i have one commit that i need to push so um let's see how to get this so the way to do that is first of all we're going to want to install z share okay so it's a simple command so you don't have to install zsh oops that was too fast and this is going to go ahead and install zsh for us uh there are quite a few benefits for using z shell and for example you don't have to worry about the case sensitivity of the files or directory names um you can just copy and paste commands from the internet and they won't start executing immediately so even if they have line breaks they're not just gonna run it's going to select them and you can modify before doing anything okay so once this is installed what you're going to want to do is change the default shell to zsets so by default one two comes with bash so you can see that by writing echo and then the dollar sign and zero and you can see the running bash and to change this to z shell you have to write something like this c h s h change shell and then press enter it's going to ask you for the password of the root uh press enter and here just type slash pin slash csh now at this point uh you have to log out from this um from your session and log back in or you can just simply reboot the machine so what i'm gonna do is i'm gonna reboot this and see you guys when it is rebooted okay so now we have rebooted let's open terminal again and this time you'll notice that you're greeted with this uh prompt that you have to follow so what it's asking you is if you want to customize these settings what i generally do is i just populate with the configurations recommended by the system administrator so i'm just going to press 2 and we're inside z and you can verify that by writing the same command again okay the next thing that we want to do is we would want to inst install oh my gosh or oh my z search or whatever you want to call it so we're just gonna go to uh install all my zsh and this is also really easy to do all you gotta do is just scroll down and all right this is the button that i press and then simply copy this and paste it into your terminal okay so since this is a fresh one two like i mentioned earlier um we need to install curl so let's install car [Music] alright so let's go ahead and try that again great we also need to get okay should be good now great so now you'll notice that the prompt has actually changed a little bit and that's because now we are using this oh my gosh um now we need to install uh a theme for all my zsh and it is called power level 10k and again we just have to paste one command here so i'm just gonna copy this let's go back here and i'm going to paste it now at this point you would want to do something which is not mentioned in these guides right and that is to get a proper font which contains all the icons for the new prompt that we're gonna see so to do that i actually already have it set up in one of my repositories so you can actually i'm going to leave this link in the description but it's actually github dot com slash even user slash my linux setup and here there's gonna see you're gonna see this folder called powerline fonts and all you have to do is you gotta copy these and you have to install them and the way i would do it is let me see where i am i'm in my home directory so i'm just going to clone this and once it is cloned what i'm going to do is i'm going to take the fonts and i'm going to copy them all of them into the directory that generally contains fonts and this point this is actually necessary because otherwise you're not going to see the icons in the prompt which is actually what makes the prom text look very nice um so to do that what i'm going to do is i'm going to open my home directory and this is the repository that i've just cloned and i'm going to do is i'm going to just copy these fonts i'm going to go back to the home directory and then here i'm going to hit control and h so hold ctrl and press edge and all of the hidden files are going to be visible and then just simply create a new folder called dot fonts and then simply paste those fonts here and then you can go back to your home directory and again control plus h and you're going to get rid of the hidden directories so now there's one more thing that we need to do before we go ahead and install that theme that i mentioned earlier we need to install the gnome the gnome tweak tool so sudo apt install the gnome tweak two i think it's called gnome tweaks oh yes yeah so gnome tweaks i think previously this used to be called gnome tweak tools but anyway so it's gnome tweaks uh now that that is installed i'm gonna go to my launcher and type tweaks you're gonna see this icon here uh once this opens we're going to go to fonts we'll look at this monospace font and we're going to change this to m-e-s-l-o my slow lgs regular regular is fine you can actually select one of those but it has the name has to be this so if you want to tell it gets up to you but i i generally just go with the mess low lgs nerd font and if regular so i'm going to select this and now i'm just going to close this now you'll notice that this actually seems to be a little bit messed up right well there's no need to worry you just have to close the terminal and just open it again and you're going to see that now it looks fine right so now we need to install that theme and what the theme is called power level 10k the first result is going to get us there and then we need to install it in oh my gosh i'm going to copy the link again i'm going to paste it and press enter okay so what this means is that i have already cloned that what i'm going to do is now there's one more step left to enable this theme and that is we have to edit the uh css resource config file and the way to do that is wim and dot cshrc okay i don't have him so i'm gonna go ahead and use jedit alright so this is the css theme that we have all we're gonna do is gonna write power level 10k slash power level 10k so this is all you have to do press control and s or click the save icon close it we're going to close this terminal one last time we're gonna open it again okay so there needs to be one more k here so i'm just gonna edit this again i need to add 1k here again so now i'm going to close this close this again let's reopen this and there we have it so now if we install the phone correctly we're supposed to see the things that it says like does this look like like a diamond so i'm going to say yes does this look like a log yes does this look like a debian logo yes yes um you can actually customize it the way you like i just typically want to keep the rainbow and then you're going to make sure you want to use unicode at this point and then i would go without any no i don't want to see current time angle is fine sharp head is good tails can be round i prefer it in two lines um disconnected no frame sparse many icons concise yes verbose yes and this is it that's that's all there is you can see this uh nice prompt here i can actually go to the to any folder that contains a git repository so maybe like let's go to this directory and you're gonna see that it shows the branch the name of the branch and it also shows this icon here so since this this this branch is this this repository is being hosted on github it's going to show the github icon and if i had another repository that was hosted on git lab it's going to show git labs icon here and it when it's green this means that working directory is actually clean so i can say get status and you can see working directory clean when it is so so the the this actually represents that the directory is clean and if i do something like touch some file.txt you're gonna see that now we have one untracked file okay and if i modify a track file so maybe let's just edit the readme you're gonna see that now we have one untracked file and we have one track file but with changes right and if a command takes a little while it's always going to show the the amount of time that it has spent and this actually also shows um if you're behind your master branch of whatever branch you are on so if if the remote branch is ahead of you it's going to show down arrows if you are ahead of the remote branch it's gonna show so for example i can just go ahead and get commit just uh temp commit maybe i don't know uh let me just first add these and then commit it now you can see that i have two modifications okay wait this this means i've added two files right so test commit i need to this is like i said of really fresh installation of ubuntu so it's gonna take a little while that's fine you can just use the default values here right so there you go so now i've committed something and you can see that it says that there's this up arrow and one it means that i need to push something to the remote branch and this is actually really helpful so uh the process is pretty much the same on mac as well and even on this windows subsystem for linux for mac you don't have to install the fonts if you use the correct terminal but i'm going to make another video for mac and windows later on so for now i think i just hopes this helps somebody i actually spent a lot of time uh you know trying to configure this uh sometimes i would get the font wrong sometimes i would do other you know mess things up but i thought i'd just make a video for somebody else like anybody else who is trying to get this terminal um okay so like and subscribe and i'm gonna see you in the next video thanks
Info
Channel: Muhammad bin Yusrat
Views: 10,064
Rating: undefined out of 5
Keywords:
Id: PZTLIVQxxEY
Channel Id: undefined
Length: 16min 1sec (961 seconds)
Published: Sat Sep 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.