All Projects → yedhink → Bashed On A Feeling

yedhink / Bashed On A Feeling

Licence: mit
⚡️ fast and minimalistic git prompt written in bash

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Bashed On A Feeling

Slate
A Super-Lightweight Annotation Tool for Experts: Label text in a terminal with just Python
Stars: ✭ 61 (-49.17%)
Mutual labels:  terminal-based
Mazu Editor
a minimalist text editor with syntax highlight, copy/paste, and search
Stars: ✭ 88 (-26.67%)
Mutual labels:  terminal-based
Dotfiles ikigai
dotfiles 🔥 includes scripts that makes my life easier!
Stars: ✭ 110 (-8.33%)
Mutual labels:  terminal-based
Wed
wed is a terminal text editor with key bindings commonly used in Windows based editors
Stars: ✭ 65 (-45.83%)
Mutual labels:  terminal-based
Rubiks cube
rubik's cube that runs in your terminal!
Stars: ✭ 73 (-39.17%)
Mutual labels:  terminal-based
Shellpic
ASCII-art is so 2013
Stars: ✭ 94 (-21.67%)
Mutual labels:  terminal-based
Spotify Tui
Spotify for the terminal written in Rust 🚀
Stars: ✭ 11,061 (+9117.5%)
Mutual labels:  terminal-based
Wikiman
Wikiman is an offline search engine for manual pages, Arch Wiki, Gentoo Wiki and other documentation.
Stars: ✭ 117 (-2.5%)
Mutual labels:  terminal-based
Cacher Cli
The command line interface to Cacher.
Stars: ✭ 85 (-29.17%)
Mutual labels:  terminal-based
Hugo Coder
A minimalist blog theme for hugo.
Stars: ✭ 1,374 (+1045%)
Mutual labels:  minimalist
Jekyll Minibundle
A minimalistic asset bundling plugin for Jekyll
Stars: ✭ 65 (-45.83%)
Mutual labels:  minimalist
Simplicity
A free, flexible, superfast and easily customizable Jekyll Theme with no Javascript but beautiful typography.
Stars: ✭ 67 (-44.17%)
Mutual labels:  minimalist
Thist
A go package for generating online histograms and plotting them in the terminal and PDFs
Stars: ✭ 96 (-20%)
Mutual labels:  terminal-based
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (+836.67%)
Mutual labels:  terminal-based
Cloak
A Command Line OTP Authenticator application.
Stars: ✭ 112 (-6.67%)
Mutual labels:  terminal-based
Blightmud
A terminal mud client written in Rust
Stars: ✭ 61 (-49.17%)
Mutual labels:  terminal-based
Mpvc
An mpc-like control interface for mpv.
Stars: ✭ 94 (-21.67%)
Mutual labels:  minimalist
Vifm
Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Stars: ✭ 1,822 (+1418.33%)
Mutual labels:  terminal-based
Oblate
Custom theme for my personal website and blog.
Stars: ✭ 117 (-2.5%)
Mutual labels:  minimalist
Milligram
A minimalist CSS framework.
Stars: ✭ 9,568 (+7873.33%)
Mutual labels:  minimalist

bashed-on-a-feeling

a minimalistic and moderately fast git prompt written in bash



inspiration from the terminalparty theme of OMZ and the need for a minimalistic "git" prompt for version control , were the main two forces that drove me to create this. Also this too "Ooga-chaka, ooga-ooga" ;)

a fully functional git repo - 17710 commits, on branch v4-dev, 1 unstaged, 6192 commits ahead, 333 behind and 1 untracked file

the normal prompt - prompt in non-git directories

what do those symbols mean?

  • master i: on branch master, in its "i"nitial stage , where no remote has been added yet
  • master 2↑ 1✚: on branch master, ahead of remote by 2 commits, 1 file changed but not staged
  • master 6?: on branch master, 6 files files untracked
  • master 2✖ 3✚: on branch master, 2 unstaged, 3 files modified
  • master ✓: on branch master, is clean
  • mine 2↓ 3↑: on branch mine; your branch is behind by 2 and ahead by 3 commits; the repository is otherwise clean
  • ~/bashed-on-a-feeling 39 ♥: the fire has been lit , the repo has a total of 39 commits
  • git: you're in git repository
  • : you're in git repository which has been diverged

installation

in the above examples I've made use of the Hasklug nerd font, a patched variant of Hasklig and Font Awesome fonts.
the user is required to install and use any of the nerd fonts and Font Awesome font, inorder to render those fancy symbols that i've used.
the simplest way to install the fonts on a Linux distro would be to :

  • choose any one of the nerd fonts and the full font awesome set from this link font awesome to use it
  • download and copy all the fonts files(.ttf/.otf) to ~/.fonts for current user or to /usr/share/fonts/[T/O]TF directory for all
  • run fc-cache -fv ~/.fonts or if the downloaded files are in /usr/local/share/fonts/ then fc-cache -fv to let freetype2 know of those fonts
  • you can confirm they are installed correctly by running fc-list | grep "your font name"

start installing

on your terminal:

	cd ~ && git clone https://github.com/yedhink/bashed-on-a-feeling.git
	cd ~/bashed-on-a-feeling
	./install.sh

then restart your terminal. BOOM!

customizing symbols

note that the editing , after installation, should be done on .bashed-gitprompt.sh file in your home(~) directory for the changes to take place
you can easily change any symbols used by the prompt. take a look to the file .bashed-gitprompt.sh . you will find a bunch of variables, each of them with its default value. the variable names were meant to be auto-explanatory. Something like

	: ${untracked_files:='?'}

you can change the symbols with your custom ones , just by editing the line(s) like above one and replacing current symbol with yours. say for common dejavu sans fonts you can use:

    : ${no_remote_added:='✘'}
    : ${commiticon:='♥'}
    : ${added_but_not_committed:='♡'}
    : ${committed_and_clean:='✔'}
    : ${ahead:='⬆'}
    : ${behind:='⬇'}
    : ${committed_but_modified_before_push:='✚'}
    : ${untracked_files:='⁇'}
    : ${gitprompt_normal:='☮'}
    : ${gitprompt_diverged:='☢'}

you can make use of gucharmap or https://char-map.herokuapp.com/ to check for glyphs support of the font of your choice.

normal prompt - when you're not in a git directory

the prompt works in a way that it shows a git prompt only when you're in a git repo , otherwise a normal prompt of your choice will be displayed. inorder to customize the normal prompt , edit the line export PS1= inside the function gitprompt() in your .bashrc after installation.

customizing colors

now it's possible to choose colors of your choice for both the normal and git prompts. your preferred colors can be set through the .bashrc file in your home directory.
editing should be done on these lines by referring to the available colors:

    # # # # # # # # # # # # # # # # # #
    # SET COLORS FOR THE PROMPT HERE  #
    # # # # # # # # # # # # # # # # # #

    # Edit Normal Prompt Colors Here
    normalHeart=$Red    # Color for the heart
    normalCDire=$Red    # Color for the current directory
    normalDolar=$Yellow # Color for primary prompt string $

    # Edit Git Prompt Colors Here
    gpDir=$Yellow # Color for current git directory
    gpBrn=$White  # Color for current git branch
    gpAMa=$Green  # Color for both total commits and check mark
    # this variable takes only background colors. so use colors like bgRed or bgBlue etc
    gpBck=$bgBlue # Background color for the box in which git or the diverged symbol is shown

say for example , if you want to change the color of the heart symbol in normal prompt to yellow and the git/diverged symbol background in git prompt to red color:

    normalHeart=$Yellow
    gpBck=$Red

the available color variables like Red,Yellow etc will be available in your .bashrc after installation. after changing the colors either source the file or restart your terminal emulator to see the changes

uninstall :(

  • just comment out PROMPT_COMMAND="gitprompt" in your .bashrc to disable this prompt
  • (optionally) remove the files .bashed-gitprompt.sh and .cal.sh from home
  • (optionally) also remove the lines of code under the heading bashed-on-a-feelingin your .bashrc
    i meant these lines :
	# # # # # # # # # # # #
	# bashed-on-a-feeling #
	# # # # # # # # # # # #

	# git prompt will be shown only when you move to a git dir
        gitprompt(){
            if `git status &> /dev/null`; then
                declare -i cno=0
                source ~/.bashed-gitprompt.sh
            else
                export PS1='\[$normalHeart\]♥ \[$normalCDire\]\W \[$Yellow\]\$\[\e[0m\] '
                gbranch=""
            fi
        }

	PROMPT_COMMAND="gitprompt"

contribute

although i made this for my personal use , i believe , others might find it useful and could get involved and contribute their ideas. i will happily take them into account!
you've to follow the Contribution Guidelines while you're at it though.

faq


why the colors in the above pics and the ones being displayed on my terminal are different?

A: it's because you/a program changed the color palette of your terminal to something different than the default one.
run this piece of code to check out your colorscheme :

 for fg_color in {0..7}; do
        set_foreground=$(tput setaf $fg_color)
        for bg_color in {0..7}; do
            set_background=$(tput setab $bg_color)
            echo -n $set_background$set_foreground
            printf ' F:%s B:%s ' $fg_color $bg_color
        done
        echo $(tput sgr0)
    done


why are the symbols rendered as empty boxes/not being displayed as it should be?

A: you need an unicode font (Font Awesome is a must and also a primary font for your terminal ,
like Awesome Terminal Fonts or nerd fonts like Hasklug for Linux or Sauce Code Pro, Menlo or Monaco on Mac OS X, or Monospace on Ubuntu etc) installed on your system for rendering the glyphs properly. refer to font installation on how to install the font.


license

"use this repo in the name of open source and freeeedoooom!!!"
refer to License for more details. :)

Liked it?

Hope you liked this project, don't forget to give it a star ⭐️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].