Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

7ojo/perl6-powerline-prompt

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
t
 
 
 
 
 
 
 
 
 
 
 
 

Powerline::Prompt

Build Status

Make a useful prompt for your shell.

Screenshot

SYNOPSIS

examples/powerline-prompt.p6

#!/usr/bin/env perl6

use v6;
use Powerline::Prompt::Shell::Bash;

print Powerline::Prompt::Shell::Bash.new.draw;

SETUP

Bash

Daemon example

This is for faster setup

~/.bashrc

TEMP=$(tty)
POWERLINE_PORT=$((3333 + ${TEMP:9}))

perl6 examples/powerline-daemon.p6 --port=${POWERLINE_PORT} &

sleep 0.2 # wait for daemon to start

function _update_ps1() {
    local EXIT="$?"
    PS1="$(exec 5<>/dev/tcp/localhost/${POWERLINE_PORT} ; echo ${PWD} ${EXIT} >&5 ; cat <&5)"
}
if [ "$TERM" != "linux" ]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

Basic example

~/.bashrc

function _update_ps1() {
    PS1="$(examples/powerline-prompt.p6 $? 2> /dev/null)"
}

if [ "$TERM" != "linux" ]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

About

Make a useful prompt for your shell

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%