mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge branch 'master' into tray-gdbus
This commit is contained in:
commit
0e6147b644
@ -35,9 +35,9 @@ gtkmm = dependency('gtkmm-3.0')
|
||||
dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4')
|
||||
jsoncpp = dependency('jsoncpp')
|
||||
sigcpp = dependency('sigc++-2.0')
|
||||
libnl = dependency('libnl-3.0', required: false)
|
||||
libnlgen = dependency('libnl-genl-3.0', required: false)
|
||||
libpulse = dependency('libpulse', required: false)
|
||||
libnl = dependency('libnl-3.0', required: get_option('libnl'))
|
||||
libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl'))
|
||||
libpulse = dependency('libpulse', required: get_option('pulseaudio'))
|
||||
|
||||
src_files = files(
|
||||
'src/factory.cpp',
|
||||
|
2
meson_options.txt
Normal file
2
meson_options.txt
Normal file
@ -0,0 +1,2 @@
|
||||
option('libnl', type: 'feature', value: 'auto', description: 'Enable libnl support for network related features')
|
||||
option('pulseaudio', type: 'feature', value: 'auto', description: 'Enable support for pulseaudio')
|
@ -22,6 +22,7 @@ waybar::Bar::Bar(const Client& client,
|
||||
window.set_title("waybar");
|
||||
window.set_decorated(false);
|
||||
window.set_name("waybar");
|
||||
window.set_resizable(false);
|
||||
setupConfig();
|
||||
setupCss();
|
||||
setupWidgets();
|
||||
|
@ -4,7 +4,7 @@ waybar::modules::Clock::Clock(const Json::Value& config)
|
||||
: ALabel(config, "{:%H:%M}")
|
||||
{
|
||||
label_.set_name("clock");
|
||||
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 60;
|
||||
uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 60;
|
||||
thread_ = [this, interval] {
|
||||
auto now = waybar::chrono::clock::now();
|
||||
dp.emit();
|
||||
|
@ -4,7 +4,7 @@ waybar::modules::Cpu::Cpu(const Json::Value& config)
|
||||
: ALabel(config, "{}%")
|
||||
{
|
||||
label_.set_name("cpu");
|
||||
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 10;
|
||||
uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 10;
|
||||
thread_ = [this, interval] {
|
||||
dp.emit();
|
||||
thread_.sleep_for(chrono::seconds(interval));
|
||||
|
@ -4,7 +4,7 @@ waybar::modules::Memory::Memory(const Json::Value& config)
|
||||
: ALabel(config, "{}%")
|
||||
{
|
||||
label_.set_name("memory");
|
||||
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 30;
|
||||
uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 30;
|
||||
thread_ = [this, interval] {
|
||||
dp.emit();
|
||||
thread_.sleep_for(chrono::seconds(interval));
|
||||
|
@ -82,7 +82,8 @@ auto waybar::modules::sway::Workspaces::update() -> void
|
||||
if (config_["format"]) {
|
||||
auto format = config_["format"].asString();
|
||||
button.set_label(fmt::format(format, fmt::arg("icon", icon),
|
||||
fmt::arg("name", node["name"].asString())));
|
||||
fmt::arg("name", node["name"].asString()),
|
||||
fmt::arg("index", node["num"].asString())));
|
||||
} else {
|
||||
button.set_label(icon);
|
||||
}
|
||||
@ -99,7 +100,8 @@ void waybar::modules::sway::Workspaces::addWorkspace(Json::Value node)
|
||||
auto icon = getIcon(node["name"].asString(), node);
|
||||
auto format = config_["format"]
|
||||
? fmt::format(config_["format"].asString(), fmt::arg("icon", icon),
|
||||
fmt::arg("name", node["name"].asString()))
|
||||
fmt::arg("name", node["name"].asString()),
|
||||
fmt::arg("index", node["num"].asString()))
|
||||
: icon;
|
||||
auto pair = buttons_.emplace(node["num"].asInt(), format);
|
||||
auto &button = pair.first->second;
|
||||
|
Loading…
Reference in New Issue
Block a user