Commit graph

483 commits

Author SHA1 Message Date
haruInDisguise
c1ddafd34a module_mpris: fixed a crash on startup
Non existing clients are now handled correctly.
2025-03-20 00:16:58 +01:00
haruInDisguise
4ed93d9b68 module_mpris: Fixed property parsing on startup 2025-03-20 00:14:31 +01:00
haruInDisguise
39d37b38e6 Merge branch 'module_mpris_bugix' into module_mpris_client_sync_on_startup 2025-03-19 20:08:08 +01:00
haruInDisguise
1a51f383c8 module_mpris: Added client registration on startup
This PR allows us to register pre-existing clients and treat
them just like clients that are created after yambar/this module
launches.
By default, the last discovered client will be displayed.
2025-03-19 19:05:57 +01:00
haruInDisguise
ca0f565237 module_mpris: Refactoring + Fixed mutex usage
- Addressed inconsistens variable naming and removed redundant code.
- Mutex locks are now used correctly.
- The context struct now references the modules config, making config
  access less awkward
2025-03-18 13:56:08 +01:00
haruInDisguise
dfa0970b75 module_mpris: Fixed multi threading issues regarding 'identity_list'
This addresses changes requested by @dnkl
2025-03-10 13:36:25 +01:00
haruInDisguise
dcbb0f88ae module_mpris: Cleanup
Fixed inconsistent variable naming/debug logging
2025-03-10 11:34:29 +01:00
haruInDisguise
6a97b364a0 module_mpris: Fixed inconsistent string validation checks
This addresses changes requested by @mathstuf
2025-03-10 11:13:17 +01:00
haruInDisguise
0bcde5c453 module_mpris: Fixed memory leak
The identity list now uses tlllist and is deallocated properly
2025-03-10 01:36:26 +01:00
haruInDisguise
dcf936fd9b module_mpris: Fixed 'use after free' 2025-03-10 00:32:14 +01:00
haruInDisguise
e423776000 module_mpris: Added 'query-timeout' option
This enables us to configure the communication timeout
with the dbus daemon.
2025-03-09 23:02:59 +01:00
Daniel Eklöf
e68ed8d843
module: mpris: mark debug-only variables with attribute unused
Fixes release builds
2025-03-05 08:41:04 +01:00
haruInDisguise
c27de56bea
Added 'MPRIS' module
This commit adds the ability to display status information for MPRIS
compatible music players.

Closes #53
2025-03-05 08:37:02 +01:00
Nicholas Sudsgaard
b5450c3918
modules/i3: Add unused attribute to focused
This variable is only used in assert() which expands to nothing in
release builds. Adding the unused attribute prevents the compiler from
throwing an error (-Wunused-but-set-variable) when building.
2025-03-05 08:25:17 +01:00
Ralph Torres
21f374d2eb module/pipewire: add spacing config 2025-02-24 04:59:37 +00:00
vova
d746d12f6a
add niri-workspaces and niri-language modules 2025-01-01 13:51:25 +01:00
Ben Boeckel
61d082c802
typos: fix some typos 2025-01-01 13:49:32 +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
3e0083c9f2
module/removables: no need to open+fdopen, just do fopen() 2024-10-23 09:40:06 +02:00
Daniel Eklöf
a367895dc6
Open sockets, files etc with FD_CLOEXEC 2024-10-23 09:36:59 +02:00
Daniel Eklöf
b81e41c3c4
module/i3: add 'output' tag
This allows bars to render workspaces differently, depending on which
output the workspace is on:

    - map:
      default: ...
      conditions:
        output == DP-1:
          ...
2024-09-05 11:56:10 +02:00
Daniel Eklöf
54902f46ab
module: network: hardcode type to "wlan" when we see NL80211_CMD_NEW_INTERFACE
Wlan interfaces apparently report themselves as ARPHRD_ETHER in their
ifinfomsg struct (despite there being a ARPHRD_IEEE80211 type...).

"Fix" by hardcoding the type to "wlan" when we receive a
NL80211_CMD_NEW_INTERFACE message.
2024-08-20 07:40:08 +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
9cc5e0f7a7
module/network: plug memory leak
Free the 'ifaces' list, not just its contents.
2024-06-09 10:08:38 +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
QuincePie
a467f56677
i3: Handle FALLBACK output for workspaces.
sway moves the workspace to fallback_output when there is no output. For example: when all the screens are off. This commit adds an ignore for the fallback output.
2024-05-20 07:44:50 +02:00
Delgan
b3313cefc6 Fix remaining typos in the codebase (and update CI checks) 2024-05-02 16:28:51 +00:00
Birger Schacht
3a7455913f
fix: typo
Probaly -> Probably
2024-04-30 08:56:18 +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
Delgan
b85ba99980 Apply "clang-format" preferences globally 2024-04-07 10:05:10 +02:00
Delgan
da19c09122 Add missing "dynlist" dependency to network module 2024-04-01 08:53:50 +00:00
Sertonix
c44c66c83f
network: use dynlist instead of fixed name
Closes #271
Closes #265
Closes #71
2024-04-01 08:34:18 +02:00
Haden Collins
89ae7bd743
Handle reload workspace events from sway correctly
Closes #361
2024-03-14 16:14:53 -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
Delgan
e1f78a16ab
Add new "quality" tag to "network" module 2024-01-04 13:44:54 +01:00
Daniel Eklöf
9365580539
module: battery: style 2024-01-03 15:30:03 +01:00
Jordan Isaacs
a943def94e
battery scale and discharge smoothing 2024-01-03 15:22:12 +01: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
f948b9f8f9
module/battery: regression: allow poll-interval == 0
The regression was introduced after 1.9.0, hence no changelog entry.
2023-07-09 11:18:33 +02:00
Daniel Eklöf
6220a07aaf
module/battery: debug log when updating due to udev notification 2023-07-09 11:18:33 +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
tiosgz
5e3859f218 module/network: allow poll-interval == 0
Apparently the possibility to disable it was missed when the interval
was migrated to use milliseconds.
2023-04-08 20:06:07 +00: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