-
Notifications
You must be signed in to change notification settings - Fork 29
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
DBus Monitor to pass events to input modules: First cut #64
base: packaging-process-and-systemd-service
Are you sure you want to change the base?
Conversation
2ab109f
to
a43ba48
Compare
83bc861
to
2c3294d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github made me leave this comment for some reason...
dbus-monitor/src/dbus_monitor.rs
Outdated
println!("Got message from DBus: {:?}", msg); | ||
|
||
run_inputmodule_command(vec!["led-matrix", "--pattern", "all-on", "--blinking"]); | ||
// Can't seem to get to this second command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JohnAZoidberg this is where I can't seem to get to the second command, it just stays on the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blinking command is implemented in software and will loop until you terminate the process.
The function call here will never exit. That's why it doesn't go to the next one.
If you reverse the order, it'll probably work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JohnAZoidberg ! Maybe I'll implement my own one that blinks n times, than exits, that'd be fun. Appreciate the tip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew I know it's been a while since I was in this repo but I finally had some time on this 4 day weekend!
I added a new blink_n_times
function and am using it here now, so it's not blocking anymore.
2c3294d
to
e16a7ce
Compare
20b25e8
to
2b678b1
Compare
Signed-off-by: Daniel Schaefer <[email protected]>
f56651c
to
8d04dff
Compare
@JohnAZoidberg @kiram9 FYI, I finished up a pretty decent implementation of this that let's you configure which channel you want to monitor and what commands to run through a configuration file! Eventually you could have an n of more than 1 here, but this is a decent PoC. It is based on my I think I'm going to pause here for now though until I receive the newer hardware so I can test it with that, but if you'd like to merge it sooner for any reason let me know, or feel free to try it yourself :). |
This is a working implementation of the DBus monitor applied to Input Modules!
I've folded it directly into this project instead of in a separate repo.
Try it out with
RUST_LOG=debug cargo run --target x86_64-unknown-linux-gnu -p framework-inputmodule-dbus-monitor
, to see debug output too, then try making a test calendar event with notification. Assuming your system uses the same DBus monitoring channel as mine, your LED Matrix module should blink when a notification comes in for a calendar event.Some things I am working on/trying to make better:
I want to make this much more generic as @kiram9 and I have discussed, where a user can create a config file in their home directory, subscribe to specific events, and then have certain commands run in response to them! But wanted a working example first.This is done, you can now have this respond to any DBus message and run any command!I can't seem to figure out how to make myI added a new command that doesn't loop to address this!run_inputmodule_command
which calls theserial_commands
function go on to the next command...it just stays on the first one. Any ideas @JohnAZoidberg ? Sorry if this is super obvious and I'm missing something!