A light-hearted Powerline segment for fetching and showing the status
of the last build on travis. The segment will only be shown if the current directory contains a .travis.yml
file.
Keep in mind that powerline-travis-ci is in early, rapid development stage so its API/configuration format may change.
- Powerline
- A travis-ci.com API token
pip install powerline-travis-ci
The very minimum required to activate the segment is to add the following to your theme JSON:
{
"function": "powerline_travis_ci.latest_build_state",
"args": {
"token": API_TOKEN,
"username": TRAVIS_USERNAME
}
}
and the following to your colorscheme JSON (the colors can be customized):
"groups": {
"latest_travis_build_state": {
"fg": "gray9",
"bg": "gray2",
"attrs": []
}
}
The following optional args
are available:
Argument | Type | Description | Default |
---|---|---|---|
canceled_text |
string | Text or icon to show for the canceled state |
"Canceled" |
created_text |
string | Text or icon to show for the created state |
"Created" |
errored_text |
string | Text or icon to show for the errored state |
"Errored" |
failed_text |
string | Text or icon to show for the failed state |
"Failed" |
for_current_branch |
boolean | If true the state shown is the state of the latest build of the checked out git branch |
false |
git_path |
string | Only used if for_current_branch is true |
"git" |
passed_text |
string | Text or icon to show for the passed state |
"Passed" |
post_state_text |
string | Text or icon to append the state. If contains <travis_url> a clickable link to travis will be shown (if the supported by your terminal) |
"" |
pre_state_text |
string | Text or icon to prepend before the state. If contains <travis_url> a clickable link to travis will be shown (if the supported by your terminal) |
"" |
received_text |
string | Text or icon to show for the received state |
"Received" |
show_state_branch |
boolean | If true the name of the git branch will be shown along the state |
false |
started_text |
string | Text or icon to show for the started state |
"Started" |
In addition to the generic latest_travis_build_state
group, each state can be customized independently with highlight group latest_travis_build_state_{state}
.
For example,
"latest_travis_build_state_passed": {
"fg": "white",
"bg": "darkestgreen",
"attrs": []
}
If a specific state does not have a highlight group then the style of "latest_travis_build_state"
group will be used.
{
"function": "powerline_travis_ci.latest_build_state",
"args": {
"token": API_TOKEN,
"username": TRAVIS_USERNAME,
"passed_text": "✔",
"failed_text": "❌",
"pre_state_text": "Travis: "
}
}
"latest_travis_build_state": {
"fg": "white",
"bg": "gray2",
"attrs": []
},
"latest_travis_build_state_passed": {
"fg": "white",
"bg": "darkestgreen",
"attrs": []
},
"latest_travis_build_state_failed": {
"fg": "white",
"bg": "darkestred",
"attrs": []
}
Initial release