Script for notifying process termination

When I'm working, I usually have a lot of terminal open with different tasks running in different terminal. When I run a process that takes a long time(e.g. compiling, file prcoessing), I usually switch to another terminal. The annoying thing is that I need to constantly switch back to the terminal to check the progress of the process. Because of this, I wrote a script that monitors processes specified, and notify you when the process is finished via 'notify-send'.



Here is the script: pnotify

You will need  the 'libnotify' package from your distribution to provide the 'notify-send' command.
Usage:
Usage: pnotify [-p PIDS] COMMAND ARGS

Options:
  -p PIDS, --pids=PIDS  pids to monitor, separated with comma.
  -h, --help            show this help message and exit

Example:
1. Monitor a command:
pnotify cp -r src dst
pnotify make -j8

2. Monitor a list of pids
pnotify -p 9527,123456
pnotify -p `pgrep cp`

留言

這個網誌中的熱門文章

決定了!!!

P.S. I Love You

Tips: PPTP client on Openwrt