Skip to content

Commit

Permalink
clean up show
Browse files Browse the repository at this point in the history
  • Loading branch information
napalm255 committed Dec 14, 2014
1 parent f43b30d commit bc25422
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions powertmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ powertmux() {
case "${3,,}" in
on|off) tmux set-env "POWERTMUX_STATUS_${2^^}" "$3" ;;
show)
local client_width=$(tmux list-clients -F '#{client_width}')
[ "$(tmux show-env POWERTMUX_STATUS_${2^^} | sed 's:^.*=::')" == "off" ] && return 0
[ "$(tmux list-clients -F '#{client_width}')" -lt 100 ] && [ "${2,,}" == "right" ] && return 0
[ "$(tmux list-clients -F '#{client_width}')" -lt 50 ] && return 0
[ "${client_width}" -lt 100 ] && [ "${2,,}" == "right" ] && return 0
[ "${client_width}" -lt 50 ] && return 0
__powertmux_settings
__powertmux_print "${2}"
;;
Expand Down

0 comments on commit bc25422

Please sign in to comment.