Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/7ojo/perl6-powerline-prompt
Make a useful prompt for your shell
https://github.com/7ojo/perl6-powerline-prompt
bash-prompt bashrc perl6 powerline prompt shell
Last synced: about 2 months ago
JSON representation
Make a useful prompt for your shell
- Host: GitHub
- URL: https://github.com/7ojo/perl6-powerline-prompt
- Owner: 7ojo
- License: mit
- Archived: true
- Created: 2017-03-05T20:06:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-18T21:51:57.000Z (over 7 years ago)
- Last Synced: 2024-09-22T21:30:53.694Z (about 2 months ago)
- Topics: bash-prompt, bashrc, perl6, powerline, prompt, shell
- Language: Perl 6
- Size: 22.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Powerline::Prompt
[![Build Status](https://travis-ci.org/7ojo/perl6-powerline-prompt.svg?branch=master)](https://travis-ci.org/7ojo/perl6-powerline-prompt)Make a useful prompt for your shell.
![Screenshot](https://raw.githubusercontent.com/7ojo/perl6-powerline-prompt/master/examples/powerline-prompt.png)
# 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