audunmg / powerline-lua

Lua Powerline generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Powerline-lua

Incomplete port of the excellent https://github.com/justjanne/powerline-go

A goal is to have it working for (d)ash as well as bash to enjoy a nice prompt on those openWRT and alpine systems where a go binary is just too big.

Aiming for compatibility with powerline-go to keep things simple, and compatibility with lua 5.1 for openWRT.

Examples

busybox ash

Must be compiled with ASH_EXPAND_PRMT=y

Just add to .profile (or similar):

POWERLINE_LUA_PATH=/path/to/this/repo
# Add path to repo so lua require() finds it's way:
export LUA_PATH="$POWERLINE_LUA_PATH/?.lua;;"
PS1='$($POWERLINE_LUA_PATH/powerline.lua -e $?)'

bash

Bash supports extra stuff so it's possible to calculate the duration a command took, but it makes for a bit longer snippet to add to .bashrc, so it is added separately in ./bash/powerline-lua.sh

Just add to .bashrc:

POWERLINE_LUA_PATH=/path/to/this/repo
source "${POWERLINE_LUA_PATH}/bash/powerline-lua.sh"

License

GPLv3

About

Lua Powerline generator

License:GNU General Public License v3.0


Languages

Language:Lua 83.7%Language:Shell 16.3%