{"id":17584558,"url":"https://github.com/kaustubhhiware/notifyre","last_synced_at":"2025-04-28T16:21:37.880Z","repository":{"id":91736443,"uuid":"74615494","full_name":"kaustubhhiware/NotiFyre","owner":"kaustubhhiware","description":"Notify when a terminal task is done/ Terminal task notifier https://kaustubhhiware.github.io/NotiFyre/","archived":false,"fork":false,"pushed_at":"2018-11-01T21:38:03.000Z","size":3298,"stargazers_count":60,"open_issues_count":12,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T16:21:29.735Z","etag":null,"topics":["bash","bash-script","fish","fish-shell","linux","macos","notifications","terminal","terminal-notifier","ubuntu","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaustubhhiware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-23T21:31:43.000Z","updated_at":"2025-02-15T20:57:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"43a66bdb-d188-4416-8f1c-3cc3dfa6a1d6","html_url":"https://github.com/kaustubhhiware/NotiFyre","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaustubhhiware%2FNotiFyre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaustubhhiware%2FNotiFyre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaustubhhiware%2FNotiFyre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaustubhhiware%2FNotiFyre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaustubhhiware","download_url":"https://codeload.github.com/kaustubhhiware/NotiFyre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342721,"owners_count":21574245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","fish","fish-shell","linux","macos","notifications","terminal","terminal-notifier","ubuntu","zsh"],"created_at":"2024-10-22T02:06:55.065Z","updated_at":"2025-04-28T16:21:37.864Z","avatar_url":"https://github.com/kaustubhhiware.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NotiFyre\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png?v=103)](https://opensource.org/licenses/mit-license.php) [![Bash Shell](https://badges.frapsoft.com/bash/v1/bash.png?v=103)](https://github.com/ellerbrock/open-source-badges/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=shields)](http://makeapullrequest.com)\n\nIt's lit :fire:\n\nNotify when a terminal task is done\n\n![Image could not be displayed](thumbnail_fish.png)\n\n[Sample working video](https://drive.google.com/open?id=0B5iU6cWw36rObk9tNDEwNmhjTzA), sped up at x2.\n\nInstall dependencies first :\n\n- For Mac OS - `brew install terminal-notifier`\n- For Ubuntu - `sudo apt-get install notify-osd pulseaudio-utils libnotify-bin`\n\n**Note:** The above dependencies are generally installed on most systems.\n\nNotifyre has been tested on a fresh install of Ubuntu 16.04 running bash, zsh or fish. If you have managed to port this script to another shell or another OS, please open a pull request with the instructions for the same and we will update the README! Got some coverage [here](https://www.ostechnix.com/get-notification-terminal-task-done/).\n\n## Table of Contents\n\n- [Bash / ZSH](#bash--zsh)\n  - [Setup](#setup)\n  - [Configuration](#configuration)\n- [Fish shell](#fish-shell)\n  - [Setup](#setup-1)\n  - [Configuration](#configuration-1)\n- [Why This](#why-this)\n- [Contributing](#contributing)\n- [Debugging](#debugging)\n- [Acknowledgements](#acknowledgements)\n- [License](#license)\n\n## Bash / ZSH\n[(Back to top)](#table-of-contents)\n\n### Setup\n\n* Place `notifyre.sh` \u0026 `bash-preexec.sh` in your home folder\n\n    ```sh\n    git clone https://github.com/kaustubhhiware/NotiFyre.git\n    cd NotiFyre\n    cp notifyre.sh bash-preexec.sh ~\n    ```\n\n* :zap: Lightning fast alternative: Pull only these two files from GitHub!\n\n    ```\n    curl https://raw.githubusercontent.com/kaustubhhiware/NotiFyre/master/notifyre.sh -o ~/notifyre.sh\n    curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/bash-preexec.sh\n    ```\n\n\n * Add the following lines to the end of `~/.bashrc` or `~/.zshrc`:\n\n    ```sh\n    # as close to the end as possible\n    source ~/notifyre.sh\n    source ~/bash-preexec.sh\n    ```\n\n    **Note:** These 2 lines should be added as close to the end of the file as possible.\n\n* If you do not want to be notified for each command, then add only this to the end of your rc file:\n\n    ```sh\n    source ~/notifyre.sh\n    ```\n\n    To get a notification for a command in this case, you need to run it as `nf \u003ccommand\u003e`\n\n### Configuration\n [(Back to top)](#table-of-contents)\n ```sh\n SOUND=1\n SOUND_MIN=10\n ALERT=/usr/share/sounds/ubuntu/notifications/Slick.ogg\n MIN_INTERVAL=4\n ```\n\n There are four configurable options in NotiFyre:\n\n 1. `SOUND`\n\n    **Options:** 0 or 1\n\n    **Utility:** SOUND=1 will play an alert sound for each notification that\n    takes more time than `SOUND_MIN` seconds. This value is a boolean.\n\n 2. `SOUND_MIN`\n\n    **Valid values:** 1, 2, 3 ...\n\n    **Utility:** Let's you configure the minimum amount of time a command must\n    take for it to trigger a sound notification. (If `SOUND=0`, then no sound\n    notification will be played) This value is in seconds.\n\n 3. `ALERT`\n\n    **Options:** Path to a sound file\n\n    **Utility:** The sound file will be played whenever `SOUND=1`\n    and a command has taken more time than `SOUND_MIN` seconds. If the sound\n    file does not exist, it plays an audible-bell sound (varies by terminal)\n    as a fallback.\n\n 4. `MIN_INTERVAL`\n\n\n    **Options:** 1, 2, 3, ...\n\n    **Utility:** An option to configure the minimum amount of time that a\n    command must take in order to trigger a notification. This value is in\n    seconds.\n\n## Fish shell\n[(Back to top)](#table-of-contents)\n\n### Setup\n\n* Place the *prompt_pwd.fish*, _notifyre.fish_ and _nf.fish_ in  your `~/.config/fish/functions/` folder.\n  ```\n  git clone https://github.com/kaustubhhiware/NotiFyre.git\n  cd NotiFyre\n  cp prompt_pwd.fish notifyre.fish nf.fish ~/.config/fish/functions/\n  ```\n\n* :zap: Lightning fast alternative:\n\n   ```sh\n   # Pull the files from Github\n   curl https://raw.githubusercontent.com/kaustubhhiware/NotiFyre/master/prompt_pwd.fish -o ~/.config/fish/functions/prompt_pwd.fish\n   curl https://raw.githubusercontent.com/kaustubhhiware/NotiFyre/master/notifyre.fish -o ~/.config/fish/functions/notifyre.fish\n   curl https://raw.githubusercontent.com/kaustubhhiware/NotiFyre/master/nf.fish -o ~/.config/fish/functions/nf.fish\n   ```\n\n* To be notified for each process, add this to your `functions/fish_prompt.fish`\nfile just before the end :\n\n  ```sh\n   function fish_prompt\n      ...\n\n      eval (notifyre)  # at the very end\n   end\n  ```\n   This method works pretty well with my **bobthefish** theme and no theme as\n   well. Let me know if it doesn't work out for you.\n\n\n* If you want to be notified only for select commands, you do\nnot need to modify the `fish_prompt.fish` file.\n\n   Run with `nf command`\n\n   [This might take slightly more time than the process itself to complete\n   execution.]\n\nYou can learn to write your own functions in fish with\n[this](https://fishshell.com/docs/current/tutorial.html) as a starting point.\n\n### Configuration\n [(Back to top)](#table-of-contents)\n\n ```sh\n set -x timeout 1\n set -x ring_timeout 2\n set -x ALERT /usr/share/sounds/ubuntu/notifications/Slick.ogg\n ```\n There are three available options:\n\n 1. `timeout` : Same as option `MIN_INTERVAL` in the Bash / ZSH section above\n 2. `ring_timeout` : Same as option `SOUND_MIN` in the Bash / ZSH section above\n 3. `ALERT` : Same as option `ALERT` in the Bash / ZSH Section above\n\n Note: The notifications appear in a queue, and cannot be implemented parallely (known bug in notify-send)\n\n## Why This?\n[(Back to top)](#table-of-contents)\n\nI had to reinstall Ubuntu quite a number of times thanks to how awesome Windows messed up my laptop. This script seeks to help anyone who multi-tasks, or does not constantly check their terminals. [ntfy](https://github.com/dschep/ntfy) wasn't consistent always, so made this.\n\nTested on fresh install of Ubuntu 16.04, Arch Linux and Mac. Ubuntu 14 may require [Slick.ogg](Slick.ogg) whose path must be changed before usage.\n\n## Contributing\n[(Back to top)](#table-of-contents)\n\nYour contributions are always welcome :smile: ! Please have a look at the [contribution guidelines](CONTRIBUTING.md) first.\n\nDiscussion Group: https://www.facebook.com/groups/552015885141292/\n\nYou can use [refer.md](refer.md) for some previous work I've referred to while making this.\n\nHave a suggestion? Make an issue about it.\n\n## Debugging\n[(Back to top)](#table-of-contents)\n\n### Not working/ Message not displayed\ncheck if notify-osd is working with this - `notify-send \"hi\"`\n\nIf no message pops up, it means notify-osd has stopped working. Reinstall some dependencies and try again:\n\n    sudo apt-get --reinstall install libnotify-bin notify-osd\n\nFor further customizations, you can use [NotifyOSD config](http://ubuntuhandbook.org/index.php/2014/04/customize-on-screen-notification-ubuntu-1404/)\n\n## Acknowledgements\n[(Back to top)](#table-of-contents)\n\n- [Ryan Caloras](https://github.com/rcaloras) for `bash-preexec.sh` [here](https://github.com/rcaloras/bash-preexec).\n\n## License\n[(Back to top)](#table-of-contents)\n\nThe MIT License (MIT) 2017 - [Kaustubh Hiware](https://github.com/kaustubhhiware). Please have a look at the [LICENSE.md](LICENSE.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaustubhhiware%2Fnotifyre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaustubhhiware%2Fnotifyre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaustubhhiware%2Fnotifyre/lists"}