[opensuse-kde] Logout script
Hi I've created a logout script in ~/.kde4/shutdown to do my backup with rsync which works well but.. when you logout the screen goes black and i would like to be able to display something on it to say it has starting backing up and it remains there with perhaps some more progress messages until the process is complete. Can anyone point me the correct direction? regards Ian -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
On 14/01/14 11:05, ianseeks wrote:
Hi
I've created a logout script in ~/.kde4/shutdown to do my backup with rsync which works well but.. when you logout the screen goes black and i would like to be able to display something on it to say it has starting backing up and it remains there with perhaps some more progress messages until the process is complete.
Can anyone point me the correct direction?
look in /usr/bin/startkde Once we hit the line " kwrapper4 ksmserver $KDEWM $KSMSERVEROPTIONS " the kde session manager is running starts kwin, and startkde's execution pauses until ksmserver exits. After that call returns successfully, we are in the shutdown phase of the script, and you see that kdeinit4_shutdown is called before the .kde4/shutdown scripts are called. The shutdown scripts are not meant to be interactive or even graphical, and there is no hook in startkde for the kind of scripts you describe. Which isn't to say you can't add them there. Try putting in some kdialog invocations after ksmserver returns but before kdeinit4_shutdown. I'm not sure however if kwin will still be running when ksmserver exits, so any fullscreen logout effect may be shown which would obscure your kdialog window. Also be aware that any other processes started by ksmserver may not be around so that may affect your backup routine. If you can't do what you want to do as above, you might need to hack ksmserver to do things for you on shutdown but before exiting. HTH Will -- Will Stephenson SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
On Tuesday 14 Jan 2014 11:34:03 Will Stephenson wrote:
On 14/01/14 11:05, ianseeks wrote:
Hi
I've created a logout script in ~/.kde4/shutdown to do my backup with rsync which works well but.. when you logout the screen goes black and i would like to be able to display something on it to say it has starting backing up and it remains there with perhaps some more progress messages until the process is complete.
Can anyone point me the correct direction?
look in /usr/bin/startkde
Once we hit the line " kwrapper4 ksmserver $KDEWM $KSMSERVEROPTIONS "
the kde session manager is running starts kwin, and startkde's execution pauses until ksmserver exits. After that call returns successfully, we are in the shutdown phase of the script, and you see that kdeinit4_shutdown is called before the .kde4/shutdown scripts are called. The shutdown scripts are not meant to be interactive or even graphical, and there is no hook in startkde for the kind of scripts you describe. Which isn't to say you can't add them there. Try putting in some kdialog invocations after ksmserver returns but before kdeinit4_shutdown.
I'm not sure however if kwin will still be running when ksmserver exits, so any fullscreen logout effect may be shown which would obscure your kdialog window.
Also be aware that any other processes started by ksmserver may not be around so that may affect your backup routine.
If you can't do what you want to do as above, you might need to hack ksmserver to do things for you on shutdown but before exiting.
HTH
Will Thanks Will.
Do you think that is a situation that needs to be explored to make it a "step" in the process rather than hacking about startkde? -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
On 14/01/14 11:39, ianseeks wrote:
Do you think that is a situation that needs to be explored to make it a "step" in the process rather than hacking about startkde?
A priori I could imagine a richer shutdown sequence, more like the startup sequence with UI showing the status of the shutdown process but backwards. For your backup use case, performing backup while the session is still up (but starting to shut down) would run the risk of backing up eg database files while still open and being written to, so to do it right would mean significant extra work. Perhaps the simplest route is to you could disable the fullscreen logout effect that hides all windows as they are shut down, and display an xmessage dialog after kdeinit4_shutdown is called? Will -- Will Stephenson SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
On Tuesday 14 Jan 2014 11:53:54 Will Stephenson wrote:
On 14/01/14 11:39, ianseeks wrote:
Do you think that is a situation that needs to be explored to make it a "step" in the process rather than hacking about startkde?
A priori I could imagine a richer shutdown sequence, more like the startup sequence with UI showing the status of the shutdown process but backwards. That would be great especially if it optional, it would have the benefit of looking more professional desktop and i think would benefit the LTM releases.
For your backup use case, performing backup while the session is still up (but starting to shut down) would run the risk of backing up eg database files while still open and being written to, so to do it right would mean significant extra work. I agree, i'd never do it while work is in progress
Perhaps the simplest route is to you could disable the fullscreen logout effect that hides all windows as they are shut down, and display an xmessage dialog after kdeinit4_shutdown is called? I'll look into that. Will
Thanks again Ian -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
In data martedì 14 gennaio 2014 10:39:29, ianseeks ha scritto: ..
Do you think that is a situation that needs to be explored to make it a "step" in the process rather than hacking about startkde? Try with kshutdown utility:
Repository: kde_extra Nome: kshutdown Versione: 3.0-1.2 Arch: i586 Fornitore: obs://build.opensuse.org/KDE Installato: No Stato: non installato Dimensione installata: 477,0 KiB Sommario: Shut Down Utility for KDE Descrizione: KShutdown is an advanced shut down utility for KDE. Features: - Turn Off or Restart Computer - Hibernate to disk or Suspend - Lock Screen using a screen saver - Various time and delay options (time from now, inactivity detection, ...) - Command line support - Additional, external user commands Bye. -- * Linux user # 198661 * Home http://www.kailed.net * Powered by openSUSE -- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
Hello Ian, I have done the same thing, except, the script I have in ~/.kde4/shutdown runs my rsync script in a konsole. This allows me to see that backup executing. The added bonus is if I decide to abort the backup (e.g. logging out due to having updated KDE), I press Ctrl+C which aborts the backup and continues with the log out. My script in ~/.kde4/shutdown looks like this: #!/bin/sh # This is one line in my script. Breaking onto two lines due to line wrapping in Thunderbird konsole --nofork --hide-menubar --hide-tabbar --geometry "1680x1050+0+0" \ -e /usr/local/sbin/backup.sh exit 0 Where /usr/local/sbin/backup.sh is my script that runs rsync. I imaging you can replace that with your rsync command. This runs konsole in a window that is the size as my desktop (e.g. --geometry). The --nofork is needed to prevent the konsole command from running in background. This will also makes the logout process wait for konsole to exit (after my backup script exits). Hope this helps. Cheers, Alvin On 14/01/14 06:05, ianseeks wrote:
Hi
I've created a logout script in ~/.kde4/shutdown to do my backup with rsync which works well but.. when you logout the screen goes black and i would like to be able to display something on it ... [snip]
Ian
-- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
On Tuesday 14 Jan 2014 12:00:58 Alvin Beach wrote:
Hello Ian,
I have done the same thing, except, the script I have in ~/.kde4/shutdown runs my rsync script in a konsole. This allows me to see that backup executing. The added bonus is if I decide to abort the backup (e.g. logging out due to having updated KDE), I press Ctrl+C which aborts the backup and continues with the log out.
My script in ~/.kde4/shutdown looks like this:
#!/bin/sh
# This is one line in my script. Breaking onto two lines due to line wrapping in Thunderbird konsole --nofork --hide-menubar --hide-tabbar --geometry "1680x1050+0+0" \ -e /usr/local/sbin/backup.sh
exit 0
Where /usr/local/sbin/backup.sh is my script that runs rsync. I imaging you can replace that with your rsync command.
This runs konsole in a window that is the size as my desktop (e.g. --geometry). The --nofork is needed to prevent the konsole command from running in background. This will also makes the logout process wait for konsole to exit (after my backup script exits).
I like the look of that for a good work around. thanks
Hope this helps.
Cheers,
Alvin
On 14/01/14 06:05, ianseeks wrote:
Hi
I've created a logout script in ~/.kde4/shutdown to do my backup with rsync which works well but.. when you logout the screen goes black and i would like to be able to display something on it ... [snip]
Ian
-- To unsubscribe, e-mail: opensuse-kde+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kde+owner@opensuse.org
participants (4)
-
Alvin Beach
-
Daniele
-
ianseeks
-
Will Stephenson