Libre Office document recovery at startup

After an update to 25.8.4.2 on startup Writer no longer offers a list of documents to recover that I had open when I shut down. Now all I get is a blank document. I have done a lot of searching but apart from posts asking how to disable the feature I can find nothing on how to enable it.
I’ve tried opening in safe mode but the same happens. Or rather doesn’t. So it is probably not the profile.

Some posts refer to an option in Load/Save to reload files that were open at the time of the last shutdown, but this is not present in my version.

This is specifically when you shut down your computer with a document open in Writer?

I just tried opening a file in Writer, edited it, then did ‘pkill soffice’ to kill it - then when I open writer, I got the option to recover that document.

You can try creating a new USER to confirm that you have a bug, otherwise it’s your ~/USER files.

1 Like

I work with a variety of documents during the day, and find it useful to have them ready to hand, rather than searching through my files for them each day. I am not trying to “recover” files, just open them. They are open when I shut down at night, and it is useful to have them ready when I start up. They have all been saved, often days before.

Your “pkill soffice” does the trick. Maybe I can do that every night. Or put it in a shutdown script. I’ll look at the USER.

No, that’s a bad way to close it… the ‘recovery’ is for a BAD SHUTDOWN…

When you shut down your computer, it should close gracefully - and you should find your files in the recent list -

AltFU (files are indexed, press the number).

The “recent” list is files I have worked with recently, many more than the ones I want to load. I just want to recover the functionality I had yesterday. Perhaps that version was not closing tidily. I could put in a suggestion to put the option to reload files that were open at the time of the last shutdown back into Load/Save. I can’t be the only person to value it.

1 Like

You’re right, there was a request for a session manager…

Kate has great implementation in this regard with sessions/pinned documents.

So I guess the next best thing might be to drag your files and create links in a Desktop/session folder and open them all that way… as linked files save to the original location.

Ok, this works:

  1. mkdir ~/Desktop/writer-session
  2. Drag to link what you want to open.
  3. libreoffice --writer ~/Desktop/writer-session/*

It literally opens all documents in the folder. I just tried it with an .ods file in my documents, an .rtf file in my Notes and a .docx file from my downloads folder my wife sent last week. Dragged shortcuts to the folder on desktop…

:brain: Nerdy Solution

Let’s make the folder ‘Office session’… and include any files (spreadsheets or whatever).

#!/bin/bash
# Script to open all documents in ~/Desktop/office-session with LibreOffice

SESSION_DIR="$HOME/Desktop/office-session"

# Check if the directory exists
if [ -d "$SESSION_DIR" ]; then
    # Use LibreOffice to open all files in the folder
    libreoffice "$SESSION_DIR"/*
else
    echo "Directory $SESSION_DIR does not exist."
    exit 1
fi

Save this (name ‘roffice’ for ‘resume office’ or whatever…) and do chmod +x

If you drag that to make a link in ~/.local/bin you can just run ‘roffice’.

That’s gonna work from terminal, also from krunner.

If you get creative, you could make separate folders.

Ok, I’m writing a novel and have notes… ~/Desktop/Office/novel and notes.

Also my sales spreadsheet and customer documents /sales

Then some social media stuff /media

#!/bin/bash
# Script to open documents from a chosen session folder in ~/Desktop/Office

BASE_DIR="$HOME/Desktop/Office"

# Check if base directory exists
if [ ! -d "$BASE_DIR" ]; then
    echo "Directory $BASE_DIR does not exist."
    exit 1
fi

# Gather subfolders
folders=("$BASE_DIR"/*/)
if [ ${#folders[@]} -eq 0 ]; then
    echo "No session folders found in $BASE_DIR."
    exit 1
fi

# Display menu
echo "Select a session to open:"
for i in "${!folders[@]}"; do
    folder_name=$(basename "${folders[$i]}")
    echo "$((i+1)). $folder_name"
done

# Read choice
read -p "Enter the number of the session: " choice

# Validate input
if ! [[ "$choice" =~ ^[0-9]+$ ]] || [ "$choice" -lt 1 ] || [ "$choice" -gt ${#folders[@]} ]; then
    echo "Invalid choice."
    exit 1
fi

selected_folder="${folders[$((choice-1))]}"
echo "Opening documents in: $selected_folder"

# Launch LibreOffice with all files in the chosen folder
libreoffice "$selected_folder"/*

Now any session folder you create will be picked up by the script, and you can select it on startup.

2 Likes

I’ve cc’d to Bug 117237.

Thanks. I’ll give that a go. But first lunch.

2 Likes

That works well. I’ll put it in a startup script.
Thanks.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.