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

Scripts for additional suspension checks #5

Open
offlinehacker opened this issue Jan 12, 2019 · 3 comments
Open

Scripts for additional suspension checks #5

offlinehacker opened this issue Jan 12, 2019 · 3 comments

Comments

@offlinehacker
Copy link
Contributor

offlinehacker commented Jan 12, 2019

Idea

Implement a scripts that checks whether suspension is needed or not based on current process behavior. Have an option which scripts to activate for a profile.

Example checks

  • Does application play sound or not by checking pulse audio inputs.

pacmd list-sink-inputs short command gives information which processes are playing sound, also PID of process

  • Is application under high CPU load

If application is under high CPU load it might not be wise to suspend processes, as it might be processing something.

  • Is application having high network traffic lately

If application is having high network traffic it might not be wise to suspend processes, as it might be downloading or uploading something.

@kernc
Copy link
Owner

kernc commented Jan 12, 2019

How about a library of common, reusable shell scripts that ships with the software? Then we can prefix PATH before executing exec_suspend script, and the user can simply do:

...
exec_suspend = is-not-playing-sound && ...

@offlinehacker
Copy link
Contributor Author

That's a good idea, and it's then simple to package it and place these scripts under libexec :)

@offlinehacker offlinehacker changed the title Implement scripts for additional suspension checks Scripts for additional suspension checks Jan 12, 2019
@volfyd
Copy link

volfyd commented Apr 22, 2020

I use this to check if my webcam is in use. If it is, it avoids suspending chrome.
exec_suspend = sh -c 'exit $(lsmod | grep "^uvcvideo " | awk "{ print $3 }")'

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

No branches or pull requests

3 participants