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:
mkdir ~/Desktop/writer-session
- Drag to link what you want to open.
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…
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.