https://github.com/knrdl/poligo
PowerLine for Bash
https://github.com/knrdl/poligo
go golang powerline powerline-go powerline-shell
Last synced: 3 months ago
JSON representation
PowerLine for Bash
- Host: GitHub
- URL: https://github.com/knrdl/poligo
- Owner: knrdl
- License: mit
- Created: 2021-12-06T10:59:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-10-27T13:16:22.000Z (8 months ago)
- Last Synced: 2025-10-30T15:39:49.993Z (8 months ago)
- Topics: go, golang, powerline, powerline-go, powerline-shell
- Language: Go
- Homepage:
- Size: 161 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PoLiGo
## PowerLine Go
A beautiful and useful prompt generator for **bash** shell
This project is highly inspired by https://github.com/b-ryan/powerline-shell
## Setup
```bash
sudo apt install fonts-powerline
```
Download binary from [releases](https://github.com/knrdl/poligo/releases) and place it into `/usr/local/bin/poligo`
Add the following to `~/.bashrc`:
```bash
function enable_poligo() {
PS1="$(poligo --timeout=500ms cwd-exists warn-memory=75% term-title current-time go-version python-version nodejs-project docker-version kernel-version warn-offline shell-level virtual-env work-dir=4 sudo-root git read-only ssh-connection user-name=your_default_username exit-code=$?)"
}
function disable_poligo(){
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;34m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\$ '
PROMPT_COMMAND=""
}
PROMPT_COMMAND="enable_poligo"
```
Open a new terminal and enjoy!
## Configuration
```
$ poligo
Usage of poligo:
-timeout duration
total execution timeout (default 1s)
Segments:
cwd-exists: Check current working directory exists
warn-memory=N%: Warn if more than N% of memory/swap are used
term-title: Set terimal title
current-time: Display current time
go-version: Display installed go version, if any *.go files in current directory
python-version: Display installed python version, if any *.py files in current directory
nodejs-project: Display project title and version, if current directory contains package.json
docker-version: Display installed docker version, if current directory contains a Dockerfile
kernel-version: Display linux kernel version in /, /boot and /usr/src
warn-offline: Warn if no network connection available
shell-level: Display number of nested shells
virtual-env: Notify about activated python virtual environment
work-dir=N: Show current working directory, optional limit the output to N folders
sudo-root: Warn if current terminal has root permissions via sudo
git: Show git status, pushs, pulls, modified files and current branch
read-only: Warn if current directory is read only
ssh-connection: Warn if terminal is connected via ssh
user-name=DEFAULT: Show username except when it equals DEFAULT
exit-code=$?: Show if last command returned an error code (parameter must be $?)
```
## Screenshot
