mKaloer / powerline_mem_segment

Apache License 2.0
18 stars 7 forks source link

Won't render segment #12

Open wulftone opened 3 years ago

wulftone commented 3 years ago

I've dug for a while and cannot figure out why this isn't rendering. I would appreciate some troubleshooting help!

$ pip list | grep powerline
powerline-mem-segment      2.4

$ powerline-lint
# Completes successfully, no lint issues

$ cat ~/.config/powerline/colorschemes/tmux/{default.json,solarized.json}
{
        "groups": {
                "active_window_status": {"fg": "darkgreen",  "bg": "gray0",     "attrs": []},
                "window_status":        {"fg": "gray70",     "bg": "gray0",     "attrs": []},
                "activity_status":      {"fg": "yellow",     "bg": "gray0",     "attrs": []},
                "bell_status":          {"fg": "red",        "bg": "gray0",     "attrs": []},
                "window":               {"fg": "gray6",      "bg": "gray0",     "attrs": []},
                "window:divider":       {"fg": "gray4",      "bg": "gray0",     "attrs": []},
                "window:current":       {"fg": "gray2",      "bg": "darkgreen", "attrs": []},
                "window_name":          {"fg": "white",      "bg": "darkgreen", "attrs": ["bold"]},
                "session":              {"fg": "black",      "bg": "gray90",    "attrs": ["bold"]},
                "session:prefix":       {"fg": "gray90",     "bg": "darkblue",  "attrs": ["bold"]},
                "mem_usage":            {"fg": "gray8",      "bg": "gray0",     "attrs": [] },
                "mem_usage_gradient":   {"fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] }
        }
}
{
        "groups": {
                "active_window_status": { "fg": "solarized:blue",   "bg": "solarized:base02", "attrs": [] },
                "window_status":        { "fg": "solarized:base1",  "bg": "solarized:base02", "attrs": [] },
                "activity_status":      { "fg": "solarized:yellow", "bg": "solarized:base02", "attrs": [] },
                "bell_status":          { "fg": "solarized:red",    "bg": "solarized:base02", "attrs": [] },
                "window":               { "fg": "solarized:base1",  "bg": "solarized:base02", "attrs": [] },
                "window:divider":       { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": [] },
                "window:current":       { "fg": "solarized:base3",  "bg": "solarized:base01", "attrs": [] },
                "window_name":          { "fg": "solarized:base3",  "bg": "solarized:base01", "attrs": ["bold"] },
                "session":              { "fg": "solarized:base3",  "bg": "solarized:base01", "attrs": [] },
                "session:prefix":       { "fg": "solarized:base01", "bg": "solarized:base3",  "attrs": [] },
                "mem_usage":            { "fg": "gray8",            "bg": "gray0",            "attrs": [] },
                "mem_usage_gradient":   { "fg": "green_yellow_orange_red", "bg": "gray0",     "attrs": [] }
        }
}

$ cat ~/.config/powerline/themes/tmux/default.json
{
        "segments": {
                "right": [
                        {
                                "function": "powerline.segments.common.sys.uptime",
                                "priority": 50
                        },
                        {
                                "function": "powerlinemem.mem_usage.mem_usage",
                                "priority": 50,
                                "args": {
                                        "format": "Mem: %d%%"
                                }
                        },
                        {
                                "function": "powerline.segments.common.sys.system_load",
                                "priority": 50
                        },
                        {
                                "function": "powerline.segments.common.time.date"
                        },
                        {
                                "function": "powerline.segments.common.time.date",
                                "name": "time",
                                "args": {
                                        "format": "%H:%M",
                                        "istime": true
                                }
                        },
                        {
                                "function": "powerline.segments.common.net.hostname"
                        }
                ]
        }
}

I'm not sure what else to do! What am I missing?

mKaloer commented 3 years ago

Hi,

I think it's because the format argument only works for the powerlinemem.mem_usage.mem_usage_percent and not powerlinemem.mem_usage.mem. Since you want the percentage, you should be using mem_usage_percent.