Setup file for startkde
David Faure
faure at kde.org
Sat Feb 21 09:22:19 GMT 2004
On Friday 20 February 2004 14:01, Oswald Buddenhagen wrote:
> my main argument is consistency with the shutdown dir(s).
Ah, I hadn't noticed the code for the shutdown dirs. OK that makes sense then
(except that using $KDEDIRS to locate a script that might change KDEDIRS is kind
of interesting :-)
> of course
> there needs to be a distinction between source-able and exec-utable
> programs - i think one can simply do a test -x for that, but needs to
> document the subtle difference (i.e., _don't_ chmod x the .sh files if
> they are supposed to set environment variables).
What's wrong with sourcing everything? As I found out while testing,
this is NOT a place to run any graphical program, since there's no window
manager yet. It's really only for setting env vars (directly, or from *-agent).
Here's an updated proposal, which also includes skipping foo~ and foo.bak
(OK if I do the same in the shutdown session?)
--- startkde 14 Oct 2003 15:55:21 -0000 1.124
+++ startkde 21 Feb 2004 09:21:13 -0000
@@ -33,6 +33,21 @@ unset DYLD_FORCE_FLAT_NAMESPACE
kdehome=$HOME/.kde
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^\~/,$HOME/,"`
+# Source scripts found in $KDEDIRS/setup.
+# This is where you can define environment variables that will be available to
+# all KDE programs (for instance KDEDIRS), so this is where you can run agents
+# like eval `ssh-agent` or eval `gpg-agent --daemon`.
+# For anything else (that doesn't set env vars, or that needs a window manager),
+# better use the Autostart folder.
+
+for prefix in `kde-config --path exe| sed -e 's^bin/^setup/^g;s^:^ ^g'`; do
+ for file in $prefix/*; do
+ if echo "$file" | grep -v "~$" | grep -v "\.bak$" >/dev/null 2>/dev/null; then
+ test -f $file && . $file
+ fi
+ done
+done
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list