Skip to content

Commit

Permalink
fixed up status toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
napalm255 committed Dec 14, 2014
1 parent bc25422 commit 84fbbe0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions powertmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ __powertmux_dir_home() {
}

__powertmux_settings() {
[ "$(tmux show-env POWERTMUX_THEME | sed 's:^.*=::')" == "" ] && tmux set-env "POWERTMUX_THEME" "default"
POWERTMUX_THEME=$(tmux show-env POWERTMUX_THEME | sed 's:^.*=::')

# read json using lib/jq
local jq=${POWERTMUX_DIR_LIB}/jq
local js=${POWERTMUX_DIR_THEMES}/${POWERTMUX_THEME}.json

tmux set-env "POWERTMUX_STATUS_LEFT" "$($jq ".left.display" $js)"
tmux set-env "POWERTMUX_STATUS_RIGHT" "$($jq ".right.display" $js)"
[ "$(tmux show-env POWERTMUX_THEME | sed 's:^.*=::')" == "" ] && tmux set-env "POWERTMUX_THEME" "default"
[ "$(tmux show-env POWERTMUX_STATUS_LEFT | sed 's:^.*=::')" == "" ] && tmux set-env "POWERTMUX_STATUS_LEFT" "$($jq ".left.display" $js)"
[ "$(tmux show-env POWERTMUX_STATUS_RIGHT | sed 's:^.*=::')" == "" ] && tmux set-env "POWERTMUX_STATUS_RIGHT" "$($jq ".right.display" $js)"

POWERTMUX_SEPARATOR_LEFT_BOLD=$($jq ".left.separators.bold" $js)
POWERTMUX_SEPARATOR_LEFT_THIN=$($jq ".left.separators.thin" $js)
POWERTMUX_SEPARATOR_RIGHT_BOLD=$($jq ".right.separators.bold" $js)
Expand Down

0 comments on commit 84fbbe0

Please sign in to comment.