Skip to content

Commit

Permalink
hardcode forwarding of XF86_* keys
Browse files Browse the repository at this point in the history
** !! Absolutely Hazardous !! **

This hardcodes forwarding of specific keys, which suit my need to
control music, while the screen is still locked.

My C skills are exceptionally bad and therefore this commit too.

Actually, the hidden goal of this commit is to annoy the i3lock
maintainers and give them eye cancer while viewing this commit and
therefore they will implement this in i3lock natively.
  • Loading branch information
bebehei committed Apr 28, 2017
1 parent 0bed914 commit e4f2119
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**This repository has got hazardous commits, which only work for me!**

i3lock - improved screen locker
===============================
i3lock is a simple screen locker like slock. After starting it, you will
Expand Down
32 changes: 32 additions & 0 deletions i3lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,38 @@ static void handle_key_press(xcb_key_press_event_t *event) {
n = xkb_keysym_to_utf8(ksym, buffer, sizeof(buffer));
}

switch (ksym) {
case XKB_KEY_F6:
case XKB_KEY_XF86AudioLowerVolume:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioLowerVolume"); break;
case XKB_KEY_F7:
case XKB_KEY_XF86AudioRaiseVolume:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioRaiseVolume"); break;
case XKB_KEY_F8:
case XKB_KEY_XF86AudioMute:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioMute"); break;
case XKB_KEY_F10:
case XKB_KEY_XF86AudioPlay:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioPlay"); break;
case XKB_KEY_XF86AudioStop:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioStop"); break;
case XKB_KEY_F11:
case XKB_KEY_XF86AudioNext:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioNext"); break;
case XKB_KEY_F9:
case XKB_KEY_XF86AudioPrev:
system("/home/bebe/.bin/xfbuttons.sh XF86AudioPrev"); break;
case XKB_KEY_XF86MonBrightnessUp:
system("/home/bebe/.bin/xfbuttons.sh XF86MonBrightnessUp"); break;
case XKB_KEY_XF86MonBrightnessDown:
system("/home/bebe/.bin/xfbuttons.sh XF86MonBrightnessDown"); break;
case XKB_KEY_F5:
case XKB_KEY_XF86Display:
system("/home/bebe/.bin/xfbuttons.sh XF86Display"); break;
default:
break;
}

switch (ksym) {
case XKB_KEY_j:
case XKB_KEY_m:
Expand Down

0 comments on commit e4f2119

Please sign in to comment.