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

error: Found argument '--not-when-audio' which wasn't expected, or isn't valid in this context #50

Closed
artemave opened this issue Jul 2, 2020 · 11 comments

Comments

@artemave
Copy link

artemave commented Jul 2, 2020

Running the latest xidlehook (0.9.1), has --not-when-audio flag gone?

% xidlehook --version
xidlehook 0.9.1

% xidlehook --not-when-audio --not-when-fullscreen --timer 2 'echo done' ''
error: Found argument '--not-when-audio' which wasn't expected, or isn't valid in this context
        Did you mean --not-when-fullscreen?

USAGE:
    xidlehook --not-when-fullscreen --timer <duration> <command> <canceller>
@jD91mZM2
Copy link
Owner

jD91mZM2 commented Jul 2, 2020

Are you compiling it with the pulse flag? The nix derivation of the latest git version does not include this flag by default

@artemave
Copy link
Author

artemave commented Jul 2, 2020

I am using one the suggested install methods from the readme:

nix-env -if https://gitlab.com/jD91mZM2/xidlehook/-/archive/master.tar.gz

@jD91mZM2
Copy link
Owner

jD91mZM2 commented Jul 2, 2020

That one indeed does not use the pulse flag, unfortunately. There were some weird issues with it that weren't easy to fix. If you use the stable one nixpkgs.xidlehook you'll get the pulse flag

@artemave
Copy link
Author

artemave commented Jul 2, 2020

I see. That works, thank you. Ironically, the reason for trying out latest was that --not-when-audio flag no longer seems to be working for me (ubuntu). But that, perhaps, is another issue.

@artemave
Copy link
Author

artemave commented Jul 2, 2020

Update: I think that's zoom app that's making xidlehook think that audio is still on. If I restart zoom --not-when-audio works. But as soon as zoom uses audio (for instance, audio test), xidlehook --not-when-audio --timer 1 'echo done' '' no longer prints "done". Hope this is useful.

@jD91mZM2
Copy link
Owner

jD91mZM2 commented Jul 2, 2020

Interesting, try running xidlehook with RUST_LOG=debug to get some debugging output. To run the latest xidlehook with custom flags, you might need to use cargo install xidlehook --git <url> --feature pulseaudio. This will of course require you to specify all native dependencies yourself, such as using nix-shell -p xorg.xcb pulse ...

@artemave
Copy link
Author

artemave commented Jul 2, 2020

[INSERT] % RUST_LOG=debug xidlehook --not-when-audio --timer 1 'echo done' ''
[2020-07-02T21:29:14Z DEBUG xidlehook_core::modules::pulse] Partial count: 1
[2020-07-02T21:29:14Z DEBUG xidlehook_core::modules::pulse] Total sum: 1
<<<< stuck here until zoom is shut >>>>
[2020-07-02T21:29:50Z DEBUG xidlehook_core::modules::pulse] Total sum: 0
done

@jD91mZM2
Copy link
Owner

jD91mZM2 commented Jul 3, 2020

My instinct is that this sounds like an issue with zoom. Pun not intended. But there is certainly further debugging to be done, like listing the full info of each application it thinks plays audio. Try adding a debug! after this line

@artemave
Copy link
Author

artemave commented Jul 3, 2020

This goes way beyond my rust skills. Unless you tell me exactly what to debug! and then how to compile it, I am afraid, I won't be much help :)

@jD91mZM2
Copy link
Owner

jD91mZM2 commented Jul 3, 2020

debug!("Sink info: {:?}", item);

Then compile with cargo build. You'll find the binary in target/debug/xidlehook. Or you can do cargo run -- <args> directly

@jD91mZM2
Copy link
Owner

Closed in favor of #51

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

No branches or pull requests

2 participants