Git Product home page Git Product logo

custom-bashrc-prompt's Introduction

Custom .bashrc with Git status, current tech news, random quote, current weather, live currency conversion, and more.

My System

  • Open .bashrc file in your favorite editor. (Try: gedit ~/.bashrc)
  • Add the above code to the end of your .bashrc file. Save the file and exit.
  • Run source ~/.bashrc in terminal to see changes.

Requirements for currency conversion and quote fetch:

Download and install jq by visiting this link or simply type the command below in your bash:

sudo snap install jq

Special Characters for customizing bash prompt:


Git status and branch info:

The prompt automatically shows the current git status and branch information with custom colors in the bash if it detects the current directory to be a git repository. Also, the icon status changes based on git status and branch name. The prompt_git() function is used to enable git information on your working directory. (Feel free to remove it and related inserts if you want.)


External IP check:

You can check your external IP by executing the command xip.


News:

(Credits to Alvin Lin's getnews.tech)

You can get the latest news from various different sources by simply typing news. My favorite default list of sources is google-news, hacker-news, mashable, polygon, techcrunch, techradar, the-next-webt, the-verge, and wired-de. Find other sources by typing curl getnews.tech/sources

Below screenshot is a short example. The script by default displays 20 articles from all the above listed favorite news sources. Feel free to change it in the .bashrc under news function


Random quote

You can view a random quote by typing the command quote.


Currency conversion:

You can quickly check what the live currency conversion rate is for any currency. This API converts from US Dollars (USD). The default is set to INR (Indian Ruppees).

Note: Please check the .bashrc and replace the INR with your favorite currency code

Use cases (check image below):

  • Check currency conversion from USD to favorite currency (Default: INR)
  • Convert certain amount from USD to favorite currency(Default: INR)
  • Convert certain amount from USD to any other currency


Weather info:

(Credits to Igor Chubin's wttr.in)

You can check weather for your current city by executing the command weather. You can also check current weather for any other city by typing weather "CityNameHere" like weather "San Jose"


Directory creation and direct cd:

You can quickly create a directory and also jump into that created directory at the same time using the command mkcdir <directory_name> instead of the standard mkdir <directory_name>.

custom-bashrc-prompt's People

Contributors

onehungrygeek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.