Sway provides the workspace "num" property which is an integer number of
the workspace, i.e., workspace "3" -> 3 and also "3dev" -> "3". This
commit uses this property to sort the workspaces, which makes sense when
persistent workspaces or all-output is specified. This commit also adds
a new configuration option, whether the numeric workspaces come in front
or after workspaces that have non-numeric name.
All workspace buttons that are visible on the same output as the current waybar can be styled with the `current_output` css class.
This is really only useful in combination with the `"all-outputs":
true`. Then the workspaces that are on the current output can be styled
differently than the workspace on other outputs, while all are visible
in the waybar.
The approximation should include SReclaimable, and subtract Shmem. To
prevent the parsing code from ballooning in size, this commit also
refactors the parsing into a map.
If the bar is using initial size from the config (i.e both width and
height are set and resize is not required), GtkWindow configure event
is is not emitted. Initialize exclusive zone earlier for that case.
Fixes#609
When you have multiple sinks (resp. sources), the module used to display
the state of the most recently changed one. This changes remembers the
default sink name, and only records changes to that one.
Ipc destructor closes socket and thus wakes up SleeperThread which was
waiting for socket data in Ipc::handleEvent.
Ipc::handleEvent then proceeds with sending signal to already destroyed
object, causing heap-use-after-free Address Sanitizer error.
std::unique_ptr is not required here as the only benefit it gives is
stability of address on vector resize and it's easy to invalidate it
accidentaly. std::list provides the same guarantee of stable addresses
of the elements and correct destruction while avoiding smart pointer
overhead.
Also fixes#554, caused by incorrect usage of std::remove_if.
Fixes:
../src/modules/network.cpp:68:3: error: 'assert' was not declared in this scope
68 | assert(starts_with(read, category));
| ^~~~~~
../src/modules/network.cpp:6:1: note: 'assert' is defined in header '<cassert>'; did you forget to '#include <cassert>'?
5 | #include "util/format.hpp"
+++ |+#include <cassert>
6 |
To enable: use sway >= 1.2, compile waybar with `-Dgtk-layer-shell=enabled` meson option.
Original behavior could be restored at runtime by setting `"gtk-layer-shell": false` in waybar config.
gtk-layer-shell wants Gdk::Monitor instead of wl_output;
change code to deal with Gdk objects and slightly simplify it.
Requires gtkmm 3.22.0+ (first release with Gdk::Monitor support).
The fmt::format() function looks for the "{arg}" named argument
in the given "format" string which does not exist. It will fail
if the string contains any {...} curled-brace substring.
Consequently, any "on-click*" option's command line containing for
instance substring like "${var}" or "awk '{...}'" will crash the program.
Signed-off-by: Thomas Venriès <thomas.venries@gmail.com>
Fixes#479, because upstream does not intend to.
It may be less expensive to do that only once in a while, or to inotify-watch on /etc/timezone, but this is good enough.
Adds a `format-time` configuration for the battery module so that users
can configure how they want their remaining time to be displayed.
The default format remains the same as before, i.e. `{H} h {M} min`,
but users can choose something like `{H}:{M:02d}` to give an output
like `4:29` if wanted.