• Stars
    star
    539
  • Rank 82,402 (Top 2 %)
  • Language
    Shell
  • License
    Other
  • Created almost 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Notifies you when long-running terminal commands complete

undistract-me

Notifies you when long-running terminal commands complete.

What is this?

Does this ever happen to you?

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.

Installation

From the Ubuntu repositories

$ sudo apt install undistract-me

From the branch

$ bzr checkout --lightweight lp:undistract-me
$ . undistract-me/long-running.bash
$ notify_when_long_running_commands_finish_install

Add to your Bash

$ echo 'source /etc/profile.d/undistract-me.sh' >> ~/.bashrc

Configuration

By default, a long-running command is any command that takes more than 10s to complete. If this default is not right for you, set LONG_RUNNING_COMMAND_TIMEOUT to a different number of seconds and export it. It is possible to disable notifications for certain commands by adding them space-separated to LONG_RUNNING_IGNORE_LIST variable.

By default, the notification will only show if the active window is not the window the command is running in. If this is not right for you, (eg. if you are an Emacs user), you can set IGNORE_WINDOW_CHECK to 1 to skip the window check.

In addition to a visual notification, you can make undistract-me notify you by playing an audible sound along with the notification popup by simply setting the variable UDM_PLAY_SOUND to a non-zero integer on the command line. This functionality requires that pulseaudio-utils and sound-theme-freedesktop (which provides the notification sound file) be installed on a Debian-based system.

Licensing

All of undistract-me, including this file, is made available with the Expat license. See LICENSE for details.

Getting help

There's no dedicated IRC channel, but feel free to ping jml on Freenode, probably in the #ubuntu-devel channel.

Alternatively, ask questions or file bugs on the undistract-me Launchpad project.

Credits

Glyph Lefkowitz wrote a neat hack to provide ZSH-like preexec support for bash.

A lot of help from Chris Jones of Terminator.

Mikey Neuling and Stephen Rothwell have made huge improvements to the performance and quality of the shell script. I'm amazed, humbled and grateful.

More Repositories

1

terradiff

Get told when your Terraform config doesn't match reality
JavaScript
102
star
2

servant-template

Cookiecutter template for Servant projects
Haskell
58
star
3

tree-format

Python library for printing trees on the console
Python
39
star
4

difftodo

Turns diffs into todo lists by parsing comments
Haskell
32
star
5

obsidian-to-org

Convert an Obsidian directory to org-roam
Python
14
star
6

direnv-el

Emacs integration for direnv
Emacs Lisp
8
star
7

bazel-python-spike

Experiment with using Bazel for testing Python
Python
8
star
8

open-haddock

Quickly open documentation for Haskell packages or modules from the command line
Haskell
4
star
9

dotfiles

System configuration
Emacs Lisp
4
star
10

rules_haskell-old

Haskell rules for Bazel
Python
3
star
11

haverer

Haskell implementation of Loveletter
Haskell
2
star
12

holborn

Haskell
2
star
13

jml-web-service

Haskell library for web services
Haskell
2
star
14

diff-match-patch

Haskell library for diff, match, and patch
Haskell
2
star
15

hazard-deprecated

A RESTful API for playing Love Letter
Haskell
1
star
16

haskell-cli-template

Cookiecutter template for Haskell CLI programs
Haskell
1
star
17

treeshape

Quickly make files and directory structures in Python
Python
1
star
18

perfidy

Immutable data structures and functional tools for Python
Python
1
star
19

loveletter

Implementation of Love Letter
Rust
1
star
20

reach

Rust implementation of DRMacIver's each
Rust
1
star
21

haskell-static-minimal-repro

Minimal Haskell project to experiment with static linking
Haskell
1
star
22

bazel-haskell-experiment

Python
1
star
23

omnimetrics

Tools for exploring OmniFocus data
Python
1
star
24

txapply

Tools for combining Twisted Deferreds
Python
1
star
25

quay-admin

Administer quay.io repositories for an organization
Python
1
star
26

emacs-configuration

My emacs configuration.
Emacs Lisp
1
star
27

flocker-tools

Experimental repository for prototype tools for administering flocker clusters
Python
1
star
28

pretty-error

Pretty error messages for failed runtime invariants in Haskell
Haskell
1
star