Skip to content

Commit

Permalink
changed some naming, and commented out some unused code - maybe later?
Browse files Browse the repository at this point in the history
  • Loading branch information
napalm255 committed Dec 12, 2014
1 parent 50ae263 commit 4e8a572
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions powertmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ __powertmux_colors() {
powertmux_plugin[4]=${previous_background_color:-$POWERTMUX_DEFAULT_BACKGROUND_COLOR}
fi

if __plugin_separator_is_thin; then
if __powertmux_plugin_separator_is_thin; then
powertmux_plugin[5]=${powertmux_plugin[2]}
else
powertmux_plugin[5]=${powertmux_plugin[1]}
Expand All @@ -137,17 +137,17 @@ __powertmux_process() {
local separator_background_color=${powertmux_plugin[4]}
local separator_foreground_color=${powertmux_plugin[5]}

eval "__print_plugin ${side} ${plugin_index} ${background_color} ${foreground_color} ${separator} ${separator_background_color} ${separator_foreground_color}"
eval "__powertmux_print_plugin ${side} ${plugin_index} ${background_color} ${foreground_color} ${separator} ${separator_background_color} ${separator_foreground_color}"
done
}

__print_colored_content() {
__powertmux_print_colored_content() {
echo -n "#[fg=colour$3, bg=colour$2]"
echo -n "$1"
echo -n "#[default]"
}

__print_plugin() {
__powertmux_print_plugin() {
local side=$1
local content=${powertmux_plugin_contents[$2]}
local content_background_color=$3
Expand All @@ -158,17 +158,17 @@ __print_plugin() {

case "${side}" in
left)
__print_colored_content "$content" $content_background_color $content_foreground_color
__print_colored_content $separator $separator_background_color $separator_foreground_color
__powertmux_print_colored_content "$content" $content_background_color $content_foreground_color
__powertmux_print_colored_content $separator $separator_background_color $separator_foreground_color
;;
right)
__print_colored_content $separator $separator_background_color $separator_foreground_color
__print_colored_content "$content" $content_background_color $content_foreground_color
__powertmux_print_colored_content $separator $separator_background_color $separator_foreground_color
__powertmux_print_colored_content "$content" $content_background_color $content_foreground_color
;;
esac
}

__plugin_separator_is_thin() {
__powertmux_plugin_separator_is_thin() {
[[ ${powertmux_plugin[3]} == $POWERTMUX_SEPARATOR_LEFT_THIN || \
${powertmux_plugin[3]} == $POWERTMUX_SEPARATOR_RIGHT_THIN ]];
}
Expand Down Expand Up @@ -238,17 +238,17 @@ roll_text() {
}

# Get the current path in the plugin.
get_tmux_cwd() {
local env_name=$(tmux display -p "TMUXPWD_#D" | tr -d %)
local env_val=$(tmux show-environment | grep --color=never "$env_name")
# The version below is still quite new for tmux. Uncomment this in the future :-)
#local env_val=$(tmux show-environment "$env_name" 2>&1)

if [[ ! $env_val =~ "unknown variable" ]]; then
local tmux_pwd=$(echo "$env_val" | sed 's/^.*=//')
echo "$tmux_pwd"
fi
}
#get_tmux_cwd() {
# local env_name=$(tmux display -p "TMUXPWD_#D" | tr -d %)
# local env_val=$(tmux show-environment | grep --color=never "$env_name")
# # The version below is still quite new for tmux. Uncomment this in the future :-)
# #local env_val=$(tmux show-environment "$env_name" 2>&1)
#
# if [[ ! $env_val =~ "unknown variable" ]]; then
# local tmux_pwd=$(echo "$env_val" | sed 's/^.*=//')
# echo "$tmux_pwd"
# fi
#}

__powertmux_display $@

Expand Down

0 comments on commit 4e8a572

Please sign in to comment.