src/modules/xbacklight.cpp
/**
   * Query the RandR extension for the new values
   */
Query the RandR extension for the new values
Query the RandR extension for the new values
void xbacklight_module::update() {
    auto& bl = m_output->backlight;
    randr_util::get_backlight_value(m_connection, m_output, bl);
    m_percentage = math_util::nearest_5(math_util::percentage<double>(bl.val, bl.min, bl.max));
    if (m_label) {
      m_label->reset_tokens();
      m_label->replace_token("%percentage%", to_string(m_percentage));
    }
    broadcast();
  }
void xbacklight_module :: update ( ) { auto & bl = m_output -> backlight ; randr_util :: get_backlight_value ( m_connection , m_output , bl ) ; m_percentage = math_util :: nearest_5 ( math_util :: percentage < double > ( bl . val , bl . min , bl . max ) ) ; if ( m_label ) { m_label -> reset_tokens ( ) ; m_label -> replace_token ( " " , to_string ( m_percentage ) ) ; } broadcast ( ) ; }
Query the RandR extension for the new values
Query the RandR extension for the new values
// Update label tokens // Emit a broadcast notification so that // the new data will be drawn to the bar