Fixes the following compiler warning/error:
In file included from /usr/include/stdio.h:906,
from ../tag.c:6:
In function ‘snprintf’,
inlined from ‘tags_expand_template’ at ../tag.c:708:13:
/usr/include/bits/stdio2.h:54:10: error: ‘fmt’ may be used uninitialized [-Werror=maybe-uninitialized]
54 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
../tag.c: In function ‘tags_expand_template’:
../tag.c:677:25: note: ‘fmt’ was declared here
677 | const char *fmt;
| ^~~
cc1: all warnings being treated as errors
Closes#311
We now do tilde expansion of the *first* argument in on-click
handlers.
That is:
~/bin/foobar.sh ~/arg1
is expanded to
$HOME/bin/foobar.sh ~/arg1
(meaning, the handler will most likely *not* do what you’d expect)
Related to #307
We may receive udev notifications for the power-supply subsystem, that
aren’t for us.
Before this patch, this would result in a new poll() call, with
timeout being set to m->poll_interval again. That is, the poll timeout
was being reset.
In theory, this means we could end up in a situation where the battery
status is never updated.
This patch fixes it by tracking how much time is left of the poll
interval. The interval is reset either when the timeout has occurred,
or when we receive an udev notification that _is_ for us.
Hopefully closes#305
The kernel also provides time_to_full, also in seconds, so let's use
that too. Both time_to_empty and time_to_full have 0 as their default
value, hence only consider them for the estimate if they are
positive (instead of non-negative).
Signed-off-by: David Bimmler <git@d4ve.email>
The kernel docs state that time_to_empty contains the estimation of
remaining time in seconds. Hence, calculate estimate minutes and hours
from that in a more correct way.
Signed-off-by: David Bimmler <git@d4ve.email>
When merging an anchor into a target yaml node, and both the target
node and the anchor defines the same key(s), keep the value from the
target node.
Closes#286
dwl added an "appid" field as output status [1]. We currently don't
handle this field, and thus output warnings that say "UNKNOWN action".
Handle the "appid" field correctly and expose a value of this field to
users. Also, suppress the warnings.
Link: 7f9a212476 [1]
Put the ‘description’ column last. Since the last column is expanded
to fill the screen, and the tags’ descriptions can be fairly long, it
makes sense to put the description column last.
bbd2394601 added support for ‘rename’
and ‘move’ events. In order to do that, it changed how workspace
events are matched against our internal workspace list: from string
comparing the workspace name, to checking i3/sway’s workspace ID
parameter.
This introduced a regression in our handling of persistent
workspaces. A persistent workspace is one that isn’t removed from the
bar when it’s deleted (empty, and switched away from) by i3/sway.
This concept doesn’t exist in i3/sway, but is something we’ve
added. Put simple, the way we do this is be keeping the workspace in
our list, even when i3/sway tells us it has been deleted.
However, at this point the workspace doesn’t have an ID anymore. And
the same is true at startup; when we initialize the persistent
workspaces, we only have their names. Not their IDs (since the
workspaces don’t actually exist yet).
To this the regression, we need to:
a) fallback to looking up workspaces by name. That is, if we fail to
find one with a matching ID, try again using the workspace name. For
_this_ to match, we also required the matched workspace to be a
persistent workspace, with an ID < 0 (which essentially means the
workspace doesn’t exist yet).
b) reset the ID to -1 when a persistent workspace is "deleted".
Closes#253
Uupdate the title when process a new batch of info instead of call
strtok_r and looping until `string` is NULL.
This fixes an issue where only the last part of the title was kept.