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

POWERLINE_THEME_OVERRIDES not working for powerline in BASH #2223

Open
jessebot opened this issue Dec 11, 2022 · 0 comments
Open

POWERLINE_THEME_OVERRIDES not working for powerline in BASH #2223

jessebot opened this issue Dec 11, 2022 · 0 comments

Comments

@jessebot
Copy link
Contributor

Thanks to everyone still working on this project. I use powerline everyday and I really love it 💙

The documentation for theme overrides located at configuration/local.html#environment-variables-overrides seems to be out of date:

POWERLINE_THEME_OVERRIDES

Overrides values from powerline/themes/ext/key.json. Top-level key is treated as a name of the theme for which overrides are used: e.g. to disable cwd segment defined in powerline/themes/shell/default.json one needs to use:

POWERLINE_THEME_OVERRIDES=default.segment_data.cwd.display=false

I want to submit a PR to fix it, but I can't seem to get it to work myself.

Here's a snippet of the top of my ~/.config/powerline/themes/shell/default.json:

{
    "segments": {
        "above": [{
                "left": [
                    {
                        "function": "powerline.segments.common.net.internal_ip",
                        "priority": 10
                    },
                    {
                        "function": "powerline.segments.common.net.hostname",
                        "priority": 20
                    },
                    {
                        "function": "powerline.segments.common.env.cwd",
                        "display": true,
                        "before": "",
                        "priority": 30,
                        "args": {
                            "use_shortened_path": true
                        }
                    }

This actually works fine, but I can't get override to work (using BASH), and I'm unsure how it can, given that there's no name for the block that actually contains the powerline.segments.common.env.cwd function.

Is there interest in transitioning to YAML by any of the maintainers? (I could help with that if you want help, btw, happy to throw in some effort :) ) I saw #2012 (comment) but I didn't see anything else related to it.

Either way, to be able to query parameters related to, for instance, cwd (current working directory) I think we'd need at least more structured json, like:

{
    "segments": {
        "above": [{
                "left": [
                    "internal_ip": {
                        "function": "powerline.segments.common.net.internal_ip",
                        "priority": 10
                    },
                    "hostname": {
                        "function": "powerline.segments.common.net.hostname",
                        "priority": 20
                    },
                    "cwd": {
                        "function": "powerline.segments.common.env.cwd",
                        "display": true,
                        "before": "",
                        "priority": 30,
                        "args": {
                            "use_shortened_path": true
                        }
                    }

Then I could see something like this working, to disable the cwd:

export POWERLINE_THEME_OVERRIDES="shell.default.segments.above.left.cwd.display=false"

Thanks in advance for your time, and any guidance you can provide.

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

No branches or pull requests

1 participant