Don't know wether there's a way to do the same with screen, which I'm more familiar with...
EDIT: For screen, you just have to put an additional ^P in front of the escape sequence.
So, my previous escape sequence, when run in a screen session becomes :
printf "\033P\033]777;notify;Moi;Hello World\007\007\033\\"
Seems my problem is solved, thanks
]]>But these solutions sound incredibly heavy and if I could just print some notifications with the terminal abilities, it would be really nice !
OSC are just a kind of ANSI code to send to the terminal.
]]>FWIW, I have irssi write highlights to a file in a btsync directory on my server and I use inotify to watch that directory on all my machines; when the file is modified, dzen2 pops up to notify me.
Basic details here.
I'm often connecting to IRC (Weechat) and Mutt and other apps on my remote server. They run in a screen and I access to it via SSH. Thus, I can't use notify-send in this context, because they won't spawn the notifications on my local machine.
I know I can do it with a custom script, connecting to my own PC through SSH, but it seems complicated and I found the OSC and bell way which seems to be just perfect.
My idea was to use bells which are echoed to the terminal to locally spawn notifications. A Bell escape sequence is correctly send through tmux / screen etc. to my urxvt, and I could write a plugin to intercept it and spawn a notification on my own PC. This works fine but the notification is always the same, I can't customize it...
So, I found this solution about OSC. The idea is to send an escape sequence such as the following :
[ESC]777;notify;TITRE;MESSAGEBELL] and I can thus customize TITRE and MESSAGEBELL to customize the spawned notification.
With this plugin, I can get a notification called "moi" and with content "Hello World" if I type the following command in an urxvt terminal :
echo -ne "\033]777;notify;Moi;Hello World\007\007"
But it doesn't work in a tmux / screen session, and I can't get why
Thanks
]]>Perhaps you should explain exactly what it is you are trying to do: this thread is reading like an X-Y problem.
]]>My problem is that I'm using OSC sequences to make a custom notification with libnotify. The link containing the instruction I followed is here : http://artisan.karma-lab.net/ajouter-no … on-a-urxvt (sorry, it's in French. The plugin is in the "plugin notify" section). This allows me to add custom messages in the notification and thus to get message notification for mutt / weechat.
If I write echo -ne "\033]777;notify;Moi;Hello World\007\007" in a tmux session, it's not working, while it is outside a screen / tmux session.
Is there a way to make it work including in such a session ?
Thanks
]]>I'm using urxvt and screen. This works fine, however I can't have visual bell with this setup (even with ^a^G).
I often run a remote screen (ssh) in my urxvt for mutt / irc etc and I need to have the bell (\007) transmitted to have notifications.
I thought it was a problem with screen + ssh so I tested locally :
* URxvt only -> bell is seen
* URxvt + screen -> nothing happens (no notifications even in screen)
* Gnome-Terminal (+ screen) -> no problem at all
Do you have any ideas ?
Thanks
EDIT : Same thing using tmux
By setting
set-option -g bell-action any
set-option -g visual-bell on
in tmux.conf, he will handle bells and display them in the statusbar. But I can't get urxvt to get them.
]]>