Command-line notifications
Nov. 19th, 2010 11:47 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The other day, over porter somewhere in Dublin, we were discussing people who run curses-based applications in the X terminal under Maemo, rather than using the GUI. (For example, some people run mutt rather than modest, irssi rather than xchat, and so on.) Sometimes people do this because they want or need to run the client on a remote machine, and they don't want to bother with X forwarding. Sometimes they just prefer the character interface.
The idea was then floated of having an escape sequence which caused the client to pop up a notification, so that even a curses-based application running on a remote server could alert you that you had new mail, or that someone had just said your name in channel.
So on the plane home, I hacked up an example implementation:

You can find the patches here:Further thoughts:
(Edit: naltrexone suggests appropriate Flann O'Brien parody.)
Your thoughts (and patches) are welcome, as always.
The idea was then floated of having an escape sequence which caused the client to pop up a notification, so that even a curses-based application running on a remote server could alert you that you had new mail, or that someone had just said your name in channel.
So on the plane home, I hacked up an example implementation:

You can find the patches here:Further thoughts:
- it still needs osso-xterm integration, but that should be easy
- patches to mutt, irssi, and so on to produce these sequences would be useful
- we need to work out something to do with terminfo to report that this sequence may be generated
- it uses OSC code 55, which is otherwise unused in gnome-terminal, but I don't know whether anyone else uses it for anything. (The relevant spec, ECMA-48, says that OSC codes are user-defined, but I'd still rather not tread on anyone's toes.)
- it only allows the sequence to be terminated by BEL; this is traditional, but ECMA-48 actually requires ST instead. This will be trivial to allow as well.
- I'm not at all sure about min/max versions of libnotify
(Edit: naltrexone suggests appropriate Flann O'Brien parody.)
Your thoughts (and patches) are welcome, as always.
why not pynotify
Date: 2010-11-19 05:11 pm (UTC)import sys
import pynotify
title =''
message = sys.argv[0]
pynotify.init("shell")
n = pynotify.Notification(title, message)
n.set_timeout(5)
n.show()
Re: why not pynotify
Date: 2010-11-19 05:13 pm (UTC)Re: why not pynotify
Date: 2010-11-19 05:16 pm (UTC)Something else
Date: 2010-11-19 09:35 pm (UTC)Make an escape sequence that can mark something as a URL (if it doesn't already).
Then either port apps to output filenames (with file:///).
Ssh would have to be ported to mung these into sftp:///somewhere.
For stuff not ported, it could run in a wrapper that would watch what files it opened, and if they were output linkify them.
Once files were linked, you could right click and manage files displayed by ls, do stuff like copy the location - maybe even drag a file right out of an ls listing onto the desktop somewhere.
Basically joining up the console and the gui a lot more than they are already.
- Stuart Axon
ntWTtTlcbVkqGHuE
Date: 2011-09-27 11:51 pm (UTC)in the same vain
Date: 2010-11-20 09:42 pm (UTC)http://blog.hawkhost.com/2010/07/02/tmux-%e2%80%93-the-terminal-multiplexer-part-2/#tmux-window-activity
Obviously that's not going to do you any good if you're using Quake/Tilda and have your terminal hidden (when a pop up might be nice); but I tend to find pop-ups really annoying unless it's something I'm very explicitly waiting to be alerted to/about.
lydvvGqXVClOXorLmHo
Date: 2011-09-29 10:57 pm (UTC)no subject
Date: 2010-11-29 07:16 pm (UTC)mDKoRZMdEFCYTVBym
Date: 2011-09-28 09:07 am (UTC)