https://github.com/sztomi/undistract-me-zsh
zsh fork / repackaging of the original bash undistract-me
https://github.com/sztomi/undistract-me-zsh
Last synced: 2 months ago
JSON representation
zsh fork / repackaging of the original bash undistract-me
- Host: GitHub
- URL: https://github.com/sztomi/undistract-me-zsh
- Owner: sztomi
- Created: 2022-12-21T19:37:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-21T20:26:17.000Z (over 2 years ago)
- Last Synced: 2025-01-28T13:52:34.620Z (4 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# undistract-me-zsh
This is largely based on https://github.com/jml/undistract-me and especially its zsh
fork: https://github.com/rgreenblatt/undistract-meFor explaining what this does, I'll refer to the original README:
You're doing some work, and as part of that you need to run a command on the terminal that
takes a little while to finish. You run the command, watch it for maybe a second and then
switch to doing something else – checking email or something.You get so deeply involved in your email that twenty minutes fly by. When you switch back to
your terminal the command has finished, but you've got no idea whether it was nineteen seconds
ago or nineteen minutes ago.This happens to me a lot. I'm just not disciplined enough to sit and watch commands, and I'm
not prescient enough to add something to each invocation to tell me. What I want is something
that alerts me whenever long running commands finish.This is it.
Install this, and then you'll get a notification when any command finishes that took longer
than ten seconds to finish.What this fork does is a little unification of the env var names and adding a top-level function
call so that the script can be installed via `zplug`. That's it.## Installation
```
zplug 'sztomi/undistract-me-zsh'
```## Configuration
| Environment variable | Description | Default |
|---|---|---|
| `UMZ_COMMAND_TIMEOUT` | Commands that take longer than this value (in seconds) will trigger a notification | `10` |
| `UMZ_PLAY_SOUND` | Controls if a sound should be played along with the notification. `0` means no, any other value means yes. | `0` |
| `UMZ_SOUND_FILE` | Sound file to play upon completion (if `UMZ_PLAY_SOUND` is set to a non-zero value) | `/usr/share/sounds/freedesktop/stereo/complete.oga` |