From 73553802f943a99b62c6c38dc30e7cf2d1377960 Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Sun, 21 Oct 2018 09:58:35 +0000 Subject: [PATCH 1/5] Add options for pulseaudio and libnl --- meson.build | 6 +++--- meson_options.txt | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index 1833440..986b423 100644 --- a/meson.build +++ b/meson.build @@ -34,9 +34,9 @@ wlroots = dependency('wlroots', fallback: ['wlroots', 'wlroots']) gtkmm = dependency('gtkmm-3.0') 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', diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..2d49311 --- /dev/null +++ b/meson_options.txt @@ -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') From 5a6e05dcdec47536e212265cc405d7d450aa6bf9 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 22 Oct 2018 10:41:52 +0200 Subject: [PATCH 2/5] feat: workspaces index --- src/modules/sway/workspaces.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 3e74801..37d7022 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -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); } From 137c5fb712bfdb91d3a43328dfee4ed8c56d6ee7 Mon Sep 17 00:00:00 2001 From: dangerousdan Date: Tue, 23 Oct 2018 00:06:46 +0100 Subject: [PATCH 3/5] fix custom intervals causing cpu to go mental --- src/modules/clock.cpp | 2 +- src/modules/cpu.cpp | 2 +- src/modules/memory.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 3fa6feb..154041a 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -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(); diff --git a/src/modules/cpu.cpp b/src/modules/cpu.cpp index 6f826e3..3aa1fd5 100644 --- a/src/modules/cpu.cpp +++ b/src/modules/cpu.cpp @@ -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)); diff --git a/src/modules/memory.cpp b/src/modules/memory.cpp index 4c09bdf..630e642 100644 --- a/src/modules/memory.cpp +++ b/src/modules/memory.cpp @@ -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)); From c912d8c86a8a691eb3b76b807fc1446532d50b68 Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 25 Oct 2018 10:22:11 +0200 Subject: [PATCH 4/5] fix(workspaces): index --- src/modules/sway/workspaces.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sway/workspaces.cpp b/src/modules/sway/workspaces.cpp index 37d7022..08bfb1e 100644 --- a/src/modules/sway/workspaces.cpp +++ b/src/modules/sway/workspaces.cpp @@ -100,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; From 45847847b975594dd3cb519b3c83c9e31685dc1a Mon Sep 17 00:00:00 2001 From: Alexis Date: Thu, 25 Oct 2018 10:43:37 +0200 Subject: [PATCH 5/5] style: disallow resize --- src/bar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bar.cpp b/src/bar.cpp index 750816c..8e927c4 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -21,6 +21,7 @@ waybar::Bar::Bar(const Client& client, zxdg_output_v1_add_listener(xdg_output_, &xdgOutputListener, this); window.set_title("waybar"); window.set_decorated(false); + window.set_resizable(false); setupConfig(); setupCss(); setupWidgets();