You are not logged in.

#1 2014-03-06 09:56:26

KLIM
Member
Registered: 2010-11-18
Posts: 33

i3statusbar conky replaces json

Hi,

I got a pretty strange issue, which I can't find a solution for. I'm using conky in the i3statusbar, but somehow, some of the json in the conky file gets replaced by conky when it's run.

.conky-i3

out_to_x no
out_to_console yes
short_units yes
update_interval 1
max_text_width 0

TEXT
[\
#BTC:
{"full_text": "Now","color": "888888","separator": false,"separator_block_width": 6},{"full_text": "485.20","color": "EEEEEE","separator": false},{"full_text": "High","color": "888888","separator": false,"separator_block_width": 6},{"full_text": "490.00","color": "AAF096","separator": false},\

# Uptime:
{"full_text":"UPTIME","color":"\#888888","separator":false,"separator_block_width":6},\
{"full_text":"${uptime_short}","color":"\#EEEEEE","separator":false},\

#Battery:
{"full_text":"BATTERY","color":"\#888888","separator":false,
"separator_block_width":6},\
{"full_text":"${battery_percent}%","color":"\#EEEEEE","separator":false},\

# Memory:
{"full_text":"MEM","color":"\#888888","separator":false,"separator_block_width":6},\
{"full_text":"${if_match ${memperc}<30}${mem}/${memmax}","color":"\#AAF096","separator":false,"separator_block_width":6},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${memperc}<60}${mem}/${memmax}","color":"\#F0DC64","separator":false,"separator_block_width":6},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${memperc}<85}${mem}/${memmax}","color":"\#FF9933","separator":false,"separator_block_width":6},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${memperc}>=85}${mem}/${memmax}","color":"\#FF3333","separator":false,"separator_block_width":6},Ò\
{"full_text":"${endif}${endif}${endif}${endif}"},\

# CPU:
{"full_text":"CPU","color":"\#888888","separator":false,"separator_block_width":6},\
{"full_text":"${if_match ${cpu cpu0}<25}${cpu cpu0}","color":"\#AAF096","separator":false,"separator_block_width":0},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${cpu cpu0}<50}${cpu cpu0}","color":"\#F0DC64","separator":false,"separator_block_width":0},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${cpu cpu0}<75}${cpu cpu0}","color":"\#FF9933","separator":false,"separator_block_width":0},\
{"full_text":"${else}"},\
{"full_text":"${if_match ${cpu cpu0}<=100}${cpu cpu0}","color":"\#FF3333","separator":false,"separator_block_width":0},\
{"full_text":"${endif}${endif}${endif}${endif}"},\
{"full_text":"%","color":"\#EEEEEE","separator":false,"separator_block_width":6},\

# Date:
{"full_text":"DATE","color":"\#888888","separator":false,"separator_block_width":6},\
{"full_text":"${time %a %d-%m-%Y}","color":"\#EEEEEE","separator":false,"separator_block_width":6},\

# Time:
{"full_text":"TIME","color":"\#888888","separator":false,"separator_block_width":6},\
{"full_text":"${time %R}","color":"\#EEEEEE","separator":false}\
],

I'm using a wrapper script which is executed from the i3config

#!/bin/sh

# Send the header so that i3bar knows we want to use JSON:
echo '{"version":1}'

# Begin the endless array.
echo '['

# We send an empty first array of blocks to make the loop simpler:
echo '[],'

# Now send blocks with information forever:
exec conky -c $HOME/.conky-i3

The output from running the script:

{"version":1}
[
    [],
    [
        {
            "full_text": "Now",
            "color": "888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "485.20",
            "color": "EEEEEE",
            "separator": false
        },
        {
            "full_text": "High",
            "color": "888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "490.00",
            18m 18s
            "color": "#EEEEEE",
            "separator": false
        },
        {
            "full_text": "BATTERY",
            "color": "#888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "100%",
            "color": "#EEEEEE",
            "separator": false
        },
        {
            "full_text": "MEM",
            "color": "#888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "620M/3.86G",
            "color": "#AAF096",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": ""
        },
        {
            "full_text": "CPU",
            "color": "#888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "7",
            "color": "#AAF096",
            "separator": false,
            "separator_block_width": 0
        },
        {
            "full_text": ""
        },
        {
            "full_text": "%",
            "color": "#EEEEEE",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "DATE",
            "color": "#888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "Thu06-03-2014",
            "color": "#EEEEEE",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "TIME",
            "color": "#888888",
            "separator": false,
            "separator_block_width": 6
        },
        {
            "full_text": "10: 44",
            "color": "#EEEEEE",
            "separator": false
        }
    ]
],

As you can see in the output above, Conky have inserted the uptime inside another json string
{"full_text": "490.00",18m 18s","color":"#EEEEEE","separator":false}

How can this be?

Offline

Board footer

Powered by FluxBB