powerline-go icon indicating copy to clipboard operation
powerline-go copied to clipboard

add shlvl module

Open elig0n opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. $SHLVL can be added via -shell-var but it ends up in bright yellow color and I would like to substract from it or only show it when it is larger than a number.

Describe the solution you'd like Let pass an int value for -shlvl similar to -jobs, preferably with minimum argument i.e. -shlvl-min and also allow setting the color for it or/and shell-var

elig0n avatar Feb 27 '21 08:02 elig0n

I'm toying around with this. https://github.com/buckley310/powerline-go/tree/shlvl Is there anyone with a use-case other than "display shlvl if greater than 0" ?

buckley310 avatar Oct 16 '21 03:10 buckley310

Here's my current config. It uses nf-dev-terminal_badge from nerdfonts as the icon. (my powerline fork is current) Any opinions or suggestions as to the icon/default color? I just got this set up on my machine and I'm going to use it for a bit and see how it feels and how useful it is.

image

buckley310 avatar Dec 07 '21 21:12 buckley310

Update: it's useful. The unicode characters tend to be a bit fiddly depending on the font/terminal, and getting powerline fonts to work in the first place is a bit of a hat trick. My current favorite icons are simply + and >. image

buckley310 avatar Dec 24 '21 01:12 buckley310

I was just googling to see if it was possible to do this.. so +1 for your efforts. :)

akdor1154 avatar Jan 17 '22 02:01 akdor1154

FWIW, you can recreate this behavior today using an external plugin. Adding the "shlvl" segment in powerline and then putting this bash script is in your PATH as powerline-go-shlvl

[ $SHLVL -lt 2 ] ||
    echo '[{"Foreground":231,"Background":55,"Content":"'$SHLVL'"}]'

buckley310 avatar Jun 15 '23 20:06 buckley310