4

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?

1
  • 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' – FedonKadifeli Jun 20 at 15:13
10

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.

0

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.

2
  • Please credit the person that helped you see your mistake, and accept the answer of FedonKadifeli. – vanadium Jun 21 at 6:30
  • 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. – FedonKadifeli Jun 21 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.