Registered Member
|
Quick question...
Does anyone know a way of getting a notification when a command line job finishes and returns to the command prompt? I know there's "monitor for silence" but that often seems to trigger just because there hasn't been any changes on the command line for a few seconds. I don't want a notification until the command prompt appears (ie the job is done!) |
Administrator
|
If the command does not output anything, you may wish to use Monitor for activity. Otherwise I do not think it is possible, unless you enable notifications on Bell, and append a command to the existing command that triggers the bell.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
I also wanted to get notification upon shell prompt. I never found useful the notification for activity/silence.
As suggested, I now used the notification for bell w/ a follow-up command generating the bell. This till has one drawback that if the terminal getting the bell is the one having the focus in konsole, even if konsole itself does not have the focus (e.g. I turned to edit in vim ...), then the bell icon disappeared right away. When it really matters, I used a command that would pop up a window (somehow "Display a message box" in "Configure notifications" does not work for me.) The simplest command to pop up a window: xterm -e "echo 'Done. Press Ctrl-D to continue.'; cat" To generate a bell, Originally I just did echo "\a" But somehow it does not work when I was in a svn view (echo would just literally output two characters \ and a), so I built a simple c program to do it: #include <stdio.h> int main() { printf("\a"); return 0; } |
Registered Member
|
Actually
perl -e 'print "\a"' also works to generate the bell; should be better than a c binary from scripting point of view. |
Administrator
|
You can also use kdialog to show a dialog, see kdialog --help. I like kdialog --passivepopup, but I don't know how to show it without a timeout (i.e., don't hide without user interaction).
Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts |
Registered Member
|
just found this, thanks.
but by now the invocation is
so you can indeed use it:
/e: big numbers for timeout don’t seem to be supported time to write this functionality in a quick PyQt script (don’t wait for it, though, i’ll do it whenever i have to learn how to use notifications) |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]