The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Conky output disappears from i3bar after extended use

asked 2013-05-12 19:24:49 +0000

whjms gravatar image

updated 2013-05-12 19:30:46 +0000

I am using i3 4.5.1, i3bar 4.5.1, and Conky 1.9.0. I am using the wrapper script method on the official site for displaying output from Conky in i3bar.

After a few minutes of use, i3bar will no longer display info from Conky. The bar becomes blank except for the desktop switcher and tray. Restarting i3 has the same result.

Here are my configuration files:

~/.i3/config

...
bar {
    status_command ~/sh/conky-i3.sh
}
...

~/sh/conky-i3.sh

#!/bin/bash 
echo '{"version":1}'
echo '['
echo '[],'
exec conky -c ~/.conkyrc

~/.conkyrc

out_to_x no
out_to_console yes
background no
max_text_width 0
update_interval 1
total_run_times 0
double_buffer yes

TEXT
[{"full_text" : "${mpd_artist} - ${mpd_album} - ${mpd_title}", "color" : "\#89cff0"},
 {"full_text" : "${mpd_elapsed}/${mpd_length}",                "color" : "\#ff8888"},
 {"full_text" : "${mpd_vol}%",                                 "color" : "\#eeeeee"},
 {"full_text" : "IP: ${addr eth0}",                            "color" : "\#99ff99"},
 {"full_text" : "RAM: ${mem}",                                 "color" : "\#aaaaff"},
 {"full_text" : "Load: ${loadavg 1}",                          "color" : "\#fff79a"},
 {"full_text" : "${tztime US/Eastern %a %b %d, %Y %X}",        "color" : "\#eeeeee"}],

Sample output from ~/sh/conky-i3.sh

{"version":1}
[
[],
[{"full_text" : "(null) - (null) - (null)",          "color" : "#89cff0"},
 {"full_text" : "0:00/0:00",                          "color" : "#ff8888"},
 {"full_text" : "0%",                                 "color" : "#eeeeee"},
 {"full_text" : "IP: 192.168.0.100",                  "color" : "#99ff99"},
 {"full_text" : "RAM: 521MiB",                        "color" : "#aaaaff"},
 {"full_text" : "Load: 0.70",                         "color" : "#fff79a"},
 {"full_text" : "Sun May 12, 2013 03:20:16 PM",       "color" : "#eeeeee"}],
[{"full_text" : "(null) - (null) - (null)",           "color" : "#89cff0"},
 {"full_text" : "0:00/0:00",                          "color" : "#ff8888"},
 {"full_text" : "0%",                                 "color" : "#eeeeee"},
 {"full_text" : "IP: 192.168.0.100",                  "color" : "#99ff99"},
 {"full_text" : "RAM: 521MiB",                        "color" : "#aaaaff"},
 {"full_text" : "Load: 0.70",                         "color" : "#fff79a"},
 {"full_text" : "Sun May 12, 2013 03:20:17 PM",       "color" : "#eeeeee"}],

Edit: I've found that just restarting i3 does not fix this problem, but exiting i3, stopping x, and starting a new x session fixes it.

edit retag flag offensive close merge delete

Comments

hrrmm... maybe weed out if this problem is a conky one or not. Maybe store the output of ~/sh/conky-i3.sh in different files (something like `while true; do conky-i3.sh \>"/tmp/$(date +'%T')"; sleep 3; done`) when starting i3. See if there is any invalid json there...

joepd gravatar imagejoepd ( 2013-05-14 22:51:23 +0000 )edit

Crap. \> should read: Bigger than >....

joepd gravatar imagejoepd ( 2013-05-14 22:52:29 +0000 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-05-24 19:07:31 +0000

Wesley gravatar image

updated 2013-05-24 19:10:37 +0000

I encountered this before, I found passing the -i 1 option to conky solved it for me at least. What that does is runs conky once, then quits.

That led to the unfortunate side effect that conky did not calculate cpu usage accurately (my suspicion is that conky uses it's own averaging). So I used a custom command to list top processes instead:

`ps -eo '%C%% %c' | sort -k1 -n -r | head -2 | tr '\n' ' '`

In the end I realized I did not need to use conky to get any of the info I wanted to display, they all live in a bash script now. Either way I do hope this helps you.

edit flag offensive delete link more
0

answered 2013-05-17 01:36:01 +0000

baumy gravatar image

I don't have a solution, but I do have a better workaround. I think this has something to do with multiple conky processes running. Run 'killall conky' to get rid of all of them, then reload your i3 config ($mod+shift+r by default), which should call the wrapper script again, and conky will output correctly.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-12 19:24:49 +0000

Seen: 740 times

Last updated: May 24 '13