add manpage
This commit is contained in:
@ -20,7 +20,7 @@ namespace {
|
||||
|
||||
|
||||
waybar::modules::Gps::Gps(const std::string& id, const Json::Value& config)
|
||||
: ALabel(config, "gps", id, "{}", 1) {
|
||||
: ALabel(config, "gps", id, "{}", 5) {
|
||||
thread_ = [this] {
|
||||
dp.emit();
|
||||
thread_.sleep_for(interval_);
|
||||
@ -30,6 +30,14 @@ waybar::modules::Gps::Gps(const std::string& id, const Json::Value& config)
|
||||
throw std::runtime_error("Can't open gpsd socket");
|
||||
}
|
||||
|
||||
if (config_["hide-disconnected"].isBool()) {
|
||||
hideDisconnected = config_["hide-disconnected"].asBool();
|
||||
}
|
||||
|
||||
if (config_["hide-no-fix"].isBool()) {
|
||||
hideNoFix = config_["hide-no-fix"].asBool();
|
||||
}
|
||||
|
||||
gps_stream(&gps_data_, WATCH_ENABLE, NULL);
|
||||
}
|
||||
|
||||
@ -89,6 +97,14 @@ auto waybar::modules::Gps::update() -> void {
|
||||
throw std::runtime_error("Can't read data from gpsd.");
|
||||
}
|
||||
|
||||
if ((gps_data_.fix.mode == MODE_NOT_SEEN && hideDisconnected) || (gps_data_.fix.mode == MODE_NO_FIX && hideNoFix)) {
|
||||
event_box_.set_visible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Show the module
|
||||
if (!event_box_.get_visible()) event_box_.set_visible(true);
|
||||
|
||||
std::string tooltip_format;
|
||||
|
||||
if (!alt_) {
|
||||
|
Reference in New Issue
Block a user