>#!/bin/sh                                                                      
>                                                                               
> 
> if ! urxvtc "$@" ; then                                                       
>                                                                               
>    
>  echo "failed to start ($?), trying to start daemon"                          
>                                                                               
>    
>  urxvtd &                                                                     
>                                                                               
>    
>  sleep 1                                                                      
>                                                                               
>    
>  exec urxvtc "$@"                                                             
>                                                                               
>    
> fi                                                                            
>                                                                               
>    

The script can be improved by using the "-f" switch, which makes urxvtd
only fork _after_ creating the listening socket, i.e.:

  if ! urxvtc "$@" ; then
    urxvtd -f
    exec urxvtc "$@"
  fi

This will get rid of the sleep (which is likely the only annoying aspect
of the script operation).

On older versions of urxvtd, there was a faq entry to basically reach the
same goal without this switch.

-- 
                The choice of a
      -----==-     _GNU_
      ----==-- _       generation     Marc Lehmann
      ---==---(_)__  __ ____  __      [EMAIL PROTECTED]
      --==---/ / _ \/ // /\ \/ /      http://schmorp.de/
      -=====/_/_//_/\_,_/ /_/\_\      XX11-RIPE


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to