Skip to content

Commit

Permalink
add dark_gray color, correct powerline issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpetretta committed Jun 2, 2024
1 parent 2a33251 commit de4b251
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions scripts/monokai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ main()
# Monokai Pro Color Pallette
white='#fcfcfa'
black='#2d2a2e'
dark_gray='#403e41'
gray='#727072'
red='#ff6188'
green='#a9dc76'
Expand Down Expand Up @@ -124,12 +125,12 @@ main()
tmux set-option -g message-style "bg=${gray},fg=${white}"

# status bar
tmux set-option -g status-style "bg=${gray},fg=${white}"
tmux set-option -g status-style "bg=${dark_gray},fg=${white}"

# Status left
if $show_powerline; then
tmux set-option -g status-left "#[fg=${green},bg=${black}]#{?client_prefix,#[fg=${magenta}],}#[bg=${green},fg=${black},bold]#{?client_prefix,#[bg=${magenta}],} ${left_icon} #[fg=${green},bg=${gray}]#{?client_prefix,#[fg=${magenta}],}${left_sep}"
powerbg=${gray}
tmux set-option -g status-left "#[fg=${green},bg=${black}]#{?client_prefix,#[fg=${magenta}],}#[bg=${green},fg=${black},bold]#{?client_prefix,#[bg=${magenta}],} ${left_icon} #[fg=${green},bg=${dark_gray}]#{?client_prefix,#[fg=${magenta}],}${left_sep}"
powerbg=${dark_gray}
else
tmux set-option -g status-left "#[bg=${green},fg=${black},bold]#{?client_prefix,#[bg=${magenta}],} ${left_icon} "
fi
Expand Down Expand Up @@ -208,7 +209,7 @@ main()
script="#($current_dir/network_bandwidth.sh)"

elif [ $plugin = "network-ping" ]; then
IFS=' ' read -r -a colors <<<$(get_tmux_option "@monokai-network-ping-colors" "gray white")
IFS=' ' read -r -a colors <<<$(get_tmux_option "@monokai-network-ping-colors" "dark_gray white")
script="#($current_dir/network_ping.sh)"

elif [ $plugin = "network-vpn" ]; then
Expand Down Expand Up @@ -248,7 +249,7 @@ main()
script="#($current_dir/weather_wrapper.sh $show_fahrenheit $show_location '$fixed_location')"

elif [ $plugin = "time" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@monokai-time-colors" "green white")
IFS=' ' read -r -a colors <<< $(get_tmux_option "@monokai-time-colors" "green black")
if [ -n "$time_format" ]; then
script=${time_format}
else
Expand Down Expand Up @@ -292,19 +293,19 @@ main()
done

if $show_powerline; then
tmux set-option -ga status-right "#[fg=${green},bg=${yellow}]${right_sep}#[bg=${green},fg=${black},bold] #h #[bg=${black},fg=${green}]"
tmux set-option -ga status-right "#[fg=${green},bg=${magenta}]${right_sep}#[bg=${green},fg=${black},bold] #h #[bg=${black},fg=${green}]"
else
tmux set-option -ga status-right "#[fg=${green},bg=${blue}]${right_sep}#[bg=${green},fg=${black},bold] #h "
fi

# Window option
if $show_powerline; then
tmux set-window-option -g window-status-current-format "#[bg=${white},fg=${gray}]${left_sep} #[fg=${black},bg=${white}]#I #W${current_flags} #[bg=${gray},fg=${white}]${left_sep}"
tmux set-window-option -g window-status-current-format "#[bg=${gray},fg=${dark_gray}]${left_sep} #[fg=${white},bg=${gray}]#I #W${current_flags} #[bg=${dark_gray},fg=${gray}]${left_sep}"
else
tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${white}] #I #W${current_flags} "
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${gray}] #I #W${current_flags} "
fi

tmux set-window-option -g window-status-format "#[bg=${gray},fg=${gray}]${left_sep} #[fg=${white},bg=${gray}]#I #W${flags} #[bg=${gray},fg=${gray}]${left_sep}"
tmux set-window-option -g window-status-format "#[bg=${dark_gray},fg=${dark_gray}]${left_sep} #[fg=${white},bg=${dark_gray}]#I #W${flags} #[bg=${dark_gray},fg=${dark_gray}]${left_sep}"
tmux set-window-option -g window-status-activity-style "bold"
tmux set-window-option -g window-status-bell-style "bold"
tmux set-window-option -g window-status-separator ""
Expand Down
2 changes: 1 addition & 1 deletion scripts/network_ping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ping_function() {
Linux | Darwin)
# storing the hostname/IP in the variable PINGSERVER, default is 1.1.1.1 (Cloudflare)
pingserver=$(get_tmux_option "@monokai-ping-server" "1.1.1.1")
pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{print $4}' | cut -d '/' -f 2 | cut -c1-2)
pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{print $4}' | cut -d '/' -f 2 | cut -c1-2 | sed 's/\.$//')
echo "$pingtime ms"
;;

Expand Down
2 changes: 1 addition & 1 deletion scripts/ram_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ get_ratio()
# System Profiler performs an activation lock check, which can result in
# time outs or a lagged response. (~10 seconds)
# total_mem=$(system_profiler SPHardwareDataType | grep "Memory:" | awk '{print $2 $3}')
total_mem=$(sysctl -n hw.memsize | awk '{print $0/1024/1024/1024 " GB"}')
total_mem=$(sysctl -n hw.memsize | awk '{print $0/1024/1024/1024 "GB"}')
if ((used_mem < 1024 )); then
echo "${used_mem}MB/$total_mem"
else
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ get_tmux_window_option() {
fi
}

# normalize the percentage string to always have a length of 5
# normalize the percentage string to always have a length of 4
normalize_percent_len() {
# the max length that the percent can reach, which happens for a two digit number with a decimal house: "99.9%"
max_len=5
max_len=4
percent_len=${#1}
let diff_len=$max_len-$percent_len
# if the diff_len is even, left will have 1 more space than right
Expand Down

0 comments on commit de4b251

Please sign in to comment.