[PATCH] Add desktop notification of completed commands
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: bash
The code uploaded here, released to the public domain, modifies the default bashrc to notify the user when a command completes and the terminal is not in focus.
It works by adding a custom PROMPT_COMMAND that uses a new C program called "xactive" to determine whether the terminal window is active and if not uses notify-send to popup a notification.
The code to add to /etc/bash.bashrc and xactive.c are attached.
To test, type "sleep 5", press Enter, Alt-Tab, and wait for the notification.
xactive should probably be put in a separate package since it depends on X11 (which should be depended on by ubuntu-desktop).
Add the following to /etc/bash.bashrc:
function prompt_command
{
if test -n "$DISPLAY" && test -n "$WINDOWID" && test -n "$DBUS_
local body="$
local timeout=3000
if test "$UID" != 0 || test "$USERNAME" == root; then
/usr/
elif test -x /usr/bin/sudo; then
/usr/bin/sudo -u "$USERNAME" /usr/bin/
fi
fi
}
PROMPT_
Changed in bash (Ubuntu): | |
assignee: | nobody → Dustin Kirkland (kirkland) |
tags: | added: alert |
sounds like the perfect recipy to make your desktop more noisy ... not sure if I just want to close this as won't fix.