Shorten very long window title

Do you want to see truncated window titles over a certain length?

  • Yes, I want truncated window titles over a certain length
  • No, that’s absured!

0 voters

[color=blue]

–> Edit by ThomasAdam (20050228)

Added Poll. PLEASE read the guidelines before creating new threads here. There have been an ever increasing number of people not doing so. If it happens again, I’ll lock this section.
[/color]

when i meet a very long title, the “RightEnd” of window title will be discarded. Can we shorten the long title “a very very very ve veryry very very very very long title” to “a very very very…title”?

Please read this before posting here. It asks that you make a poll out of a future request… If you would be so kind as to add a poll.

tia :slight_smile:

thx :blush:

this feature might be realized via piperead.

just the way it could be done maybe, no code yet:

Add a function that will be executed after a window is opened.
Open a pipe to wmctrl, passing the window-ID

something like
F=echo $windowname |sed "s/\(..........\).*/\1/"|wmctrl -i -r $windowid -N $F

This would replace the windowname with the first 10 characters of the windowname.

You will need to install wmctrl to get this working:
sweb.cz/tripie/utils/wmctrl/

I don´t know how to integrate this command to fwm via piperead, maybe more advanced fvwm-users have an idea?

Greets, Mark

yes, works with slight changes.

This reduces the length of the name, when the window is maximized.
You will have to add it to a handler that is used, when a window is created from new, I don’t know how it is called.

And don’t forget to compile wmctrl.

AddToFunc   FuncFvwmMaximize
+ I PipeRead \
"F=`echo $[w.name] |sed \"s/\\(..........\\).*/\\1/\"`&&wmctrl -i -r $[w.id] -N \"\$F\""

Mark

Like this you also can create XTerms with no titletext.

My XTerm-titles begin with mark@terminatux

So I use this function instead:

AddToFunc   FuncFvwmMaximize
+ I PipeRead \
"F=`echo $[w.name] |sed \"s/^mark.*//\"`&&wmctrl -i -r $[w.id] -N \"\$F\""

This looks nice, if you have a titlebar on the left side, not on Top:

nifty, this is good old Fvwm :slight_smile:

Mark

You could also just do:

xttitle ''

– Thomas Adam

Oh, thanks Thomas.

here is a solution with fvwm:

I use this on Fvwm-themes, and have put this code to
/usr/share/fvwm/themes/mac-like/windowlook

It should be possible to place it in any of the configs, and should work with fvwm2 too.

Like this the text of the menue-title of new windows is limited to 20 characters when the window is created.

Module FvwmEvent
*FvwmEvent:     PassId
*FvwmEvent:     add_window OnAddWindow

AddToFunc OnAddWindow
+ I PipeRead \
"F=`echo $[w.name] |sed \"s/\\(....................\\).*/\\1/\"`&&wmctrl -i -r $[w.id] -N \"\$F\""

Greets, Mark