Forum › Forums › General › Tips and Tricks › Autostart applications help please
- This topic has 40 replies, 7 voices, and was last updated Oct 25-12:32 pm by ModdIt.
-
AuthorPosts
-
October 23, 2020 at 2:21 pm #43555Member
Xecure
::Ok. I think I now understand a bit better. It will not use the window manager preferences (but save it’s own state in the file you mention), but will still obey wmctrl commands (as these commands are “ordered” to the window manager, which controls the windows).
dreaming maybe. If these settings could be controlled with a gui controlled bash script that would provide a WM agnostic solution, work on other linux flavours too.
I think a gui solutions would only work for libreoffice products, as they do things differently, and wouldn’t be useful for other programs or WMs.
What PPC and BobC were suggesting is to use a script (BoBC named it wmadjust) to tell, in the moment of running it, what position and dimensions the window should take. It uses wmctrl, which talks to the window manager and should tell it how to move and resize, but it must be run at that moment in time (it wouldn’t work for “remembering” geometry for future launches, but would only work when called).Based on the wikipedia article: https://en.wikipedia.org/wiki/Wmctrl
wmctrl is a command used to control windows in EWMH- and NetWM-compatible X Window window managers. Some of its common operations are list, resize, and close window. It also has the ability to interact with virtual desktops and give information about the window manager. wmctrl is a command-line program, however, it has some functions that allow the mouse to select a window for an operation.
[…]
Compatible window managers
[…]
IceWM
Xfwm ≥ 4 (the default WM for Xfce)
Fluxbox ≥ 0.9.6
[…]So, using wmctrl would be window manager independent.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.October 23, 2020 at 2:38 pm #43556ModeratorBobC
::Xecure or PPC, One thing that I think I could have done better in the code was how to identify the right window to change. Could either of you suggest a better method there?
Whether that is useful for controlling the LO windows remains to be seen at this point, depending on whether Xecure’s un-maximizing and then resizing works or not. If that does work, I think its a better solution than altering the LO xml file. I see that as a last resort. I also am worried that we might lose other settings if we have a standard version of the xml that we overlay before starting the programs.
October 23, 2020 at 3:43 pm #43559Member
Xecure
::Xecure or PPC, One thing that I think I could have done better in the code was how to identify the right window to change.
I use the icewm-remember-settings script you built to get the class and name. For libreoffice writer, it displays it as “libreoffice-writer”, so using that in:
wmadjust libreoffice-writer 2 1003 1180 908 0
should work (if there is only one instance of libreoffice writer running).antiX Live system enthusiast.
General Live Boot Parameters for antiX.October 23, 2020 at 6:53 pm #43566MemberModdIt
::Hi all,
one addition, after renaming the libreoffice config in home so it gets recreated I get an automatic
start on correct desktops with BobC script. I can resize the window but it jumps back to fullsize as soon
as any other window opens on same desktop, that includes console.put more hours in to this, up to now i have only found that controlling LO window size is working with application
settings. or crazy workaround through start center.Thanks to all for helping,
October 23, 2020 at 9:54 pm #43578ModeratorBobC
::Doing it Moddit’s way, we would one time delete the config, then open the programs with the startup script, then fix the window sizes and positions, then close the programs, and SAVE save the resulting file as a MASTER config file…
Then in the startup we would save the previous config (just in case), and then replace it by copying the MASTER, and then start the programs using the copy of the master config. This does mean that other configuration changes made after that point would be lost the next time you log in.
Hows that sound?
PS: We could also make an Update LibreOffice MASTER config script that would take the current config and replace the MASTER with it…
- This reply was modified 2 years, 6 months ago by BobC.
October 23, 2020 at 10:31 pm #43583MemberModdIt
::Thanks for the info Bobc,
earlier I had made a master config, that works if registrymodifications.xcu is substituted.
For now that file is set read only in my config which is not ideal but leaves me feeling a bit safer.While experimenting and searching for a way to get wished for behaviour i broke LO setup several times.
Old versions saved the dimensions of individual application windows on closure. No proof when it changed
but my guess is with 7, reason why I never noticed it before is I just resized to need and read off the
window dimension, added to autostart and thought it worked. talk about blind.While testing the Beta version config was not renewed so i did not pick up this “affect new setup issue”.
Here is a case where a bug report to LO Org from high level might be helpful, more chance of action
than if I register as a new member and report. this issue could end up being blamed on antix or MX by
ill informed frustrated users, not good.If the save dimensions on quit behaviour could be restored in a bugfix release that would probably be the most
satisfactory solution for all users.A deb 64 bit version directly downloaded from libreoffice org exhibits same behaviour, so the backport is not
the culprit.- This reply was modified 2 years, 6 months ago by ModdIt.
October 24, 2020 at 4:48 am #43603ModeratorBobC
::1. I did a fresh install of 19.3 full
2. Then I did an update and dist-upgrade to get newest code.
3. Then I went to ~/.icewm and added 2 workspaces so now I have 4, and restarted IceWM to activate them.
4. Then I went to the Package Installer and installed the latest LibreOffice Main (version 7.0.2-2). I see there was no ~/.config/libreoffice at that point.
5. Then I ran calc and writer from the menu, moved them to different workspaces and changed the window sizes and positions of each, then exited each
6. Now I see there is a ~/.config/libreoffice/4/user/registrymodifications.xcu and copy that to MASTERregistrymodifications.xcu.
7. From now on, at startup, I will restore the MASTER version to the normal file, thus restoring my configuration, so I go edit my ~/.icewm/startup to do that
8. I also add all the other application startups (I will paste in the code when it works)I found that LibreOffice applications didn’t respond to wmctrl window size and position requests, even if they weren’t full screen. Until we find a way to control them programmatically, I think the best option is to save a MASTER configuration as the default and restore it at startup.
Ok, here is the code. Remember the first time to go into LibreOffice and size and position the windows where you want them. The next time you log in it will copy that to the MASTER. You should leave any working winoptions for palemoon and claws-mail in place. It keeps one saved copy of the config just in case, and makes a little log file of whay/what it did in case of trouble.
I’m not really a Linux coder, so coders please forgive my flaws and feel free to suggest as I learn by doing with improvement from constructive criticism 🙂
~/.icewm/startup
#!/bin/bash # SWITCHDELAY = short delay in seconds before loading app to allow workspace to switch first SWITCHDELAY=2 # LOADDELAY = long delay in seconds after starting large apps before switching workspace LOADDELAY=10 # save current libreoffice 7.0.2-2 configuration (just in case) and restore master cd ~/.config/libreoffice/4/user ls -l > beforestart.txt CURRENTLOXML=registrymodifications.xcu MASTERLOXML=MASTERregistrymodifications.xcu SAVELASTLOXML=SAVELASTregistrymodifications.xcu if [ -f $CURRENTLOXML ]; then echo "Found current config: $CURRENTLOXML " >> beforestart.txt if [ -f $SAVELASTLOXML ]; then echo "Removing saved config: $SAVELASTLOXML " >> beforestart.txt rm -f $SAVELASTLOXML fi echo "Saving current config: $CURRENTLOXML $SAVELASTLOXML " >> beforestart.txt cp $CURRENTLOXML $SAVELASTLOXML if [ ! -f $MASTERLOXML ]; then echo "No master config found, copying current to become master: $MASTERLOXML " >> beforestart.txt cp $CURRENTLOXML $MASTERLOXML fi fi if [ -f $MASTERLOXML ]; then echo "Found master config: $MASTERLOXML " >> beforestart.txt if [ -f $CURRENTLOXML ]; then echo "Removing current config: $CURRENTLOXML " >> beforestart.txt rm -f $CURRENTLOXML fi echo "Restoring master config: $MASTERLOXML $CURRENTLOXML " >> beforestart.txt cp $MASTERLOXML $CURRENTLOXML fi ls -l >> beforestart.txt cd ~/ wmctrl -s 3 #Switches to workspace =4th workspace sleep $SWITCHDELAY && libreoffice --norestore --calc & sleep $LOADDELAY && wmctrl -s 2 #Switches to workspace =3rd workspace sleep $SWITCHDELAY && libreoffice --norestore --writer & sleep $LOADDELAY && wmctrl -s 1 #Switches to workspace 1=2nd workspace sleep $SWITCHDELAY && palemoon & sleep $LOADDELAY && wmctrl -s 0 #Switches to workspace 0=1st workspace sleep $SWITCHDELAY && claws-mail &You might also consider/try adding my internet connection test at the end of the startup so if the student isn’t connected it pops up the screen to get connected
# test internet connection and bring up connman if not connected # Give it a chance to connect, then test for connection sleep 3 connected_addr=$(ip addr | grep "inet " | sed '/ scope host /d') if [ -z "$connected_addr" ]; then cmst -d & fi- This reply was modified 2 years, 6 months ago by BobC.
- This reply was modified 2 years, 6 months ago by BobC.
- This reply was modified 2 years, 6 months ago by BobC.
October 24, 2020 at 6:50 am #43607ModeratorBobC
::Ok, I have tested it, and no known problems at this point. Let me know if it helps or any comments or suggestions.
October 24, 2020 at 7:57 am #43609MemberModdIt
::@BobC,
Fresh download, fresh install in the late hours last night. MX and Manjaro as expected same issue.thanks, your solution is way more elegant than what I have up to now, just wish LO would not make users
jump through hoops this way. As a normal user usage would have been an absolute no go for my desktop system,
I also have a pretty big screen and like to work with several windows open. 2 A4 size next to each other as norm.
Even on my laptop it is a pain, 1600*900 resolution.
My netbook is an EEPC, on that i would never have noticed the problem.Really wonder if LO devs are living in the past or perhaps on anchient office hardware, still typical in many parts
of the world. Most of asia runs on XP.Fresh download, fresh install in the late hours last night. MX and Manjaro same issue.
October 24, 2020 at 12:35 pm #43617ModeratorBobC
::My guess I’d that they are using the same code for Windows and the way it is works fine there. Hopefully what I posted above is reasonable. We could also make a little script to update the master from current for when you want to change the defaults.
I did find one post with some more info, along the lines of what I found. I would guess those window sizing lines could be replaced with defaults in the xml file programatically if that was needed. I don’t think it is, but it would be an option.
https://askubuntu.com/questions/1159377/libreoffice-calc-initial-window-size-problemI guess I’ve done what I was trying to do. If you find any problems with it or have any suggestions for improvement, let me know. The only one I can think of would be to add a menu option to save the current settings as the default from the menu, rather than messing with files by hand. I’m not sure if you actually want or need that ability in your environment, though.
- This reply was modified 2 years, 6 months ago by BobC.
October 25, 2020 at 12:32 pm #43709MemberModdIt
::Hallo Bobc,
thanks for the help, the script is working fine on my box but the issue more complex than it looked at first,
now better for me to work with it as is, then add my daughter as tester, maybe her boyfriend too, if I can
persuade him to join us.
No chance of a group hack and test due pandemic .I think the situation on windows is far worse, multiple desktops sort of work on win 10 but we are looking for
more.I have been told the libreoffice move to start center dependance is part of the strategy which has of late
caused consternation in the community. Big wave on Private Edition Splash and paid model discussion.Some of the talk was for as model which if it came would have been more expensive for users than Softmaker Office.
The School can get that for free so for group ambition antiX with LO, the publicity was badly received.
——————————————————————————————————————–I have stopped the splash screen showing on application start, that is done in /etc/libreoffice/sofficerc
For my usage case I have set
CrashDumpEnable=false #Crash dump is a big risk for the admin on kids computers.
HideEula=0 #No need for that every start
Logo=0 #No need for that every start and speeds up loading slightlyYour comment: I would guess those window sizing lines could be replaced with defaults in the xml file programatically
points to the best possible solution if that could be done early enough in start.
Most users just save files and shutdown instead of closing applications and then the LO start center. I do the same,
which is one reason why we use noresore start parameter. Without that we get document recovery come up, it seems less
of a nuisance to just open what we need i.e. for current class or assignment.
Autosave is set to 3 minutes so even if saving gets forgotten there should be little data loss.I had seen the post in Buntu Forum, thanks for the url addition, could be useful later.
-
AuthorPosts
- You must be logged in to reply to this topic.