Cannot group Libreoffice Writer windows [SOLVED]

Snap

I want to group any/all the libreoffice writer windows in the current desktop but they are not responding. I can group them manually, of course, but they doesn't group automatically via the apps file.

If I'm not wrong, this seems to be the obvious config (it's what xprop outputs) but it does nothing.

[group] (workspace=[current])
  [app] (name=libreoffice) (class=libreoffice-writer)
[end]


Or this:

[group]
  [app] (name=libreoffice) (class=libreoffice-writer)
  [Workspace] {CURRENT}
[end]


Tried some other variations including this ignoring workspaces:

[group]
  [app] (title=.*odt - LibreOffice Writer)
[end]


Still not working. Is Libreoffice different than the usual windows or am I missing something?

PackRat

#1
The first one should have worked for you.

[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-writer)
[app] (name=libreoffice) (class=libreoffice-calc)
  [Position] (UPPERLEFT) {4% 3%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {no}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]




Normally you do not have to restart fluxbox for changes in the apps file to take effect, but you can try that.

How are you opening your libreoffice documents? Only other thing that comes to mind is that libreoffice is also assigning a unique role to your documents and you may need to account for that in the apps file.

Open a couple of documents in your usual way and then right click on the title bar to get the window menu. Use the Remember option to assign some per-app conditions. After that, open the ~/.fluxbox/apps file and how fluxbox defined the name, class, and role (if any). Post the results, please.

Are your other apps grouping, sizing etc ...? Proof read your ~/.fluxbox/apps file - if I remember correctly, if there is an error in the file (like a missing [end]) then fluxbox stops there, so the applications listed before the error behave as expected, anything after the error is not read.

Edit Number 1 - This is new -


I created a couple of documents and then opened them up to assign some per-app settings; got this line:

[app] (name=libreoffice) (class=LibreOffice 5.0)

Apparently if the document is not blank, it is assigned a different class name. Adding that line to the groups stanza fixes the issue so blank and existing docs/spreadsheets group.

[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-writer)
[app] (name=libreoffice) (class=libreoffice-calc)
[app] (name=libreoffice) (class=LibreOffice 5.0)
  [Position] (UPPERLEFT) {4% 3%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {no}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

Thanks a lot, PackRat. I'll check all this tomorrow and report back. My eyes are falling off. Need some sleep now.

Snap

#3
Don't know what's going wrong with my Fluxbox and LibreOffice. Adding your last bit of code (copy-paste, so no mistakes) makes the session to logout if I click to open any odt file. If I remove lines one by one nothing changes untill I remove this line:

[app] (name=libreoffice) (class=LibreOffice 5.0)

Then the logout stops, but the grouping doesn't work either. back to the original simple thing

[group] (workspace=[current])
  [app] (name=libreoffice) (class=libreoffice-writer)
[end]


Does nothing.

Been checking the apps file for errors and haven't found any. Going to double check. This is really weird. The other apps work as expected.  ::)

Snap

This is what I'm getting now using save on close:

[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-writer)
  [Position] (UPPERLEFT) {4% 3%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {no}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]


But they don't group together. Just got stacked.

Snap

#5
Hey, it works now. pasting this code and then enabling save on close did it. Don't ask me why... haven't done anything different.  ::)

[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-writer)
[app] (name=libreoffice) (class=libreoffice-calc)
[app] (name=libreoffice) (class=LibreOffice 5.0)
  [Position] (UPPERLEFT) {4% 3%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {no}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]


Hold on... I (maniac me) added a space before [app] (name=libreoffice) (class=LibreOffice 5.0) to keep the indentation "right". Well, that space borks it! They must be aligned like this:

[app] (name=libreoffice) (class=libreoffice-writer)
[app] (name=libreoffice) (class=libreoffice-calc)
[app] (name=libreoffice) (class=LibreOffice 5.0)


That last line doesn't like indentation. It actually made fluxbox crash here.

I always wondered why apps file indentation is sometimes irregular or uneven and tried to "fix it". It seems that the irregular indentation matters. And might explain why trying to add/change things in apps in a "tidy" way sometimes drove me crazy. Lesson learned. Don't touch the indentation!

Snap

New LO 5 update: apps grouping behavior f***ed up again. Damnit. name and class have apparently reverted to the old specs. xprop says:

WM_CLASS(STRING) = "libreoffice", "libreoffice-writer"

as they were in the good times of LO 4, but for now I haven't managed to group these suckers. keep on trying... tips will be welcome... or in other words, Packrat, please....  ;D

Side note: I keep missing LO 4. the upgrade from LibreOffice3 to 4 was great and a big improvement. Since version 5 arrived I'm having a lot of unstability and crashes, plus these damned changes not playing well with fluxbox. Not happy at all. using LO4 in Jessie is still a joy. LO5 in Sid is just crap, at least here.

PackRat

#7
How did you get the update; with apt, or do you get the debs fro libreoffice?

Edit - I have those class names as well; so the debian repos have them. If the class names are unique again and contain the *-writer, *-calc specs, this should be a no-brainer. Give me a few.

Try this (edit to suit, except the first 2 lines of each stanza) -

[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-writer)
  [Position] (UPPERLEFT) {10% 12%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {no}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]
[group]  (workspace=[current])
[app] (name=libreoffice) (class=libreoffice-calc)
  [Shaded] {no}
  [Minimized] {no}
  [Maximized] {yes}
  [Fullscreen] {no}
[end]


Should work; you can right click the title bar and use the "Remember" submenu for most of the app settings add the [group] line manually -

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

Thanks so much, PackRat. Yes, the update came with apt. I don't use the LibreOffice sources. Just regular dist-upgrading. As I've said the last update stopped grouping working. Checked with xprop and found that names and classes were changed once adain.

Still no luck. Gotta edit your settings and let's see if I make it work. The time before the indentation proved to be relevant. Will try to play with that too.

BTW, what a cool document you made there LOL. That's a lovely lady!

Snap

Still no joy. Everytime I use save on Close this is created into apps

[app] (name=libreoffice) (class=LibreOffice 5.1)
  [Dimensions] {47% 85%}
  [Position] (UPPERLEFT) {26% 0%}
  [Layer] {8}
  [Close] {yes}
[end]


The class still has the former class format; LibreOffice 5.1 instead of libreoffice-appname (all lowercase) as reported by xprop. Weird and quite misleading.

Snap

Went back to the libreoffice 5.0 settings changing the version for 5.1 like this.
[group]  (workspace=[current])
[app] (name=libreoffice) (class=LibreOffice 5.1)
  [Head] {1}
  [Dimensions] {46% 78%}
  [Position] (UPPERLEFT) {24% 0%}
  [Deco] {NORMAL}
  [Maximized] {no}
  [Layer] {8}
  [Close] {yes}
[end]


Grouping now works but gathers everything together. Will try to find a way to leave at least Calc away from the group.

PackRat

@snap -

Remove all the entries for libreoffice and soffice in your ~/.fluxbox/apps file.

The file is read top-bottom so if there is a stray entry in there it will cause conflicts.

Then start up writer (or calc) by itself and use the "Remember" menu to set the preferences. This should create a clean entry in the ~/.fluxbox/apps file. Open the apps file and add the:

[group]  (workspace=[current])

line to group the open windows.

Then, open calc (or writer) and repeat the process - the previous selections will show in the "Remember" menu, but don't worry about that it will create a new entry based on the window class. You may need to select something on the list though, but that can be edited out.

Open (or reload) the apps file and you should see the new stanza there; add the line to group windows as above.

Should do it for you.

I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

#12
Thanks packRat. Just deleted all the libreoffice stuff from the apps file and started from scratch following your instructions. Ended up into the same point.

[group]  (workspace=[current])
[app] (name=libreoffice) (class=LibreOffice 5.1)
  [Dimensions] {46% 78%}
  [Position] (UPPERLEFT) {25% 0%}
  [Layer] {8}
  [Close] {yes}
[end]


All LibreOffice windows grouped together whatever the app. I need something distinctive like role, but xprop it's not providing roles for the LO apps. Using something like

[app] (name=libreoffice) (class=LibreOffice 5.1) (role=libreoffice-calc)

or

app] (name=libreoffice) (class=LibreOffice 5.1) (role=libreoffice-writer)

Borks the grouping.  :-\

IMHO the mismatching classes are the problem. xprop reports libreoffice-calc and libreoffice-writer for these particular windows, but LO itself wants to add class=LibreOffice 5.1 into the apps file for all of them.

PackRat

Yes, these lines are your issue -

(class=LibreOffice 5.1)

I'm assuming that the missing "[" is just a typo -

app] (name=libreoffice) (class=LibreOffice 5.1) (role=libreoffice-writer)

if not change that to [app].

So if you use the fluxbox "Remember" option in the window menu, it is saying the class is LibreOffice 5.1? That's odd because using those options yields "class=libreoffice-calc" etc ... for me.

How are you starting LibreOffice? Are you launching it so that the class name is pre-defined as part of some other attempt to group the windows?

Try this. Create a new user, log into the default fluxbox set up and launch an instance of LibreOffice (calc, writer, etc doesn't matter). Right click on the titlebar and use the window menu to create the per-apps settings.

Open a terminal and use xprop to get the class name for your LibreOffice application; compare it with what is being written to the apps file.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

Snap

#14
Ooops... yes, that was a typo, sorry. It's ok in the file.

QuoteSo if you use the fluxbox "Remember" option in the window menu, it is saying the class is LibreOffice 5.1? That's odd because using those options yields "class=libreoffice-calc" etc ... for me.

Really? Now that's weird...  ???

I normally simply click a file in SpaceFM and for new documents I use this keystroke.

Mod4 r :Exec lowriter

Gonna check my wirter desktop file just in case... Done. the libreoffice-writer.desktop launcher runs this command:

Exec=libreoffice --writer %U

Gotta play with the commands and check if it makes a difference. Maybe the good old lowriter way is not that good anymore.