You are not logged in.

#1 2013-12-27 16:07:39

doupod
Member
Registered: 2012-09-06
Posts: 73

[SOLVED] Bell notifications in screen running in URxvt

Hi,

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 hmm

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.

Last edited by doupod (2013-12-27 21:25:08)

Offline

#2 2013-12-27 18:19:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 24,656
Website

Re: [SOLVED] Bell notifications in screen running in URxvt

Works fine in tmux for me.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#3 2013-12-27 20:44:57

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: [SOLVED] Bell notifications in screen running in URxvt

Well, it's my bad indeed. It is working with tmux, with the link you pointed. I can effectively get a visual bell.

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

Offline

#4 2013-12-27 20:53:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 24,656
Website

Re: [SOLVED] Bell notifications in screen running in URxvt

I don't know what OSC is, but if you are using notify-send, why do you need a visual bell in your terminal?

Perhaps you should explain exactly what it is you are trying to do: this thread is reading like an X-Y problem.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#5 2013-12-27 20:59:55

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: [SOLVED] Bell notifications in screen running in URxvt

Sorry, here are the full details :

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 hmm

Thanks

Offline

#6 2013-12-27 21:07:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 24,656
Website

Re: [SOLVED] Bell notifications in screen running in URxvt

OK. That makes more sense. I still don't have any clue what OSC is, so perhaps someone else can help you with that.

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.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#7 2013-12-27 21:19:12

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: [SOLVED] Bell notifications in screen running in URxvt

jasonwryan: I found two other solutions on the web, which are basically equivalent. The first one is to write to a file and fetch that file thanks to ssh (which means that I must have an unlocked ssh key to connect silently and fetch that file from my local computer), and the other one is to connect to the server with some port forwarding in SSH and to have the remote program send commands to a local server on that particular port.

But these solutions sound incredibly heavy and if I could just print some notifications with the terminal abilities, it would be really nice ! smile

OSC are just a kind of ANSI code to send to the terminal.

Offline

#8 2013-12-27 21:19:51

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: [SOLVED] Bell notifications in screen running in URxvt

I've just found the answer for tmux : http://comments.gmane.org/gmane.comp.te … .user/1322

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 smile

Last edited by doupod (2013-12-27 21:24:46)

Offline

Board footer

Powered by FluxBB