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

Notify only if a command takes more than a configured amount of time #5

Open
icyflame opened this issue Oct 6, 2017 · 6 comments
Open

Comments

@icyflame
Copy link
Contributor

icyflame commented Oct 6, 2017

Some commands are long running (like npm install or wget -R) and those are the only ones I would be interested in notifications for. Would you be interested in adding something like this to this package?

@kaustubhhiware
Copy link
Owner

This is already configured. Although it's not exactly parameterised in the shell file.

P.S: Relevant line in .sh Relevant line in .fish
Snippets:
sh

    [ $(($(date +%s) - start)) -le 0 ] || .....
	[ $(($(date +%s) - start)) -le 1 ] || ....

fish

    set -x timeout 1
    set -x ring_timeout 2
...
        if test $CMD_DURATION -gt (math "1000 * $ring_timeout") # time set for ring
        ....

This is a max 2 minute fix. But I would rather let someone else do it, since it's Hacktoberfest.

@icyflame
Copy link
Contributor Author

icyflame commented Oct 6, 2017

@kaustubhhiware I see. If I understand it right, there's no central config store right now. I would be interested in three configurable options:

  1. the list of commands that I want to be notified for
  2. whether I want the audio or not (I don't like the audio, keeping it configurable seems like a good way to go)
  3. minimum time interval that a command must take to qualify for a notification

Would you be interested in these options? I will take a stab at implementing these, if you are.

(I have wanted this for a while now, and all the solutions need you to put the command before running it. That's honestly annoying)

@kaustubhhiware
Copy link
Owner

I pretty much agree with the options you've suggested. I'm hopeful someone new to open source contributes, else you or I can do this in an hour or so.

@icyflame
Copy link
Contributor Author

icyflame commented Oct 6, 2017

Ah, I just saw this. I was delving into the code, and I fixed it. Have a look!

@kaustubhhiware
Copy link
Owner

Close in favor of #6

@kaustubhhiware
Copy link
Owner

Fish script to be updated.

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

2 participants