Wish list item: A segment for `powerline-go` (<htt...
# general
s
Wish list item: A segment for
powerline-go
(https://github.com/justjanne/powerline-go/) that shows the currently selected Pulumi stack in my Powerline prompt. ๐Ÿ™‚
๐Ÿ‘ 1
g
I like that ideaโ€ฆ so I just created one ๐Ÿ˜‚ you can add this snippet to your .zshrc
Copy code
POWERLEVEL9K_CUSTOM_PULUMI_STACK="zsh_pulumi_stack"
POWERLEVEL9K_CUSTOM_PULUMI_STACK_BACKGROUND="blue"
POWERLEVEL9K_CUSTOM_PULUMI_STACK_FOREGROUND="black"

zsh_pulumi_stack(){
  if test -f "Pulumi.yaml"; then
    local stackname=$(pulumi stack | grep "Current stack is" | sed 's/://g' | sed 's/Current stack is//g')
    echo -n "%F{black}Stack: $stackname"
  fi
}
You can add it to your prompt elements with
custom_pulumi_stack
s
Neat! Unfortunately, I don't use
zsh
. ๐Ÿ™‚
g
darn ๐Ÿ˜‚
which one do you use?
s
I'm a
bash
guy.
g
Ok, coolโ€ฆ not making any promises but Iโ€™ll look at it ๐Ÿ™‚
s
Before you do that...
powerline-go
is actually written in Go, so maybe don't bother with Bash? ๐Ÿ™‚
g
That should workโ€ฆ I do like Go ๐Ÿ˜‡
s
So I've heard ๐Ÿ˜„
g
I just realized we actually work at the same company ๐Ÿ˜‚
s
LOL, I'd never bothered to look "behind" the username. How funny! ๐Ÿ‘‹๐Ÿป
๐Ÿ‘‹ 1
b
I was going to make a zsh plugin
looks like someone got ahead of me!
s
Indeed ๐Ÿ™‚