Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add shlvl module #290

Open
elig0n opened this issue Feb 27, 2021 · 5 comments
Open

add shlvl module #290

elig0n opened this issue Feb 27, 2021 · 5 comments

Comments

@elig0n
Copy link
Contributor

elig0n commented Feb 27, 2021

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

@buckley310
Copy link
Contributor

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
Copy link
Contributor

buckley310 commented Dec 7, 2021

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
Copy link
Contributor

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

@akdor1154
Copy link

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

@buckley310
Copy link
Contributor

buckley310 commented Jun 15, 2023

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'"}]'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants