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:
David Grieser 2026-01-21 12:34:19 +01:00
parent 2975a89cbb
commit e4abf7bd64
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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'])