Summary: | Trying to add scripts not ending in ".sh" to run on "Pre-KDE startup" generates no warning | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | Michael Liddle <michael> |
Component: | kcm_autostart | Assignee: | Laurent Montel <montel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | brian, fischer, kde, s_chriscollins |
Priority: | NOR | ||
Version: | 4.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Michael Liddle
2008-09-16 07:52:11 UTC
Sorry, version should be "Recent Snapshot or SVN checkout." My Bad... I wrote a small patch that may resolve this bug and bug 170324. The patch is attached at bug 170324. I added a script to Autostart and selected "Pre-KDE startup". I closed System Settings and reopened. I went back to Autostart and the setting changed from "Pre-KDE startup" to "Startup". I clicked on the drop down to change it *back* to "Pre-KDE startup" and I got a pop-up dialog box that said, "KDE only reads files with sh extensions for setting up the environment". There are 3 problems here. First, the application changed my "Run On" setting without any notification. Second, the Autostart Module is missing the "OK, Apply, and Cancel" buttons at the button. Third, unix has no concept of file extension like some other OS (i.e.,Windows/DOS). There is no guarantee that a file with a certain file name that might look like an extension, like ".sh", is a shell script. Unix uses other means. See man page for `file`. Environment: kdebase4: v4.3.5 dist: OpenSUSE 11.2 I can confirm this. I'm trying to establish ssh tunnels before kate starts up. The control panel is acting weird, like not remembering that i selected Pre-KDE startup. I believe this is related to bug #228795. The systemsettings dialog is not moving the correct script to the shutdown folder. Confirmed using KDE 4.6.4 on Kubuntu 11.04. well, all those "fail to change startup type as expected" are really bug 228795, which I have just fixed. The original title of this report is "Trying to add scripts not ending in ".sh" to run on "Pre-KDE startup" generates no warning ". Well, that is no longer the case for recent versions. A dialog will popup, saying "Only files with “.sh” extensions are allowed for setting up the environment". But I agree the ".sh" extension requirement is not good. Actually, among the three types, only the "Pre-KDE startup" really requires shell scripts because those scripts are "sourced" by the startkde shell script. There is nothing wrong to use executable python/perl scripts for "Startup" and "Shutdown", as far as I understand. Git commit 6eccde0a3638cea05142d69362c66265cbab0cbd by Jekyll Wu. Committed on 10/11/2012 at 10:40. Pushed by jekyllwu into branch 'KDE/4.9'. Loose the requirement of script having .sh extention. Now that warning only appears for "Pre-KDE" type. There is no technical requirement of shell scripts for "Startup" and "Shutdown", let alone that .sh extension. Eventually, that .sh extension requirement should just go away. "Pre-KDE" requires shell script (it is OK to be non-executable), that is all. M +1 -1 kcontrol/autostart/autostart.cpp http://commits.kde.org/kde-workspace/6eccde0a3638cea05142d69362c66265cbab0cbd I was kind of wrong. That ".sh" extension requirement is necessary, because clearly the startkde script only care about shell scripts with .sh extension. # Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh # (where <localprefix> is $KDEHOME or ~/.kde, and <prefixes> is where KDE is installed) # # This is where you can define environment variables that will be available to # all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent` # or eval `gpg-agent --daemon`. # Note: if you do that, you should also put "ssh-agent -k" as a shutdown script # # (see end of this file). # For anything else (that doesn't set env vars, or that needs a window manager), # better use the Autostart folder. libpath=`kde4-config --path lib | tr : '\n'` for prefix in `echo "$libpath" | sed -n -e 's,/lib[^/]*/,/env/,p'`; do for file in "$prefix"*.sh; do test -r "$file" && . "$file" done done So the current behavior of poping up a warning dialog is consistent with the requirement of startkde. The only problem left is that warning should appear before instead of after moving the file (change its startup type) , and the moving should be canceled. There's a dialog as described in #7 |