| Summary: | Shell scripts in .config/plasma-workspace/env/ with `exit` in them cause all alphabetically subsequent scripts to not get executed | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Nai Xia <nai.xia> |
| Component: | Startup process | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | CC: | kde, kde, nate |
| Priority: | NOR | ||
| Version First Reported In: | 6.2.5 | ||
| Target Milestone: | 1.0 | ||
| Platform: | Neon | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Nai Xia
2025-01-20 08:40:07 UTC
So some still work, and some don't? Can you see if you can figure out a pattern to explain the difference? Otherwise there's not much to go on here. (In reply to Nate Graham from comment #1) > So some still work, and some don't? Can you see if you can figure out a > pattern to explain the difference? Otherwise there's not much to go on here. OK. I am using X11, I found that one of my bash scripts (headed with "#!/bin/bash") has an "exit" cmd. The scripts alphabetically after that didn't get executed. So are there any restrictions for these scripts? I remember they all worked before the plasma update. Interesting observation. Evidently something changed under the hood to make that `edit` cause some mischief. I guess all these scripts are "source"d to keep the env variables. I can make a workaround without "exit". But I still wish there is a way to let users to "./script.sh" for a more robust session start process. My sugguesstion is that if the script.sh is headed with like "#!/bin/bash" then "./script.sh", else "souce script.sh". If you need a more complex script, just use the normal autostart mechanism, it's a better fit (desktop file in /etc/xdg/autostart). Or as a systemd service in that's Wanted-By plasma-workspace.target for example. On the topic I dont see any recent changes in how these scripts are run. these are https://invent.kde.org/plasma/plasma-workspace/-/blob/Plasma/6.2/startkde/startplasma.cpp?ref_type=heads#L139 and https://invent.kde.org/plasma/plasma-workspace/-/blob/Plasma/6.2/startkde/plasma-sourceenv.sh?ref_type=heads (In reply to David Redondo from comment #5) > If you need a more complex script, just use the normal autostart mechanism, > it's a better fit (desktop file in /etc/xdg/autostart). Or as a systemd > service in that's Wanted-By plasma-workspace.target for example. > > On the topic I dont see any recent changes in how these scripts are run. > > these are > https://invent.kde.org/plasma/plasma-workspace/-/blob/Plasma/6.2/startkde/ > startplasma.cpp?ref_type=heads#L139 and > https://invent.kde.org/plasma/plasma-workspace/-/blob/Plasma/6.2/startkde/ > plasma-sourceenv.sh?ref_type=heads OK, I got it. Thanks for the reply. |