-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I wrote this monster a few weeks ago. For any command that lasts longer than the defined THRESHOLD, make a pop-up notification including the PID and the command when it finishes. It seems like something that might be up your alley, so I figured I'd share.
ICON=/usr/share/icons/Numix-Circle/48/apps/terminal-tango.svg
THRESHOLD=5
trap '_start=$SECONDS' DEBUG
PROMPT_COMMAND='(if (( SECONDS - _start > $THRESHOLD )); then
hist1=$(echo $(history 1) | cut -d " " -f1)
hist2=$(echo $(history 1) | cut -d " " -f2-)
notify-send --icon=$ICON "$(echo -e Finished!\\nPID: ${hist1}\\nCommand: ${hist2})"; fi)'Metadata
Metadata
Assignees
Labels
No labels