Skip to content

Commit

Permalink
Add wireless signal strength data source
Browse files Browse the repository at this point in the history
Has backends for Linux and MacOS. Displays the signal strength if it
falls below the configured threshold.

Includes a new method to test getting data directly from files, so this
is fully unit tested.

Resolves #139
  • Loading branch information
Rycieos committed May 11, 2022
1 parent ec5fa5d commit 463d66b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/theme/included/powerline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,3 +544,11 @@ ______
:value: (33, 17, 0, 0, 5, 4)

Color for the current time section.

.. attribute:: POWERLINE_WIFI_STRENGTH_COLOR
:type: array<int>
:value: (-1, 148, 0, 0, -1, 3)

Color for the wireless signal strength section.

.. versionadded:: 2.1
8 changes: 8 additions & 0 deletions powerline.theme
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ _lp_powerline_full_theme_activate() {

POWERLINE_TIME_COLOR=( ${POWERLINE_TIME_COLOR[@]+"${POWERLINE_TIME_COLOR[@]}"} )
[[ ${#POWERLINE_TIME_COLOR[@]} == 0 ]] && POWERLINE_TIME_COLOR=(33 17 0 0 5 4)

POWERLINE_WIFI_STRENGTH_COLOR=( ${POWERLINE_WIFI_STRENGTH_COLOR[@]+"${POWERLINE_WIFI_STRENGTH_COLOR[@]}"} )
[[ ${#POWERLINE_WIFI_STRENGTH_COLOR[@]} == 0 ]] && POWERLINE_WIFI_STRENGTH_COLOR=(-1 148 0 0 -1 3)
}

_lp_powerline_full_theme_directory() {
Expand Down Expand Up @@ -234,6 +237,11 @@ _lp_powerline_full_theme_prompt() {
__powerline_formatted_section "$lp_temperature_color" "${POWERLINE_TEMPERATURE_COLOR[@]}"
fi

local lp_wifi_signal_strength_color
if _lp_wifi_signal_strength_color; then
__powerline_formatted_section "$lp_wifi_signal_strength_color" "${POWERLINE_WIFI_STRENGTH_COLOR[@]}"
fi

local lp_detached_sessions lp_running_jobs lp_stopped_jobs jobs_string=
if _lp_detached_sessions; then
jobs_string="${lp_detached_sessions}d"
Expand Down

0 comments on commit 463d66b

Please sign in to comment.