ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] Hook for renaming new window


From: Nazri Ramliy
Subject: Re: [RP] Hook for renaming new window
Date: Tue, 12 Jul 2005 08:56:37 +0800

On 7/9/05, Ivan Beschastnikh <address@hidden> wrote:
> I guess you can bind the bind the key to instead of execing firefox,
> exec a script that will:
> 
> 1. run 'ratpoison -c windows'
> 2. grep that for the title you are seeking
> 3. if it's not found, run 'ratpoison -c 'title $W new_title''
>    where $W is the window #

Thanks for your suggestion, it gave me an idea.

A workaround I use now is to execute a shell script to automatically
rename the first Gecko window to Browser. This is how I start firefox
now:

firefox & Gecko2Browser

and in Gecko2Browser I wrote
----------------8<----------------------
#!/bin/sh
BROWSER=$(ratpoison -c windows|grep Browser)
if [[ -n "$BROWSER" ]]; then
 exit;
fi

GECKO=$(ratpoison -c windows|grep Gecko|head -1)

while [[ -z "$GECKO" ]]; do
  GECKO=$(ratpoison -c windows|grep Gecko|head -1)
done;

GECKO_NUMBER=$(echo $GECKO|sed -e 's/\(-\|+\|\*\).*//');
ratpoison -c "select $GECKO_NUMBER" && ratpoison -c 'title Browser'
---------------->8----------------------

Come to think of it ratpoison is not the proper place to do this
(renaming the first instance of a window) as it'd be a waste of CPU
cycles as it has to check for every new instance of any window.  Doing
it using the shell script is the way to go since it is called only
when I specifically run firefox (or any other window).

Regards,

Nazri




reply via email to

[Prev in Thread] Current Thread [Next in Thread]