diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml
index d5064fe..f3c107a 100644
--- a/.github/workflows/freebsd.yml
+++ b/.github/workflows/freebsd.yml
@@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Test in FreeBSD VM
- uses: vmactions/freebsd-vm@v0.1.5 # aka FreeBSD 13.0
+ uses: vmactions/freebsd-vm@v0.1.6 # aka FreeBSD 13.0
with:
mem: 2048
usesh: true
@@ -21,7 +21,7 @@ jobs:
pkg install -y git # subprojects/date
pkg install -y catch evdev-proto gtk-layer-shell gtkmm30 jsoncpp \
libdbusmenu libevdev libfmt libmpdclient libudev-devd meson \
- pkgconf pulseaudio scdoc sndio spdlog
+ pkgconf pulseaudio scdoc sndio spdlog wayland-protocols
run: |
meson build -Dman-pages=enabled
ninja -C build
diff --git a/Dockerfiles/alpine b/Dockerfiles/alpine
index c0e032f..03836aa 100644
--- a/Dockerfiles/alpine
+++ b/Dockerfiles/alpine
@@ -2,4 +2,4 @@
FROM alpine:latest
-RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc libxkbcommon
+RUN apk add --no-cache git meson alpine-sdk libinput-dev wayland-dev wayland-protocols mesa-dev libxkbcommon-dev eudev-dev pixman-dev gtkmm3-dev jsoncpp-dev pugixml-dev libnl3-dev pulseaudio-dev libmpdclient-dev sndio-dev scdoc libxkbcommon tzdata
diff --git a/README.md b/README.md
index 98b99a2..c5806e3 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
> Highly customizable Wayland bar for Sway and Wlroots based compositors.
> Available in Arch [community](https://www.archlinux.org/packages/community/x86_64/waybar/) or
-[AUR](https://aur.archlinux.org/packages/waybar-git/), [openSUSE](https://build.opensuse.org/package/show/X11:Wayland/waybar), and [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=waybar)
+[AUR](https://aur.archlinux.org/packages/waybar-git/), [Gentoo](https://packages.gentoo.org/packages/gui-apps/waybar), [openSUSE](https://build.opensuse.org/package/show/X11:Wayland/waybar), and [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=waybar)
> *Waybar [examples](https://github.com/Alexays/Waybar/wiki/Examples)*
#### Current features
@@ -69,6 +69,7 @@ libdbusmenu-gtk3 [Tray module]
libmpdclient [MPD module]
libsndio [sndio module]
libevdev [KeyboardState module]
+xkbregistry
```
**Build dependencies**
@@ -101,7 +102,8 @@ sudo apt install \
libsigc++-2.0-dev \
libspdlog-dev \
libwayland-dev \
- scdoc
+ scdoc \
+ libxkbregistry-dev
```
diff --git a/include/AIconLabel.hpp b/include/AIconLabel.hpp
new file mode 100644
index 0000000..3eac7dd
--- /dev/null
+++ b/include/AIconLabel.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include
+#include
+
+#include "ALabel.hpp"
+
+namespace waybar {
+
+class AIconLabel : public ALabel {
+ public:
+ AIconLabel(const Json::Value &config, const std::string &name, const std::string &id,
+ const std::string &format, uint16_t interval = 0, bool ellipsize = false,
+ bool enable_click = false, bool enable_scroll = false);
+ virtual ~AIconLabel() = default;
+ virtual auto update() -> void;
+
+ protected:
+ Gtk::Image image_;
+ Gtk::Box box_;
+
+ bool iconEnabled() const;
+};
+
+} // namespace waybar
diff --git a/include/bar.hpp b/include/bar.hpp
index 4aa17c1..01a9d03 100644
--- a/include/bar.hpp
+++ b/include/bar.hpp
@@ -112,14 +112,14 @@ class Bar {
Gtk::Box center_;
Gtk::Box right_;
Gtk::Box box_;
- std::vector> modules_left_;
- std::vector> modules_center_;
- std::vector> modules_right_;
+ std::vector> modules_left_;
+ std::vector> modules_center_;
+ std::vector> modules_right_;
#ifdef HAVE_SWAY
using BarIpcClient = modules::sway::BarIpcClient;
std::unique_ptr _ipc_client;
#endif
- std::vector> modules_all_;
+ std::vector> modules_all_;
};
} // namespace waybar
diff --git a/include/factory.hpp b/include/factory.hpp
index 43dd2cf..3855ce2 100644
--- a/include/factory.hpp
+++ b/include/factory.hpp
@@ -51,6 +51,9 @@
#ifdef HAVE_LIBSNDIO
#include "modules/sndio.hpp"
#endif
+#ifdef HAVE_GIO_UNIX
+#include "modules/inhibitor.hpp"
+#endif
#include "bar.hpp"
#include "modules/custom.hpp"
#include "modules/temperature.hpp"
diff --git a/include/modules/clock.hpp b/include/modules/clock.hpp
index 1f262e9..5a9c01e 100644
--- a/include/modules/clock.hpp
+++ b/include/modules/clock.hpp
@@ -1,21 +1,14 @@
#pragma once
-#include
-#if FMT_VERSION < 60000
-#include
-#else
-#include
-#endif
#include
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
-namespace waybar::modules {
+namespace waybar {
-struct waybar_time {
- std::locale locale;
- date::zoned_seconds ztime;
-};
+struct waybar_time;
+
+namespace modules {
const std::string kCalendarPlaceholder = "calendar";
const std::string KTimezonedTimeListPlaceholder = "timezoned_time_list";
@@ -46,4 +39,5 @@ class Clock : public ALabel {
auto timezones_text(std::chrono::_V2::system_clock::time_point *now) -> std::string;
};
-} // namespace waybar::modules
+} // namespace modules
+} // namespace waybar
diff --git a/include/modules/inhibitor.hpp b/include/modules/inhibitor.hpp
new file mode 100644
index 0000000..aa2f97d
--- /dev/null
+++ b/include/modules/inhibitor.hpp
@@ -0,0 +1,27 @@
+#pragma once
+
+#include
+
+#include
+
+#include "ALabel.hpp"
+#include "bar.hpp"
+
+namespace waybar::modules {
+
+class Inhibitor : public ALabel {
+ public:
+ Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
+ ~Inhibitor() override;
+ auto update() -> void;
+ auto activated() -> bool;
+
+ private:
+ auto handleToggle(::GdkEventButton* const& e) -> bool;
+
+ const std::unique_ptr<::GDBusConnection, void(*)(::GDBusConnection*)> dbus_;
+ const std::string inhibitors_;
+ int handle_ = -1;
+};
+
+} // namespace waybar::modules
diff --git a/include/modules/keyboard_state.hpp b/include/modules/keyboard_state.hpp
index 1793bfe..ed137c1 100644
--- a/include/modules/keyboard_state.hpp
+++ b/include/modules/keyboard_state.hpp
@@ -24,8 +24,6 @@ class KeyboardState : public AModule {
auto update() -> void;
private:
- static auto openDevice(const std::string&) -> std::pair;
-
Gtk::Box box_;
Gtk::Label numlock_label_;
Gtk::Label capslock_label_;
diff --git a/include/modules/network.hpp b/include/modules/network.hpp
index c91b598..7b8281b 100644
--- a/include/modules/network.hpp
+++ b/include/modules/network.hpp
@@ -73,7 +73,8 @@ class Network : public ALabel {
int cidr_;
int32_t signal_strength_dbm_;
uint8_t signal_strength_;
- uint32_t frequency_;
+ std::string signal_strength_app_;
+ float frequency_;
uint32_t route_priority;
util::SleeperThread thread_;
diff --git a/include/modules/sway/window.hpp b/include/modules/sway/window.hpp
index 0f7ae31..0ab129e67 100644
--- a/include/modules/sway/window.hpp
+++ b/include/modules/sway/window.hpp
@@ -2,7 +2,8 @@
#include
#include
-#include "ALabel.hpp"
+
+#include "AIconLabel.hpp"
#include "bar.hpp"
#include "client.hpp"
#include "modules/sway/ipc/client.hpp"
@@ -10,7 +11,7 @@
namespace waybar::modules::sway {
-class Window : public ALabel, public sigc::trackable {
+class Window : public AIconLabel, public sigc::trackable {
public:
Window(const std::string&, const waybar::Bar&, const Json::Value&);
~Window() = default;
@@ -23,6 +24,7 @@ class Window : public ALabel, public sigc::trackable {
std::string& output);
void getTree();
std::string rewriteTitle(const std::string& title);
+ void updateAppIcon();
const Bar& bar_;
std::string window_;
diff --git a/include/modules/wlr/taskbar.hpp b/include/modules/wlr/taskbar.hpp
index 3fe032f..973d15d 100644
--- a/include/modules/wlr/taskbar.hpp
+++ b/include/modules/wlr/taskbar.hpp
@@ -3,11 +3,13 @@
#include "AModule.hpp"
#include "bar.hpp"
#include "client.hpp"
+#include "giomm/desktopappinfo.h"
#include "util/json.hpp"
#include
#include
#include
+#include