Giter Site home page Giter Site logo

undistract-me's Introduction

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.

undistract-me's People

Contributors

jml avatar mikey avatar al42and avatar lucienve avatar orschiro avatar 987poiuytrewq avatar ajmeese7 avatar knuthingmuch avatar losoliveirasilva avatar mvo5 avatar sfrothwell avatar nocnokneo avatar wting avatar rubenwardy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.