Merge pull request #241 from TheEdgeOfRage/master

[modules/traffic] Add parameter to hide down networks
This commit is contained in:
tobi-wan-kenobi 2018-04-02 12:57:45 +02:00 committed by GitHub
commit 397fbef24f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -180,7 +180,7 @@ Here are some screenshots for all themes that currently exist:
:exclamation: Some themes (all 'Powerline' themes) require [Font Awesome](http://fontawesome.io/) and a powerline-compatible font ([powerline-fonts](https://github.com/powerline/fonts), for example) to display all icons correctly. :exclamation: Some themes (all 'Powerline' themes) require [Font Awesome](http://fontawesome.io/) and a powerline-compatible font ([powerline-fonts](https://github.com/powerline/fonts), for example) to display all icons correctly.
Gruvbox Powerline (`-t gruvbox-powerline`) (contributed by [@paxy97](https://github.com/paxy97)): Gruvbox Powerline (`-t gruvbox-powerline`) (contributed by [@TheEdgeOfRage](https://github.com/TheEdgeOfRage)):
![Gruvbox Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/powerline-gruvbox.png) ![Gruvbox Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/powerline-gruvbox.png)

View file

@ -76,6 +76,8 @@ class Module(bumblebee.engine.Module):
state = "down" state = "down"
if len(self.get_addresses(interface)) > 0: if len(self.get_addresses(interface)) > 0:
state = "up" state = "up"
elif bumblebee.util.asbool(self.parameter("hide_down", True)):
continue
if len(self._states["exclude"]) > 0 and state in self._states["exclude"]: continue if len(self._states["exclude"]) > 0 and state in self._states["exclude"]: continue
if len(self._states["include"]) > 0 and state not in self._states["include"]: continue if len(self._states["include"]) > 0 and state not in self._states["include"]: continue