Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rfkill status to network module and new bluetooth module #568

Merged
merged 18 commits into from
Apr 17, 2020

Conversation

marcplustwo
Copy link
Contributor

I added an interface to the linux rfkill utility. This allows modules to update based on changes of the rfkill state. I added this to the existing network module and created a new bluetooth module implementing the feature.

rfkill

The code is adapted from here.

bluetooth

I was never sure if my bluetooth module was deactivated or not connecting to my devices for another reason.
It's possible to update the module via an interval in addition to rfkill events.

network module

Two main changes were made:

  1. Distinction between no wifi connection present and wifi module turned off. (think: airplane mode)
  2. Update status on rfkill event in addition to interval based updates.

The second actually gave me some trouble as there seems to be an unrelated bug. The module doesn't seem to reflect a change in status in the bar, even though the corresponding update() function was executed both via the interval as well as based on the rfkill event.
I reproduced this on v0.9 from the arch community repos. Also see my comment in #494.

I am open to any feedback, especially on style. I don't have much experience with c++.

Copy link
Owner

@Alexays Alexays left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the update that doesn't seem to work, this may be due to the fact that the getInfo stuff needs a delay to be updated and get new information, can you try with a large delay of 1s and reduce it?

man/waybar-bluetooth.5.scd Outdated Show resolved Hide resolved
src/modules/network.cpp Outdated Show resolved Hide resolved
include/util/rfkill.hpp Outdated Show resolved Hide resolved
src/util/rfkill.cpp Outdated Show resolved Hide resolved
@marcplustwo
Copy link
Contributor Author

marcplustwo commented Feb 23, 2020

Thanks a lot for the feedback! I changed everything you requested.

For the update that doesn't seem to work, this may be due to the fact that the getInfo stuff needs a delay to be updated and get new information, can you try with a large delay of 1s and reduce it?

As for this, I have tried lots of different combinations of delays at different points, but couldn't figure it out. Maybe you or someone could take another look at that. I don't think my changes interfere here - I tested version 0.9 form the repos again and I had the same issue.

Merge Alexays:master into marcplustwo:master
@Alexays Alexays added this to the 1.0.0 milestone Apr 5, 2020
@marcplustwo
Copy link
Contributor Author

Thanks a lot for the feedback! I changed everything you requested.

For the update that doesn't seem to work, this may be due to the fact that the getInfo stuff needs a delay to be updated and get new information, can you try with a large delay of 1s and reduce it?

As for this, I have tried lots of different combinations of delays at different points, but couldn't figure it out. Maybe you or someone could take another look at that. I don't think my changes interfere here - I tested version 0.9 form the repos again and I had the same issue.

The issues disappeared. Now everything is working as expected!

@Alexays
Copy link
Owner

Alexays commented Apr 16, 2020

Thanks @marcplustwo, will merge this by the end of the week ❤️

@Alexays
Copy link
Owner

Alexays commented Apr 17, 2020

Thanks a lot, can you update the github wiki?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants