FVWM: SetTitleFormat

From: Tavis Ormandy <taviso_at_sdf.lonestar.org>
Date: Tue, 22 Feb 2005 23:59:27 +0000

I've been interested in changing the titles of some windows that don't
set a useful name, I thought some other users might find it
interesting...

It probably won't work on all windows, but it at least the fixed the
ones I needed to change :)

AddToFunc StartFunction I FvwmEvent FvwmEvent-Title

*FvwmEvent-Title: add_window SetTitleFunc
*FvwmEvent-Title: property_change SetTitleFunc

DestroyFunc SetTitleFormat
AddToFunc SetTitleFormat I AddToFunc SetTitleFunc I ThisWindow ($0) PipeRead \
    'echo "Exec xprop -id $[w.id] -set WM_NAME \'$1\'" | sed \
        -e "s#%t#$[w.name]#g" \
        -e "s#%i#$[w.iconname]#g" \
        -e "s#%I#$[w.id]#g" \
        -e "s#%c#$[w.class]#g" \
        -e "s#%w#$[w.width]#g" \
        -e "s#%h#$[w.height]#g"'

SetTitleFormat XTerm "This is an %c, it is %wx%h, id: %I"
SetTitleFormat XCalc "1+1=2"

Which set's the title on xterm's to something like

        "This is an XTerm, it is 644x340, id: 0x3400003"

It could easily be adopted to set iconname on iconify or similar if
required :)

-- 
-------------------------------------
taviso_at_sdf.lonestar.org | finger me for my gpg key.
-------------------------------------------------------
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Feb 22 2005 - 18:00:34 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST