jD91mZM2/xidlehook

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

Closed this issue · 11 comments

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>

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

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

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

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

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.

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.

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 ...

[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

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

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 :)

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

Closed in favor of #51