Reply to topic

[Kwallet] autolock when sleep/hibernate

7

Votes
7
0
Bysmyyr
Registered Member
Posts
1
Karma
0
Kwallet should be able to lock automatically when computer goes sleep or hibernate. Now when somebody steals sleeped computer, he is able to take all passwords...
User avatar sparhawk
Registered Member
Posts
267
Karma
0
OS
To hack this functionality yourself, create the following file at /etc/pm/sleep.d/00_kwallet_lock

Code: Select all
#!/usr/bin/env bash
# lock all kwallets on suspend

computer_suspend()
{
   userlist=`who | cut -f1 -d' ' | sort | uniq`
   for i in ${userlist}; do
      export DISPLAY=:0.0 && sudo -u ${i} qdbus org.kde.kwalletd /modules/kwalletd closeAllWallets
   done
}

case $1 in
   hibernate|suspend)
      computer_suspend & # background so it doesn't stall subsequent processes
      ;;
   resume|thaw)
      true # do nothing
      ;;
esac


It seems that this hack doesn't really integrate with KDE so well. I find that when waking from suspend, I no longer connect automatically to the wireless. It's not a matter of kwallet popping up a dialogue box, as I merely need to click on the wireless name in the plasmoid to reconnect now (with no password required).

 
Reply to topic

Bookmarks



Who is online

Registered users: AElfwine, anditosan, Baidu [Spider], bcooksley, Bing [Bot], doublerainbow64, Exabot [Bot], Google [Bot], google01103, hefeweiz3n, inksi, jensreuterberg, kainz.a, koriun, l3u, moisachedaniela, Paulms, pbCyanide, raphaelpoli, scummos, SecretCode, Sentynel, toad, tparrott, Yahoo [Bot]