Skip to content

erfeatux/nerdline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nerdline

A simple powerline style prompt generator for Bash, written 100% in pure Bash. screenshot

✨ Features

nerdline provides a customizable prompt with multiple segments, inspired by powerline.
All segments are implemented in pure Bash — no external dependencies required.

Supported segments:

  • 🌀 git — branch name, files changed counter
  • 📜 hist — displays history writing state (for built-in histoff command)
  • 🖥 hostname — current hostname
  • ⚙️ jobs — background jobs counter
  • 📂 pwd — current working directory
  • 🐍 python — current venv or conda notifier
  • 🟥 retcode — last command exit code
  • 👤 user — current username

Supported modules:

Modules extend the functionality of nerdline.

  • 🔑 ssh — when connecting to a remote host via SSH, nerdline automatically deploys itself to that host and starts
  • 🔒 sudo — when running sudo su, nerdline is automatically launched for the elevated session

📦 Installation

Clone the repository:

git clone https://github.com/erfeatux/nerdline.git ~/.local/share/nerdline

Add to ~/.bash.rc

if [[ -z $__nerdline_pfx ]]
then
  ~/.local/share/nerdline/nerdline.sh test && source ~/.local/share/nerdline/nerdline.sh
fi

After install to run immediately

~/.local/share/nerdline/nerdline.sh test && source ~/.local/share/nerdline/nerdline.sh

🔧 Configuration

⚠️ Note: to properly display the special symbols from the default config, your terminal must use a font from Nerd Fonts.

The configuration file can be placed in one of the following locations (checked in order):

  • /etc/nerdline.cfg
  • $XDG_CONFIG_HOME/nerdline.cfg
  • ~/.config/nerdline.cfg

This file allows you to override default settings, customize segments, modules, colors, and symbols.

Example:

[nerdline]
segments=user hostname python hist git pwd jobs retcode
modules=ssh sudo
separator=''
separator_same_bg=''

[user]
color_fg=238:238:238
color_bg=1:1:1
color_root=#ff0000
color_user=#00f
sign_root='󰐣 '
sign_sudo='󰀅 '
sign_user='󰀄 '

[hostname]
color_bg=9:9:9
color_fg=0:255:0
color_sign=153:153:153
color_sign_ssh=0:255:0
# show ip on remote host
showip=false
# show hostname on localhost
showlocal=false
sign=''
sign_ssh='󱫋 '

[python]
color_bg=9:9:9
color_fg=0:255:0
color_sign=0:255:0
color_sign_conda=0:255:0
sign='󰌠 '
sign_conda='󱔎 '

[hist]
color_bg=9:9:9
color_fg=170:0:0
sign=󱙄

[git]
color_add=0:255:0
color_bg=9:9:9
color_fg=0:255:0
color_ignore=136:136:136
color_mod=255:170:0
color_rm=255:0:0
color_rn=0:0:255
color_sign=0:255:0
sign_add=

[pwd]
color_bg=9:9:9
color_fg=153:153:153
color_sign=238:238:238
home_sign=

[jobs]
color_bg=34:34:34
color_running=0:255:0
color_stopped=255:0:0
sign_running=󱑠
sign_stopped=󱤳

[retcode]
color_bg=34:34:34
color_err=170:0:0
color_fg=0:170:0
sign_err=󱎘
sign_ok=󰸞

⚠️ Note: use command nerdline update to reload config

About

Simple, lightweight, and functional powerline prompt for Bash written in pure Bash.

Topics

Resources

License

Stars

Watchers

Forks

Languages