mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
feat(git_stash): add configurable colors for stash segment
- Updated README to document `fg_color` and `bg_color` options for the `git_stash` segment. - Modified segment implementation to use these options, falling back to theme defaults when not provided.
This commit is contained in:
parent
2975a89cbb
commit
e4abf7bd64
|
|
@ -319,6 +319,11 @@ The options for the `time` segment are:
|
|||
|
||||
- `format`: Format string as used by strftime function, e.g. `%H:%M`.
|
||||
|
||||
The options for the `git_stash` segment are:
|
||||
|
||||
- `fg_color`: Override the foreground color for the stash segment.
|
||||
- `bg_color`: Override the background color for the stash segment.
|
||||
|
||||
### Contributing new types of segments
|
||||
|
||||
The `powerline_shell/segments` directory contains python scripts which are
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class Segment(ThreadedSegment):
|
|||
if not self.stash_count:
|
||||
return
|
||||
|
||||
bg = self.powerline.theme.GIT_STASH_BG
|
||||
fg = self.powerline.theme.GIT_STASH_FG
|
||||
bg = self.segment_def.get("bg_color", self.powerline.theme.GIT_STASH_BG)
|
||||
fg = self.segment_def.get("fg_color", self.powerline.theme.GIT_STASH_FG)
|
||||
|
||||
sc = self.stash_count if self.stash_count > 1 else ''
|
||||
stash_str = u' {}{} '.format(sc, RepoStats.symbols['stash'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue