powergoline

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 15 Imported by: 0

README

Powergoline

A lightweight status line for your terminal emulator. This project aims to be a lightweight alternative for powerline a popular statusline plugin for VIm that statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.

Installation

  1. Install a patched monospace font from here
  2. go get -u github.com/cixtor/powergoline
  3. Test using this command: command powergoline
  4. Add this function to your .bashrc configuration
function set_prompt_command() {
  RESULT=$(powergoline -theme="wildcherry" -status.code="$?")
  export PS1="$RESULT"
}
export PROMPT_COMMAND="set_prompt_command; $PROMPT_COMMAND"

powergoline

Configuration

Use powergoline -h to see all available options.

Update the set_prompt_command function to add or remove flags accordingly.

Select a predefined color scheme using the -theme flag and one of these values: agnoster, astrocom, bluescale, colorish, grayscale, wildcherry, or create your own by passing the corresponding -ABC.fg and -ABC.bg flags for the foreground and background colors, respectivevly.

Plugins

Add one or more -plugin="..." flags to set_prompt_command.

Each plugin must execute a command available in $PATH.

Background and foreground colors are automatically selected based on the surrouding prompt segments.

Report errors via /dev/stderr and stop the program with exit(1) in your corresponding language.

Performance

Average performance with the default features:

$ hyperfine --shell=none 'powergoline'
Benchmark 1: powergoline
  Time (mean ± σ):       4.3 ms ±   0.8 ms    [User: 1.4 ms, System: 1.3 ms]
  Range (min … max):     3.7 ms …  11.9 ms    597 runs

Average performance with the most basic features enabled:

$ hyperfine --shell=none 'powergoline ...'
Benchmark 1: powergoline -time.on -user.on -host.on -cwd.on -cwd.n=3 -status.code=0
  Time (mean ± σ):       4.3 ms ±   0.5 ms    [User: 1.5 ms, System: 1.3 ms]
  Range (min … max):     3.8 ms …   7.1 ms    545 runs

Average performance with the plugin system enabled:

$ hyperfine --shell=none 'powergoline ...'
Benchmark 1: powergoline -time.on -user.on -host.on -cwd.on -cwd.n=3 -plugin="echo hello" -status.code=0
  Time (mean ± σ):       6.8 ms ±   1.0 ms    [User: 2.4 ms, System: 3.1 ms]
  Range (min … max):     5.8 ms …  12.0 ms    261 runs

Average performance with the repository feature enabled:

$ hyperfine --shell=none 'powergoline ...'
Benchmark 1: powergoline -time.on -user.on -host.on -cwd.on -cwd.n=3 -repo.on -status.code=0
  Time (mean ± σ):      16.3 ms ±   2.3 ms    [User: 6.7 ms, System: 7.2 ms]
  Range (min … max):    12.9 ms …  28.1 ms    139 runs

Documentation

Overview

Powergoline

A lightweight status line for your terminal emulator. This project aims to be a lightweight alternative for powerline a popular statusline plugin for VIm that statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.

A status bar is a graphical control element which poses an information area typically found at the window's bottom. It can be divided into sections to group information. Its job is primarily to display information about the current state of its window, although some status bars have extra functionality.

A status bar can also be text-based, primarily in console-based applications, in which case it is usually the last row in an 80x25 text mode configuration, leaving the top 24 rows for application data. Usually the status bar (called a status line in this context) displays the current state of the application, as well as helpful keyboard shortcuts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL