Hi I am running SUSE 9.3 on a notebook. I want to run a user script when KDE goes down - where do I have to place such scripts? I heard that you can put any shutdown scripts into the directory ~/.kde/shutdown but nothing happens. I realized that the environment variable KDEDIRS is not set. Does anybody know how I can run a script if KDE goes down? -- Thanks for any help. Sami
Sami A. Hassanein a écrit :
Hi
I am running SUSE 9.3 on a notebook.
I want to run a user script when KDE goes down - where do I have to place such scripts?
I heard that you can put any shutdown scripts into the directory ~/.kde/shutdown but nothing happens.
I realized that the environment variable KDEDIRS is not set.
Does anybody know how I can run a script if KDE goes down?
-- Thanks for any help. Sami
Hi, I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE. My preoccupation was too avoid to shutdown KDE when vmware is running. I solved both problems at the same time. Ready to share my modifications. Michel.
Op dinsdag 6 september 2005 22:32, schreef Catimimi:
Hi,
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE.
My preoccupation was too avoid to shutdown KDE when vmware is running. I solved both problems at the same time.
Ready to share my modifications.
Michel.
Did you provide your patch to the kde devs via http://bugs.kde.org? -- Richard Bos Without a home the journey is endless
Richard Bos a écrit :
Op dinsdag 6 september 2005 22:32, schreef Catimimi:
Hi,
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE.
My preoccupation was too avoid to shutdown KDE when vmware is running. I solved both problems at the same time.
Ready to share my modifications.
Michel.
Did you provide your patch to the kde devs via http://bugs.kde.org?
No, would it be useful ? it is not a bug but a addon.
On Tuesday 06 September 2005 22:32, Catimimi wrote:
Sami A. Hassanein a écrit :
Hi
I am running SUSE 9.3 on a notebook.
I want to run a user script when KDE goes down - where do I have to place such scripts?
I heard that you can put any shutdown scripts into the directory ~/.kde/shutdown but nothing happens.
I realized that the environment variable KDEDIRS is not set.
Does anybody know how I can run a script if KDE goes down?
-- Thanks for any help. Sami
Hi,
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE.
My preoccupation was too avoid to shutdown KDE when vmware is running. I solved both problems at the same time.
Ready to share my modifications. Thanks for this information. Does your solution require to re-build KDE or is it only a script modification? If it is the latter, I am very interested in it. Otherwise, is there another solution?
-- Thanks for your help Regards, Sami
Sami A. Hassanein a écrit :
On Tuesday 06 September 2005 22:32, Catimimi wrote:
Sami A. Hassanein a écrit :
Hi
I am running SUSE 9.3 on a notebook.
I want to run a user script when KDE goes down - where do I have to place such scripts?
I heard that you can put any shutdown scripts into the directory ~/.kde/shutdown but nothing happens.
I realized that the environment variable KDEDIRS is not set.
Does anybody know how I can run a script if KDE goes down?
-- Thanks for any help. Sami
Hi,
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE.
My preoccupation was too avoid to shutdown KDE when vmware is running. I solved both problems at the same time.
Ready to share my modifications.
Thanks for this information. Does your solution require to re-build KDE or is it only a script modification? If it is the latter, I am very interested in it. Otherwise, is there another solution?
-- Thanks for your help Regards, Sami
Hi, I need to recompile and install only a very small part of kde : the directory "ksmserver" in kdebase ! It takes less than 5 minutes and everything is OK. Michel.
On Tuesday 06 September 2005 22:54, Catimimi wrote:
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE. I need to recompile and install only a very small part of kde : the directory "ksmserver" in kdebase ! It takes less than 5 minutes and everything is OK. ok, can you send me your modification. Regarding recompiling, do you have a how-to as well?
-- Thanks for your help. Regards, Sami
Sami A. Hassanein a écrit :
On Tuesday 06 September 2005 22:54, Catimimi wrote:
I'd the same problem and wazs not able to find the solution ! So I decided to modify ksmserver (in kdebase) in order to run a script when KDE goes down. It is very simple, but I've to recompile at every release of KDE.
I need to recompile and install only a very small part of kde : the directory "ksmserver" in kdebase ! It takes less than 5 minutes and everything is OK.
ok, can you send me your modification. Regarding recompiling, do you have a how-to as well?
-- Thanks for your help. Regards, Sami
Hi, OK, I'll do that with a "howto" just wait one day or two, I've to make a patch only for the script not for the vmware related part of my modification. Regards. Michel.
diff -Nru kdebase-3.4.2.orig/ksmserver/server.cpp kdebase-3.4.2.patched/ksmserver/server.cpp --- kdebase-3.4.2.orig/ksmserver/server.cpp 2005-05-23 14:13:16.000000000 +0200 +++ kdebase-3.4.2.patched/ksmserver/server.cpp 2005-09-07 18:38:33.000000000 +0200 @@ -976,6 +976,8 @@ if ( logoutConfirmed ) { + system("/opt/kde3/shutdown/stopapps.sh"); + shutdownType = sdtype; shutdownMode = sdmode; bootOption = bopt;
As I didn't receive all my message, I mail it again, I include the patch at the end. It seems that the attached file is not accepted. Hi, Back to home, I send you the patch (attached file) and the instructions below : - download from SuSE the source RPM for kdebase3-3.4.2 : kdebase3-3.4.2-3.src.rpm - install this RPM with kpackage (for instance), this will install a lot of files in the folder /usr/src/packages/SOURCES (I suggest that you note which files exists before the installation) - delete all the files in this folder, except the previously existing files AND : kdebase-3.4.2.tar.bz2 - untar kdebase-3.4.2.tar.bz2, you'll get a new folder called : kdebase-3.4.2 - you can now delete : kdebase-3.4.2.tar.bz2 # cd /usr/src/packages/SOURCES/kdebase-3.4.2 - copy the patch in this folder # patch -p1 < kdebase3.diff - you can now delete the patch # ./configure # cd kdmlib # make - here I compile kdmlib which is required by ksmserver # cd ../ksmserver # make # make install The patch enables kde to run a new script called : stopapps.sh which has to be located in the folder : /opt/kde3/shutdown So create an empty (or not) script and DON'T FORGET to make it executable !! Now you can leave kde and enter it again, it should work. Please ask the "after sale service" if necessary. Good luck. Michel. Patch called : kdebase3.diff diff -Nru kdebase-3.4.2.orig/ksmserver/server.cpp kdebase-3.4.2.patched/ksmserver/server.cpp --- kdebase-3.4.2.orig/ksmserver/server.cpp 2005-05-23 14:13:16.000000000 +0200 +++ kdebase-3.4.2.patched/ksmserver/server.cpp 2005-09-07 18:38:33.000000000 +0200 @@ -976,6 +976,8 @@ if ( logoutConfirmed ) { + system("/opt/kde3/shutdown/stopapps.sh"); + shutdownType = sdtype; shutdownMode = sdmode; bootOption = bopt;
Hi! On Tue, 6 Sep 2005 21:48:56 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
I want to run a user script when KDE goes down - where do I have to place such scripts?
You could create a ~/.xsession file that contains something like this: ------------ $WINDOWMANAGER <call to your script> ------------ When the windowmanager (or desktop environment) finishes, your script gets called afterwards. HTH, Ingo -- Ingo Strauch ---- Registered Linux User #227900 (http://counter.li.org/) GPG Key Fingerprint = DEC8 1B12 9573 6BE7 7A99 C33F 809C 8C2C 772E 66A1 http://www.the-one-brack.org/
On Wednesday 07 September 2005 08:32, Ingo Strauch wrote:
On Tue, 6 Sep 2005 21:48:56 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
I want to run a user script when KDE goes down - where do I have to place such scripts?
You could create a ~/.xsession file that contains something like this:
------------ $WINDOWMANAGER <call to your script> I use SUSE9.3 and KDE 3.4.0. I created the file ~/.xinitrc and put my script as you suggested, but nothing happend - it was not being called. Now I am looking for a solution sincd weeks and I really do not know how to achieve this. There must be a way to call a user script at closing of KDE of X.
-- Any help is very much appreciated. Regards, Sami
Hi there, I also use Suse 9.3 with the default installation. In my $KDE_DIR (i.e. /opt/kde3/) I have a shutdown directory. Inside, there's a file called stopkde.suse.sh ------- BEGIN ------- < fk@jedi:/opt/kde3/shutdown > cat stopkde.suse.sh #! /bin/sh if test -n "$SSH_AGENT_PID"; then ssh-agent -k fi if test -n "$GPG_AGENT_INFO"; then pid=`echo "$GPG_AGENT_INFO" | cut -d: -f2` if test -n "$pid"; then kill $pid fi fi echo "yes yes yes" >> /home/fk/test.txt ------- END ------- After editing this file (as root), and adding the echo command above, I've logged out twice of my KDE and looked at my test file.. ------- BEGIN ------- < fk@jedi:~ > cat test.txt yes yes yes yes yes yes ------- END ------- Therefore, there's is a script that is executed every time KDE exits. Thus, you can add your own script inside this one, as long as you have this directory, shutdown, inside your $KDE_DIR. But this is another story. Good luck! Carlos Costa Sami A. Hassanein wrote:
On Wednesday 07 September 2005 08:32, Ingo Strauch wrote:
On Tue, 6 Sep 2005 21:48:56 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
I want to run a user script when KDE goes down - where do I have to place such scripts?
You could create a ~/.xsession file that contains something like this:
------------ $WINDOWMANAGER <call to your script>
I use SUSE9.3 and KDE 3.4.0. I created the file ~/.xinitrc and put my script as you suggested, but nothing happend - it was not being called. Now I am looking for a solution sincd weeks and I really do not know how to achieve this. There must be a way to call a user script at closing of KDE of X.
-- Any help is very much appreciated. Regards, Sami
On Friday 09 September 2005 00:17, Carlos Costa wrote:
Hi there,
I also use Suse 9.3 with the default installation.
In my $KDE_DIR (i.e. /opt/kde3/) I have a shutdown directory. Inside, there's a file called stopkde.suse.sh
------- BEGIN ------- < fk@jedi:/opt/kde3/shutdown > cat stopkde.suse.sh #! /bin/sh
if test -n "$SSH_AGENT_PID"; then ssh-agent -k fi
if test -n "$GPG_AGENT_INFO"; then pid=`echo "$GPG_AGENT_INFO" | cut -d: -f2` if test -n "$pid"; then kill $pid fi fi
echo "yes yes yes" >> /home/fk/test.txt ------- END -------
After editing this file (as root), and adding the echo command above, I've logged out twice of my KDE and looked at my test file..
I have the same script in /opt/kde3/shutdown, but this script will never be executed!! Do you really have the environment variable $KDE_DIR set? I never heard of this env variable. -- Thanks for any further tips. Sami
Actually I just wrote down $KDE_DIR referring to the /opt/kde3/ directory. That doesn't mean it exists as an environment variable. :-) Well, for me the script has definitely executed. Cheers, Carlos Costa Sami A. Hassanein wrote:
On Friday 09 September 2005 00:17, Carlos Costa wrote:
Hi there,
I also use Suse 9.3 with the default installation.
In my $KDE_DIR (i.e. /opt/kde3/) I have a shutdown directory. Inside, there's a file called stopkde.suse.sh
------- BEGIN ------- < fk@jedi:/opt/kde3/shutdown > cat stopkde.suse.sh #! /bin/sh
if test -n "$SSH_AGENT_PID"; then ssh-agent -k fi
if test -n "$GPG_AGENT_INFO"; then pid=`echo "$GPG_AGENT_INFO" | cut -d: -f2` if test -n "$pid"; then kill $pid fi fi
echo "yes yes yes" >> /home/fk/test.txt ------- END -------
After editing this file (as root), and adding the echo command above, I've logged out twice of my KDE and looked at my test file..
I have the same script in /opt/kde3/shutdown, but this script will never be executed!! Do you really have the environment variable $KDE_DIR set? I never heard of this env variable.
-- Thanks for any further tips. Sami
On Thu, 8 Sep 2005 07:04:40 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
On Wednesday 07 September 2005 08:32, Ingo Strauch wrote:
On Tue, 6 Sep 2005 21:48:56 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
I want to run a user script when KDE goes down - where do I have to place such scripts?
You could create a ~/.xsession file that contains something like this:
------------ $WINDOWMANAGER <call to your script>
I use SUSE9.3 and KDE 3.4.0. I created the file ~/.xinitrc and put my script as you suggested, but nothing happend - it was not being called.
That won't work anyway, it's ~/.xsession and not ~/.xinitrc. The former will get called on graphical login, the latter when starting X by hand (xinit or startx). And typically it has to be set executable I think. But when using KDM instead of XDM the entire sequence is different and those files are not evaluated anyway. When you look at /etc/opt/kde3/share/config/kdm/Xsession you'll see at the end of the script that it calles scripts in $KDEDIRS/shutdown. At least this is what the comment in the script says. To me it seems that instead "kde-config --path exe" is evaluated and the 'bin' part replaced by 'shutdown'. So basically it should work if you create a directory '~/.kde/shutdown' and place your script there (set the executable bit!).
Now I am looking for a solution sincd weeks and I really do not know how to achieve this. There must be a way to call a user script at closing of KDE of X.
Ok, try the above. But I'm not sure if that is a general feature of KDE or if SUSE has modified the startkde script and added this feature (I think they in principle do modify startkde). HTH, Ingo -- Ingo Strauch ---- Registered Linux User #227900 (http://counter.li.org/) GPG Key Fingerprint = DEC8 1B12 9573 6BE7 7A99 C33F 809C 8C2C 772E 66A1 http://www.the-one-brack.org/
Sami A. Hassanein a écrit :
On Wednesday 07 September 2005 08:32, Ingo Strauch wrote:
On Tue, 6 Sep 2005 21:48:56 +0200 "Sami A. Hassanein" <linux@hassanein.ch> wrote:
I want to run a user script when KDE goes down - where do I have to place such scripts?
You could create a ~/.xsession file that contains something like this:
------------ $WINDOWMANAGER <call to your script>
I use SUSE9.3 and KDE 3.4.0. I created the file ~/.xinitrc and put my script as you suggested, but nothing happend - it was not being called. Now I am looking for a solution sincd weeks and I really do not know how to achieve this. There must be a way to call a user script at closing of KDE of X.
-- Any help is very much appreciated. Regards, Sami
Hello, In order to replace my patch, I tried the different suggested ways, they work, BUT the script is runned after kde shutdown and the kde apps are not cleanly closed. It is the reason why I patched kde, my script is runned before leaving kde and kde apps are closed correctly. Regards. Michel.
participants (5)
-
Carlos Costa
-
Catimimi
-
Ingo Strauch
-
Richard Bos
-
Sami A. Hassanein