[kde-linux] Execute at login for KDE only

Duncan 1i5t5.duncan at cox.net
Wed Sep 26 22:26:46 UTC 2012


Kevin Krammer posted on Wed, 26 Sep 2012 17:10:01 +0200 as excerpted:

> On Wednesday, 2012-09-26, Duncan wrote:
> 
>> 2b) That leaves the pre-kde-start scripts, found in $KDEHOME/env/ , and
>> the kde shutdown scripts, found in $KDEHOME/shutdown/ .   In general,
>> these work exactly like the autostart scripts, with a few exceptions:
>> 
>> 2b1) Unlike the scripts autostart dir, I know of no way to customize
>> the shutdown and environment dir locations, beyond changing $KDEHOME or
>> altering the source code, of course.
> 
> It is looking into all $KDEDIRS/env if I remember correctly, so one
> could do something like KDEDIRS=/usr:/usr/local/:/my/prefix and put
> those scripts into /my/prefix/env

I didn't know that one was using $KDEDIRS.  Thanks.

Of course, if you're using it to SET $KDEDIRS (as one might be doing, 
given its purpose).  Of course, it's probably more likely that one's 
setting $KDEHOME there, given it's a user var, and using a system global 
script to set the $KDEDIRS var, perhaps as part of the initscripts, given 
its system nature.

>> 2b2) As mentioned at the top, unlike script autostart, kde-shutdown and
>> environment/pre-kde-start require that the script or symlink use the
>> *.sh extension.  Of course the symlink functionality allows a
>> workaround to that, by simply naming the symlink *.sh, regardless of
>> what the script it points at is actually named.
> 
> An important point to consider here is that, as far as I know, those
> scripts will be sourced by the startkde script, thus need to be
> compatible with whatever shell is set up for interpreting /bin/sh
> scripts.
> 
> The scripts themselves can of course launch other scripts which use
> different interpreters.

The old shebang trick should work.

#!/usr/bin/python
# or whatever, as first-line.

FWIW, that's what I use in any case, since the editor I use (mcedit, 
FWIW) uses it to detect the appropriate context coloring.  (Of course it 
generally uses extension too, but identifying scripts and executables by 
extension is so MS, something I left behind over a decade ago, tho I do 
commonly still use extensions for data-files.)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




More information about the kde-linux mailing list