jD91mZM2 / xidlehook

GitLab: https://gitlab.com/jD91mZM2/xidlehook
MIT License
382 stars 33 forks source link

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

Closed artemave closed 3 years ago

artemave commented 4 years ago

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 commented 4 years ago

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

artemave commented 4 years ago

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

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

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago
[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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

Closed in favor of #51