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 branch

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

From a PPA

$ sudo add-apt-repository ppa:undistract-me-packagers/daily
$ sudo apt-get update
$ sudo apt-get install undistract-me

Then run a login shell: start a whole new Gnome Terminal, run bash --login or log out then log in again.

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.

In addition to a visual notification you can make undistract-me notify you by playing an audible sound along with the nitification popup by simply setting the variable UDM_PLAY_SOUND to a non-zero integer on the command line. This functionality requires that pluseaudio and sound-theme-freedesktop

  • which provides 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

987poiuytrewq avatar al42and avatar jml avatar knuthingmuch avatar mikey avatar mvo5 avatar nocnokneo avatar sfrothwell avatar

Watchers

 avatar  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.