Thursday, November 25, 2010

OpenBSD NC4200: Ctrl + Alt + Del to lock wmii using xscreensaver.

1 thing I like about XFCE is that if I hit [Ctrl]+[Alt]+[Del], XFCE will lock my session using xlock or xscreensaver. By default, wmii can't do that. I've been searching for samples to do that but most samples that I've encountered are either using Ruby or Python. So I tried to just edit the ~/.wmii-3.5/wmiirc. After a few testing and frustrating hanging of wmii, I managed to get the key binding working by inserting this line:

# Key Bindings
   *default lines skipped*
   Key $MODKEY-Shift-$UP
      wmiir xwrite /tag/sel/ctl send sel up
   Key Mod1-Control-Delete
      /usr/local/bin/xscreensaver-command -activate

   for i in 0 1 2 3 4 5 6 7 8 9; do
   *default lines skipped*

The bolded lines are the addition to make the key sequence work. So after reloading the config, pressing Ctrl+Alt+Del locks my session using xscreensaver. Great. I read that new version of wmii changed the wmiirc configuration so FYI, this configuration is using wmii 3.6. Later then.

No comments: