This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Kwallet] autolock when sleep/hibernate

7

Votes
7
0
Tags: None
(comma "," separated)
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
433
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).


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]