Skip to main content

Send notification once long running command is finished. Add duration PROMP_FIELD.

Project description

Overview

Send notification once long-running command is finished. Adds `long_cmd_duration` to `$PROMPT_FIELDS` .

Installation

To install use pip:

xpip install xontrib-cmd-durations
# or: xpip install -U git+https://github.com/jnoortheen/xontrib-cmd-durations

Usage

xontrib load cmd_done

Usage

  • makes long_cmd_duration available to the $PROMPT_FIELDS
  • if the command is taking more than $LONG_DURATION seconds
    • it is long_cmd_duration returns the duration in human readable way
    • a desktop notification is sent if the terminal is not focused.
      • Note: Currently the focusing part requires xdotool to be installed.

        So the notification part will not work in Windows/OSX. PRs welcome on that.

$RIGHT_PROMPT = '{long_cmd_duration:⌛{}}{user:{{BOLD_RED}}🤖{}}{hostname:{{BOLD_#FA8072}}🖥{}}'

Credits

This package was created with xontrib cookiecutter template.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page