I wanted to use the key combination 'Fn+F2' to lock my computer with xscreensaver, but wasn't sure how to represent this key combination in the awesome wm rc.lua configuration file. Unfortunately you can't just insert combinations using 'Fn' like you would 'Ctrl', instead you must use the relevant 'Fn' combination keycode.

It turns out that you can use a tool called xev to print out events such as keypresses that occur in a X11 window. Running xev and pressing the desired key combination will output to a terminal information for this event, including the keycode. Doing this I discovered that 'Fn+F2' translated into keycode 160.

Adding the following to the key binding section of my rc.lua worked great.

awful.key({}, "#160", function () awful.util.spawn("xscreensaver-command -lock") end),

This was posted on Fri 31 Oct 2014 (4 years, 3 months ago) by Ryan McConville
Oct. 21, 2018, 8:36 p.m. (4 months ago)

<a href=http://bibletalks.inf.ua>Христианский сайт Разговор с Библией</a>
Заходите ВСЕ! Я сам сделал этот сайт, чтобы ВСЕ смогли узнать чтобы-то новое о нашем создателе
Приглашаю всех верующих и не только.
Мой партнер интернет магазин СанМебель,где можно<a href=http://sunmebel.ltd.ua>купить угловой компьютерный стол в Киеве и Украине</a>