Score:3

Opening a spreadsheet at startup on LibreOffice in Ubuntu studio 21.04

fr flag

I have Ubuntu Studio 21.04 installed and I want to open a spreadsheet automatically when I log in. I've included LibreOffice calc in the autostart applications, but I can't get it to open up the spreadsheet, just the application with a blank spreadsheet. I've edited the autostart properties for the application so they point to the spreadsheet:

'soffice --calc -o ⁄home⁄chris⁄Documents⁄Spreadsheets⁄Top\ 250\ films.ods'

If I run this command from the terminal, the spreadsheet opens as expected, but not in autostart. I've tried single quote, double quotes and using backslashes in file name, all give the same result.

What am I doing wrong?

FedKad avatar
cn flag
In your question the string contains Unicode slash ⁄ and not the ASCII slash /. Replace the string with the following: `'soffice --calc -o /home/chris/Documents/Spreadsheets/Top\ 250\ films.ods'`
Score:10
cn flag

Your string is:

'soffice --calc -o ⁄home⁄chris⁄Documents⁄Spreadsheets⁄Top\ 250\ films.ods'

whereas it should be

'soffice --calc -o /home/chris/Documents/Spreadsheets/Top\ 250\ films.ods'

Do you see the difference? Probably no. If you cannot see the difference, then echo the string to cat -t and you will:

$ echo 'soffice --calc -o ⁄home⁄chris⁄Documents⁄Spreadsheets⁄Top\ 250\ films.ods' | cat -t
soffice --calc -o M-bM-^AM-^DhomeM-bM-^AM-^DchrisM-bM-^AM-^DDocumentsM-bM-^AM-^DSpreadsheetsM-bM-^AM-^DTop\ 250\ films.ods
$ echo 'soffice --calc -o /home/chris/Documents/Spreadsheets/Top\ 250\ films.ods' | cat -t
soffice --calc -o /home/chris/Documents/Spreadsheets/Top\ 250\ films.ods

You are using the Unicode Fraction Slash character as directory separator, while you must use the ASCII Slash character.

Score:0
fr flag

FedonKadifeli's answer was correct in that the wrong characters were being used causing the autostart to fail. I noticed that even if I pasted or typed the correct characters into the autostart GUI, it changed them to the wrong ones.

Since I had noticed that the command worked fine from the command line, I made a workaround by putting it into a shell script and start that from the autostart. The contents of my shell script were as follows:

#!/usr/bin/env bash

soffice --calc -o /home/chris/Documents/Spreadsheets/Top\ 250\ films.ods

I don't know if this workaround has any downsides, so I'll accept it as an answer to my question.

vanadium avatar
cn flag
Please credit the person that helped you see your mistake, and accept the answer of FedonKadifeli.
FedKad avatar
cn flag
I have the same version of Ubuntu and I tried to put a similar command into the "Startup Application Preferences". Name: `xxx`. Command: `soffice --calc -o /home/fedon/x\ y\ z.ods`. Comments: Empty. Please note that _there are no single quotes around the command_. The Calc sheet specified in the entry was opened and displayed with no problem after login. I have no idea why your system is changing your slashes.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.