fix initial seeding of status config

This commit is contained in:
Dustin Kirkland 2011-08-15 16:02:17 -07:00
commit 2911e3c0f6
2 changed files with 6 additions and 3 deletions

1
debian/changelog vendored
View file

@ -36,6 +36,7 @@ byobu (4.30) unreleased; urgency=low
gathering method
* usr/bin/byobu-config:
- migrate to toggling on/off the list of status items
- fix initial seeding of status config
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500

View file

@ -334,15 +334,17 @@ def writestatus(items):
path = BYOBU_CONFIG_DIR+'/status'
for i in items:
status[i[1]] = i[0]
# SED is hacky here, but damn effective
# SED is hacky here, but effective
if BYOBU_BACKEND == "tmux":
for key in ["tmux_left", "tmux_right"]:
val = genstatusstring(key, status)
commands.getoutput("%s -i -e 's/^%s=.*$/%s=\"%s\"/' %s" % (SED, key, key, val, path))
commands.getoutput("%s -i -e '/^%s=/d' %s" % (SED, key, path))
commands.getoutput("echo '%s=\"%s\"' >> %s" % (key, val, path))
else:
for key in ["screen_upper_left", "screen_upper_right", "screen_lower_left", "screen_lower_right"]:
val = genstatusstring(key, status)
commands.getoutput("%s -i -e 's/^%s=.*$/%s=\"%s\"/' %s" % (SED, key, key, val, path))
commands.getoutput("%s -i -e '/^%s=/d' %s" % (SED, key, path))
commands.getoutput("echo '%s=\"%s\"' >> %s" % (key, val, path))
def togglestatus(snackScreen, size):
itemlist=readstatus()