Bug 372153 - Autostart wrong command string
Summary: Autostart wrong command string
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_autostart (show other bugs)
Version: 5.8.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-06 18:17 UTC by Lukas Ba.
Modified: 2020-08-11 20:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Ba. 2016-11-06 18:17:53 UTC
When adding firefox to the autostart list, by clicking on it in the list of applications, the command string is configured as "firefox %u" by systemsettings.

This causes firefox to start with the address "http://%u", instead of the startpage configured in firefox, thus firefox shows the "Server not found page" instead of the startpage.

When trying to manually change the command string to "firefox" from "firefox %u", systemsettings changes it back to "firefox %u" after clicking on OK.
Comment 1 Harald Sitter 2016-11-22 12:19:27 UTC
Pretty sure this is a bug in ksmserver's startup.cpp

which calls
```
        auto p = new QProcess(this);
        p->start(service.exec());
```

naturally disregarding the unique format of Exec in desktop files. It probably should be using KRun::runApplication
Comment 2 Harald Sitter 2016-11-22 13:04:18 UTC
Git commit 889be45e893425273d545a73edc42c4bbead446d by Harald Sitter.
Committed on 22/11/2016 at 13:04.
Pushed by sitter into branch 'Plasma/5.8'.

properly parse exec line before qprocessing it for autostart

Summary:
CHANGELOG: Repaired autostart of desktop files with place holders
FIXED-IN: 5.8.4

Test Plan:
- add firefox.desktop to autostart
- make sure it autostarts without errors on next login

I really wish we had a framework to test this in isolation :/

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3454

M  +8    -1    ksmserver/startup.cpp

http://commits.kde.org/plasma-workspace/889be45e893425273d545a73edc42c4bbead446d
Comment 3 Lukas Ba. 2016-12-17 23:28:53 UTC
The fix is working.
However, the command is still shown as "firefox %u", which is not the command that is executed.
Comment 4 Lukas Ba. 2016-12-17 23:45:38 UTC
You might want to look at https://bugs.kde.org/show_bug.cgi?id=357027 after this.
Comment 5 Lukas Ba. 2016-12-17 23:59:25 UTC
This is not solved.
When changing the command string by editing the settings, additional arguments are ignored.
For example, adding this argument to start thunderbird with the addressbook open

thunderbird -addressbook

does start thunderbird, but does not open the addressbook.

This might be related to the takeFirst() method, if it works as i'm thinking it does, it ignores any arguments but the first one.

auto program = arguments.takeFirst();
Comment 6 Lukas Ba. 2016-12-18 00:02:30 UTC
Upon further inspection i think that my comment about

arguments.takeFirst()

is wrong, but the problem still exists.
Comment 7 Nate Graham 2020-08-11 20:39:36 UTC
This is fixed in the rewrite which will be released in Plasma 5.20!