VSIDO Community

VSIDO Support => WM Designs and Discussions => Topic started by: Snap on October 04, 2015, 04:39:00 PM

Title: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on October 04, 2015, 04:39:00 PM
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.
Code: [Select]
[group] (workspace=[current])
  [app] (name=libreoffice) (class=libreoffice-writer)
[end]

Or this:

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

Tried some other variations including this ignoring workspaces:

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

Still not working. Is Libreoffice different than the usual windows or am I missing something?
Title: Re: Cannot group Libreoffice Writer windows
Post by: PackRat on October 04, 2015, 05:55:30 PM
The first one should have worked for you.

Code: [Select]
[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]

(http://en.zimagez.com/miniature/libreoffice-scrot.png) (http://en.zimagez.com/zimage/libreoffice-scrot.php)

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:

Code: [Select]
[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.

Code: [Select]
[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]
Title: Re: Cannot group Libreoffice Writer windows
Post by: Snap on October 04, 2015, 09:12:52 PM
Thanks a lot, PackRat. I'll check all this tomorrow and report back. My eyes are falling off. Need some sleep now.
Title: Re: Cannot group Libreoffice Writer windows
Post by: Snap on October 05, 2015, 04:30:23 AM
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:

Code: [Select]
[app] (name=libreoffice) (class=LibreOffice 5.0)
Then the logout stops, but the grouping doesn't work either. back to the original simple thing

Code: [Select]
[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.  ::)
Title: Re: Cannot group Libreoffice Writer windows
Post by: Snap on October 05, 2015, 04:50:05 AM
This is what I'm getting now using save on close:

Code: [Select]
[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.
Title: Re: Cannot group Libreoffice Writer windows
Post by: Snap on October 05, 2015, 04:53:25 AM
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.  ::)

Code: [Select]
[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:

Code: [Select]
[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!
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on February 29, 2016, 10:37:42 AM
New LO 5 update: apps grouping behavior f***ed up again. Damnit. name and class have apparently reverted to the old specs. xprop says:

Code: [Select]
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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on February 29, 2016, 02:46:22 PM
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) -

Code: [Select]
[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 -

(http://en.zimagez.com/miniature/libreoffice-group.png) (http://en.zimagez.com/zimage/libreoffice-group.php)
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 01, 2016, 08:39:30 AM
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!
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 01, 2016, 09:08:51 AM
Still no joy. Everytime I use save on Close this is created into apps

Code: [Select]
[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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 01, 2016, 09:18:53 AM
Went back to the libreoffice 5.0 settings changing the version for 5.1 like this.
Code: [Select]
[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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on March 01, 2016, 01:11:41 PM
@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:

Code: [Select]
[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.

Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 02, 2016, 06:10:31 AM
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.

Code: [Select]
[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

Code: [Select]
[app] (name=libreoffice) (class=LibreOffice 5.1) (role=libreoffice-calc)
or

Code: [Select]
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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on March 02, 2016, 01:05:31 PM
Yes, these lines are your issue -

Code: [Select]
(class=LibreOffice 5.1)
I'm assuming that the missing "[" is just a typo -

Code: [Select]
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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 02, 2016, 07:13:58 PM
Ooops... yes, that was a typo, sorry. It's ok in the file.

Quote
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.

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

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

Code: [Select]
Mod4 r :Exec lowriter
Gonna check my wirter desktop file just in case... Done. the libreoffice-writer.desktop launcher runs this command:

Code: [Select]
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.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 02, 2016, 07:27:48 PM
No luck. Deleted all libreoffice entries in apps and switched the command in keys to Exec=libreoffice --writer. Then using the Remember option still adds:

Code: [Select]
[app] (name=libreoffice) (class=LibreOffice 5.1)
I'm really stuck here... I don't care is spreadsheets doesn't group at all, but I don't want them grouped with the writer windows. I want different sizes for both types of documents. This is annoying.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on March 02, 2016, 07:43:01 PM
Have you always installed libreoffice from apt?

If you have ever installed from the libreoffice.org deb files (maybe a long time ago), check that you don't have two versions installed and the symlinks are all good.

Results from using the window menu, new user:

Code: [Select]
[app] (name=libreoffice) (class=libreoffice-writer)
  [Position] (UPPERLEFT) {6% 7%}
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {yes}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]
[app] (name=libreoffice) (class=libreoffice-calc)
  [Shaded] {no}
  [Deco] {NORMAL}
  [Sticky] {no}
  [Minimized] {no}
  [Maximized] {yes}
  [Fullscreen] {no}
  [Layer] {8}
  [Alpha] {255}
[end]
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on March 02, 2016, 07:52:20 PM
If you manually edit the class name, does it revert back to LibreOffice 5.1?
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 03, 2016, 05:26:17 AM
Yes, I installed it from the repos with apt. I've Never used the libre office sources.

Quote
If you manually edit the class name, does it revert back to LibreOffice 5.1?

Nope. It remains the same, Only grouping stops working unless I change the class to LibreOffice 5.1 again. That's weird. Will try a new user just in case. Thanks for all the support, PackRat.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on March 07, 2016, 09:25:12 PM
There is an upgrade for LibreOffice today (7 March).

Something else you could try, although a bit drastic, would be to purge LibreOffice (with the --remove option if you use the command line) and then do a reinstall.

I did clean installs on both my systems since you started thread and got the recent LibreOffice; maybe you have some configuration file persisting through the upgrades that's messing this up for you.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: Snap on March 08, 2016, 06:48:03 AM
I noticed the new update today while distro-upgrading a few minutes ago. Will check how it behaves. I have some old configs for sure. Maybe it's that the issue. A fresh re-isntall might help. Thanks so much for you constant help, PackRat.
Title: Re: Cannot group Libreoffice Writer windows [SOLVED]
Post by: PackRat on February 08, 2018, 05:58:26 PM
grouping libreoffice (http://vsido.org/index.php?topic=1370.msg15642#msg15642)