Commit graph

484 commits

Author SHA1 Message Date
haruInDisguise
6fea536354 Merge remote-tracking branch 'origin/master' into module_mpris 2025-01-25 21:09:41 +01: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
haruInDisguise
c79d8da397 Merge branch 'module_mpris' of https://codeberg.org/haruInDisguise/yambar into module_mpris 2024-11-18 15:28:43 +01:00
haruInDisguise
0d7a05af55 Applied suggestions by 'nemo' and drop 'basu' subproject 2024-11-17 23:28:31 +01: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
haruInDisguise
d6067f6057 module/mpris: Updated manpage and fixed a typo 2024-09-18 15:54:14 +02:00
haruInDisguise
b55d5a6739 modules/mpris: Moved code over to 'sd-bus'
- Ported d-bus specific code from 'libdbus' to 'sd-bus'
- 'sd_bus' has been added to mesons dependencies. If systemd (>=221) is
  not installed, we fall back to [basu](https://git.sr.ht/~emersion/basu)
  v2.1
- Fixed a memory leak upon metadata change
2024-09-18 14:55:31 +02:00
haruInDisguise
8415d40988 modules/mpris: Fixed progress bar not dispalying progress 2024-09-12 17:52:51 +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
haruInDisguise
5636977a52 modules/mpris: Added support for multiple clients
This module now supports multiple MPRIS clients and displays the
status fo the most recently active one.
I've also removed any atempts at supporting incomplete/incorrect MPRIS
implementations. The entire update cycle is now completely event
based.
This also means that MPRIS clients must start up after yambar to be
recognized.
2024-09-02 15:52:27 +02:00
haruInDisguise
240b8b16e7 modules/mpris: fix: 'position' property now updates on metadata change
Not updating the position upon metadata change could result in a crash
due to the progress-bar particle begin initialized with invalid
arguments.
2024-08-31 02:27:01 +02:00
haruInDisguise
f5d7e5c227 modules/mpris.c: codespell: fixed typo 2024-08-29 12:05:27 +02:00
haruInDisguise
e04024a16b module/mpris: Added a man page 2024-08-29 11:55:01 +02:00
haruInDisguise
0d8ef94921 Merge branch 'master' into module_mpris 2024-08-28 23:34:09 +00:00
haruInDisguise
0a91025a1c modules/mpris: Fixed playback position
The playback position properly handles playing/pausing/seeking
2024-08-28 23:22:29 +02:00
haruInDisguise
eeeb33aee1 modules/mpris: Bugfixes and restructuring
- The 'update_status_from_message()' function now properly parses all
  changed properties, instead of only the first one.
- Implemented support for the 'Seekd' signal
2024-08-25 21:45:16 +02:00
haruInDisguise
63199c1378 modules/mpris: Major Update. See description
- Added support for signals and therefore the ability to listen
  for updates to the internal state, without having to query it
  manually every update cycle
- The entire implementation recieved various changes all across the
  codebase.
2024-08-24 21:06:28 +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
haruInDisguise
32ab5b9309 module/mpris: Improved error handeling 2024-07-06 10:32:13 +02:00
haruInDisguise
1b8962d296 Added 'MPRIS' module
This commit adds the ability to display status information for MPRIS
compatible music players.
I've adapted most of the naming conventions (and some code) from the
MPD module.
2024-07-05 23:22:20 +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