You are not logged in.

#1 2009-04-24 09:09:39

atcq
Member
From: Germany
Registered: 2008-09-04
Posts: 28

[partiallySOLVED] changing window name of running urxvt

Hi,

Is it possible to change the window name of an running urxvt-terminal via external script (as in: not running in the urxvt-terminal itself)?
I have no idea how i could do that ... is it even possible at all?

EDIT:
Why?
To change the name/title of a urxvt-terminal running mcabber when a new incoming message is detected ...

Thanks, atcq

Last edited by atcq (2009-04-24 12:53:41)

Offline

#2 2009-04-24 10:24:56

robmaloy
Member
From: Germany
Registered: 2008-05-14
Posts: 263

Re: [partiallySOLVED] changing window name of running urxvt

just found this on google:


add:

function shdr { 
if [ "$TERM" = "xterm" -o "$TERM" = "rxvt" -o "$TERM" = "rxvt-unicode"] ; then
printf '\033]2;'$*'\07'
fi
}

to bashrc

(thanks for posting this thread, i've been wondering how to do that, too)

Last edited by robmaloy (2009-04-24 10:26:42)


☃ Snowman ☃

Offline

#3 2009-04-24 12:48:47

atcq
Member
From: Germany
Registered: 2008-09-04
Posts: 28

Re: [partiallySOLVED] changing window name of running urxvt

sure.. this is true for the first start of the terminal ... and you can also do that by using the -name NAME option of urxvt!

i wanted to change a specific terminals (say started with the -name mcabber option) window_name!
found a solution which doesn't work with openbox sad , had it tested by someone running debian and xfce ... maybe it works with arch and xfce, too!
no idea why it won't work in openbox though!

you need community/wmctrl

pacman -S wmctrl

to use it in mcabber:
~/.mcabber/mcabberrc

set events_command = ~/.mcabber/eventcmd
set events_ignore_active_window = 1 # not necessarily needed!

needs to be set

~/.mcabber/eventcmd

#!/bin/bash
# testing if message is an incoming message from JID
if [ "$2" == IN ]; then
   wmctrl -r mcabber -T "new msg from $3 - mcabber"
fi
# resetting window_name to default if all messages are read
if [ "$1" == UNREAD -a "$2" == 0 ]; then
   wmctrl -r mcabber -T "mcabber"
fi
exit 0

instead of changing the name of urxvt, i now use notify-send with xfce4-notifyd to notify me about new messages in mcabber ...

maybe it helps someone else ... i'm fine with notify-send!

Last edited by atcq (2009-04-24 12:52:06)

Offline

Board footer

Powered by FluxBB