Bug 401399

Summary: autostart a script from /.config/plasma-workspace/env won't work
Product: [Plasma] plasmashell Reporter: PK <pieterkristensen>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED WORKSFORME    
Severity: normal CC: lueck, plasma-bugs
Priority: NOR    
Version: 5.14.3   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description PK 2018-11-25 15:12:30 UTC
SUMMARY
When I place a script in the folder ~/.config/plasma-workspace/env, make the name end on .sh and make it executable it has no effect.

STEPS TO REPRODUCE
1. copy script "script.sh" in folder ~/.config/plasma-workspace/env folder
2. make it executable
3. or use the autostart gui tool

OBSERVED RESULT
No effect. The script is not executed.

EXPECTED RESULT
The script is executed on session startup

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Here https://docs.kde.org/trunk5/en/kde-workspace/kcontrol/autostart/index.html I read that this is a bug. But I can't find this bug rapport.
Comment 1 David Edmundson 2018-12-20 16:09:51 UTC
It works fine for me, I just retested it. 

I have no idea why our docs say otherwise.

can you put a script with the following two lines into your ~/.config/plasma-workspace/env folder:

#!/bin/sh
echo foo > /tmp/IAmRun

make it executable and see if that file exists after logging in.
If it does, our code is ok and there's something wrong with your script.

Note that scripts are sourced, which can make a slight behavioural difference to invoking.

If that doesn't work, we have a bug. Can I see the output of "env" after logging in, and ideally can you look into debugging the startkde script.
It's just a shell script, we load scripts at line 161
Comment 2 PK 2018-12-20 17:02:14 UTC
I also tried once more David. And here too it worked completely the way it was supposed to work.
I'm sorry to have taken some of your time and I wish you a pleasant ending of this year and a fantastic 2019!
Comment 3 Christoph Feck 2018-12-20 18:16:41 UTC
Thanks for the update; changing status. A separate commit will remove the outdated comment in the documentation.
Comment 4 David Edmundson 2018-12-20 22:17:58 UTC
NP. Thanks for reporting back.
Comment 5 David Edmundson 2018-12-20 22:26:37 UTC
Git commit fb1570f4804d289d4f7dc8adf367ac9c89d79f38 by David Edmundson.
Committed on 20/12/2018 at 22:26.
Pushed by davidedmundson into branch 'master'.

Remove outdated note about autostart not working

Summary:
Just tested, worked fine. That line has been there since 5.0 days, I do
vaguely recall fixing this at some point.

Reviewers: #plasma

Subscribers: plasma-devel, kde-doc-english

Tags: #plasma, #documentation

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

M  +1    -3    doc/kcontrol/autostart/index.docbook

https://commits.kde.org/plasma-desktop/fb1570f4804d289d4f7dc8adf367ac9c89d79f38