Commit graph

195 commits

Author SHA1 Message Date
vova
d746d12f6a
add niri-workspaces and niri-language modules 2025-01-01 13:51:25 +01:00
Ben Boeckel
57711f0dbe mpd: support the single flag
This flag indicates that `mpd` will automatically stop after the
current song is played.
2024-12-28 21:04:54 +01:00
Alexey Yerin
b15714b38a pipewire: Improve handling of node switching
When switching to a node that has a missing property, yambar didn't
reset its internal state to the default value, causing outdated
information to be displayed.
2024-11-27 00:03:12 +03:00
Daniel Eklöf
37ecc251a4
changelog: line-wrap 2024-10-02 08:10:30 +02:00
bagnaram
4826a52306
string like operation 2024-09-16 10:39:12 -05:00
Daniel Eklöf
0f47cbb889
changelog: i3/sway: output tag 2024-09-07 08:35:58 +02:00
Daniel Eklöf
060586dbbe
tag: remove the :b formatter
Superseded by /N. Removing since a) it's no longer needed, and b) its
name is not consistent with the other kb/mb/gb formatters.
2024-09-05 08:23:47 +02:00
Daniel Eklöf
c80bae7604
changelog: /N tag formatter 2024-09-05 08:20:59 +02:00
Daniel Eklöf
2d651d1c0e
changelog: bar position in multi-monitor setups, with location=bottom 2024-09-05 08:16:25 +02:00
Daniel Eklöf
700bf5b28c
tag: add 'b' formatter
Divides the tag's decimal value by 8.

Closes #392
2024-08-20 14:34:45 +02:00
Daniel Eklöf
699c563051
module: network: add 'kind' tag
The tag maps to the IFLA_INFO_KIND (part of the IFLA_LINKINFO)
netlink attribute.

This attribute is only available on virtual interfaces. Examples of
valid values are:

* bond
* bridge
* gre
* tun
* veth
2024-08-20 07:40:08 +02:00
Daniel Eklöf
a5ae61b5df
module: network: add 'type` tag
This tag maps to the ifinfomsg->ifi_type member, which is set to one
of the ARPHRD_xyz values, defined in linux/if_arp.h.

There's a *ton* of them, and we can't possibly add a string mapping
for _all_ of them, so for now, set to one of:

* loopback
* ether
* wlan
* ARPHRD_NNN, where N is a number
2024-08-20 07:39:59 +02:00
Daniel Eklöf
568eb1140f
modules/mpd: fix reconnect when we're not using inotify
When we're not able to use inotify, we rely on polling. However, we
never detected poll() timeouts, which meant we never re-attempted to
reconnect to MPD.

Maybe #394
2024-08-20 07:34:46 +02:00
Daniel Eklöf
1a323c6d21
log: respect the NO_COLOR environment variable
http://no-color.org/
2024-07-18 08:31:46 +02:00
Daniel Eklöf
739dc30323
changelog: env var substitution: fix issue reference
Reference the issue, not the PR.
2024-06-09 10:12:32 +02:00
Tomas Slusny
20659d3350 Add support for environment variable references
The format is
key: ${env_variable}

Closes #96

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-06-09 01:11:34 +02:00
Daniel Eklöf
0bea49b75e
module/river: return empty particle list when river is not running
Closes #384
2024-05-20 09:33:45 +02:00
Daniel Eklöf
b8a93a2673
changelog: i3/sway crash fix for output being turned on/off 2024-05-20 07:45:49 +02:00
Sertonix
547cef5afb network: fix missing break in switch statement
This can cause the first character of the string to be read as an iface state.

Fixes https://codeberg.org/dnkl/yambar/issues/377
2024-04-22 16:23:16 +02:00
Daniel Eklöf
6f3952819f
changelog: add new 'unreleased' section 2024-04-17 10:42:56 +02:00
Daniel Eklöf
cae07a36ff
changelog: prepare for 1.11.0 2024-04-17 10:30:29 +02:00
Daniel Eklöf
d841aeeecd
config: layer: add 'overlay' and 'background'
The layer option (Wayland only) now accepts 'overlay' and
'background'.

Closes #372
2024-04-06 15:39:19 +02:00
Daniel Eklöf
28a18ad91e
log: fix syslog not respecting the configured log level 2024-04-05 16:11:37 +02:00
Delgan
53dec73ed2
Fix miscalculation of list width in presence of empty particles 2024-04-01 09:10:58 +02:00
Sertonix
c44c66c83f
network: use dynlist instead of fixed name
Closes #271
Closes #265
Closes #71
2024-04-01 08:34:18 +02:00
Daniel Eklöf
4e07b63cef
plugin: workaround gcc bug that triggers a compilation error
GCC thinks str2type() returns NULL when it doesn't.

Closes #350
2024-03-18 16:47:37 +01:00
Haden Collins
7a5cf26fb5
Add changelog entry 2024-03-16 10:00:24 -05:00
Daniel Eklöf
f2d25c8341
script: fix buffer resize bug
If the amount of data coming in is more than we can hold in our
buffer, we resized the buffer by doubling its size. However, there
were two(!) issues here:

* If this was the first resize, the buffer size was set to 1024. This
  may not be enough (i.e. there may be more than 1024 bytes to process).
* In all other cases, the buffer size was doubled. However, there is
  still no guarantee the buffer is large enough.

Fix by looping until the buffer *is* large enough.
2024-02-05 12:52:40 +01:00
Delgan
aeeef4f236
Fix "mem" values updated while it should not
Closes #352
2024-02-05 12:49:26 +01:00
Delgan
195ac5d1cd
Fix incorrect empty/title state of i3 workspaces 2024-02-05 12:45:02 +01:00
Daniel Eklöf
bbbf2b601e
main: S_ISFIFO() matches both pipes and FIFOs 2024-01-04 16:35:05 +01:00
Daniel Eklöf
cb2561a72c
changelog: move 'reading config from pipe' from changed to added 2024-01-04 16:33:59 +01:00
steovd
8b1fa13686 main: allow reading alternative config from pipe 2024-01-04 15:13:49 +01:00
Delgan
e1f78a16ab
Add new "quality" tag to "network" module 2024-01-04 13:44:54 +01:00
Daniel Eklöf
cdee55afed
bar: wayland: update bar size + refresh in output_done()
This ensures the bar's size (width) is updated when the screen
resolution (and/or scale) is changed.

Note that we already handled scale changes. This logic has been moved
from output_scale() to output_done().

Closes #330
2024-01-03 15:39:04 +01:00
Daniel Eklöf
3a3a711b69
changelog: battery: smoothing + scaling 2024-01-03 15:29:06 +01:00
Sertonix
e54e8635e0
main: change default log level to warning 2024-01-03 15:20:31 +01:00
Daniel Eklöf
d5823bcc4c
changelog: fixed: crash when hidden by an opaque window 2024-01-03 15:15:20 +01:00
Daniel Eklöf
78f7b60e13
particle/map: non-greedy matching of quotes
Flex regexps are greedy.

This means '"foo" || "bar"' will return 'foo" || "bar', which is
obviously wrong.

Use "start conditions" to implement non-greedy matching.

Closes #302
2023-07-24 17:13:19 +02:00
Daniel Eklöf
42cef9373e
changelog: "‘fmt’ may be used uninitialized" compiler warning 2023-07-14 12:54:23 +02:00
Daniel Eklöf
5db61745a4
changelog: add new ‘unreleased’ section 2023-07-14 09:04:32 +02:00
Daniel Eklöf
1b23e72770
changelog: prepare for 1.10.0 2023-07-14 09:02:32 +02:00
Daniel Eklöf
5ac7d51e8a
changelog: minor formatting changes 2023-07-14 08:34:16 +02:00
Daniel Eklöf
8e4d7f04e4
module/script: path: expand ‘~’ to the user’s $HOME directory
Closes #307
2023-07-11 12:38:44 +02:00
Daniel Eklöf
d6e7710a7e
particle: on-click: tilde expansion
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
2023-07-11 10:31:40 +02:00
Daniel Eklöf
a342e036ad
module/battery: don’t reset poll timeout on irrelevant udev notifications
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
2023-07-09 11:18:30 +02:00
David Bimmler
b694fc1583 battery: also show time_to_full
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>
2023-07-07 17:32:41 +02:00
David Bimmler
08f5f444eb battery: correct time_to_empty calculation
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>
2023-07-07 17:32:41 +02:00
Daniel Eklöf
971361b046
yaml: keep original value when anchor and target node both defines the same key
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
2023-04-09 09:27:31 +02:00
Yutaro Ohno
963b9d47ee modules/dwl: handle the appid status
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]
2023-03-26 16:08:55 +09:00