mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2025-02-24 16:06:26 -05:00
Merge pull request #170 from cptpcrd/volume-keys
Add --pass-volume-keys option to just pass volume keys
This commit is contained in:
commit
5dd37a7109
2 changed files with 21 additions and 0 deletions
5
i3lock.1
5
i3lock.1
|
@ -199,6 +199,11 @@ XF86MonBrightnessUp, XF86MonBrightnessDown.
|
||||||
Allow the following keys to be used while the screen is locked by passing them through:
|
Allow the following keys to be used while the screen is locked by passing them through:
|
||||||
XF86PowerDown, XF86PowerOff, XF86Sleep.
|
XF86PowerDown, XF86PowerOff, XF86Sleep.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-\-pass\-volume\-keys
|
||||||
|
Allow the following keys to be used while the screen is locked by passing them through:
|
||||||
|
XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-\-insidevercolor=rrggbbaa
|
.B \-\-insidevercolor=rrggbbaa
|
||||||
Sets the interior circle color while the password is being verified.
|
Sets the interior circle color while the password is being verified.
|
||||||
|
|
16
i3lock.c
16
i3lock.c
|
@ -236,6 +236,7 @@ bool skip_repeated_empty_password = false;
|
||||||
bool pass_media_keys = false;
|
bool pass_media_keys = false;
|
||||||
bool pass_screen_keys = false;
|
bool pass_screen_keys = false;
|
||||||
bool pass_power_keys = false;
|
bool pass_power_keys = false;
|
||||||
|
bool pass_volume_keys = false;
|
||||||
|
|
||||||
// for the rendering thread, so we can clean it up
|
// for the rendering thread, so we can clean it up
|
||||||
pthread_t draw_thread;
|
pthread_t draw_thread;
|
||||||
|
@ -700,6 +701,17 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// volume keys
|
||||||
|
if (pass_volume_keys) {
|
||||||
|
switch(ksym) {
|
||||||
|
case XKB_KEY_XF86AudioMute:
|
||||||
|
case XKB_KEY_XF86AudioLowerVolume:
|
||||||
|
case XKB_KEY_XF86AudioRaiseVolume:
|
||||||
|
xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// return/enter/etc
|
// return/enter/etc
|
||||||
switch (ksym) {
|
switch (ksym) {
|
||||||
case XKB_KEY_j:
|
case XKB_KEY_j:
|
||||||
|
@ -1467,6 +1479,7 @@ int main(int argc, char *argv[]) {
|
||||||
{"pass-media-keys", no_argument, NULL, 601},
|
{"pass-media-keys", no_argument, NULL, 601},
|
||||||
{"pass-screen-keys", no_argument, NULL, 602},
|
{"pass-screen-keys", no_argument, NULL, 602},
|
||||||
{"pass-power-keys", no_argument, NULL, 603},
|
{"pass-power-keys", no_argument, NULL, 603},
|
||||||
|
{"pass-volume-keys", no_argument, NULL, 604},
|
||||||
|
|
||||||
// bar indicator stuff
|
// bar indicator stuff
|
||||||
{"bar-indicator", no_argument, NULL, 700},
|
{"bar-indicator", no_argument, NULL, 700},
|
||||||
|
@ -1943,6 +1956,9 @@ int main(int argc, char *argv[]) {
|
||||||
case 603:
|
case 603:
|
||||||
pass_power_keys = true;
|
pass_power_keys = true;
|
||||||
break;
|
break;
|
||||||
|
case 604:
|
||||||
|
pass_volume_keys = true;
|
||||||
|
break;
|
||||||
|
|
||||||
// Bar indicator
|
// Bar indicator
|
||||||
case 700:
|
case 700:
|
||||||
|
|
Loading…
Add table
Reference in a new issue