I have ubuntu 20.04 installed and I want that all users use the same template when create a new documents. This must be valid also for future new user that may be created in the system.
The template used when open a new document from anyhere. right-clicks in nautilus, aplications menu, menu inside libreoffice.
I want change this because installed ubuntu on work computer and all should use the same template for all documents. And i want migrate more computers
if you want to create a skeleton outline for new user folders, modify
etc/skel
which describes what is put into the newly created users home - this can have complex structures and hidden folders. You could place a copy in the Templates folder (in my Lidreoffice path, or in the appropriate .config path) Y9u can check paths you are using withTools -> Options -> Paths
in Libreoffice.This answer is relevant https://unix.stackexchange.com/questions/401362/can-i-write-a-template-for-creating-a-new-user
For existing users you could copy template into appropriate place either graphically or on command line depending on the number and your preferences. I am assuming you can sudo...
2 OPTIONS
Create your template as normal and save it... defaultwhatever.ott
Copy it to /usr/local/share .....or some other universally readable location and make sure your template is readable by all
chmod 744
.sudo /etc/skel/.bashrc
file and add...Save it... (but you'll have to manually add this entry to all of the current users' ~/.bashrc files, this only provisions the future users)
Then you will have to fix/create your launchers to use the alias you created.
OR INSTEAD
Locate your template file universally (as above)... /usr/local/share/defaultwhatever.ott (make sure it is readable by all,
chmod 744
)But instead of .bashrc,
sudo vi /usr/share/applications/libreoffice-writer.desktop
and edit the exec line:
Exec=libreoffice -n /usr/local/share/defaultwhatever.ott
Save and exit
...but this won't have an effect if you launch from the command line or custom launcher like on a MATE panel...(like the fist option would)
IN RESPONSE TO YOUR UPDATED QUESTION
I can't even think of a clunky way to pull off what you are asking. There are a couple more extreme possible solutions, but they are beyond what I am willing to explore(again)...
-You could see if there are any extensions that do this already or that would create an environment for you to accomplish it... https://extensions.libreoffice.org/
-You could get the source code and code your own personalizations.
-If you are familiar with mircosoft office products(Access,Excel,Outlook), all of those software have visual basic running behind them and you can manipulate the entire application through code. LibreOffice has the same thing. You would need to install the extension that gives you access to the viewer that helps all the code(objects) make sense(because there is no book)... I used MRI, I think there is one called X-ray too. This may be also called macros in libreoffice, I don't know... either way macros exist in libreoffice... if there is a way to put them in effect for every user, they may be an option.
-And related to the previous, you could make your own extensions... I do believe when you add an extension that you can have it apply to every user.... I believe this is a tutorial https://wiki.documentfoundation.org/Development/Create_a_Hello_World_LibreOffice_extension