Thanks.
lockWorkstation script:
|
Source code
|
1
2
3
4
5
6
7
8
9
|
#!/bin/sh
logfiletxt=/home/karolrvn/adfadf/logs/lockWorkstation_log.txt
for ((i=0;i<15;i+=1)); do
date +%F_%H_%M_%S_%N >> $logfiletxt
echo "lockingWorkstation" >> $logfiletxt
/usr/bin/dcop --all-users --all-sessions kdesktop KScreensaverIface lock >> $logfiletxt
sleep 1
done
|
I run it in background from Autostart as You suggested (from another script). :
/home/karolrvn/adfadf/bin/lockWorkstation &
As You can see i run it 15 times with 1 second sleep, in background (&).
It works but there is a problem: there is a delay (about 3-5 seconds) between when the desktop shows and the session is locked which theoretically makes the desktop "vulnerable". Looks like a delay caused by general "traffic jam" on system startup ( many programs are starting simultanously ). I wanted to try "nice --adjustment=-19" but negative niceness is not permitted for normal users so i didn't persist.
Any more hints?
It would be nice to start the script _before_ KDE starts resuming session ( bringing back apps ).
Perhaps there is a way to do it X-Windows-way instead of KDE-way. This could perhaps be executed earlier.
PS
I wonder what is the purpose of ~/.xinitrc (maybe i got it wrong? or there is no such thing actually?) ; it does not seem to execute.