i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 213e63f55aea037fa012a27276f5f668766b94d2
parent f5ea093365ade77e5ab94353a8986ddc3322e0cc
Author: Raymond Li <hi@raymond.li>
Date:   Mon,  8 Jun 2020 18:40:17 -0400

Merge branch 'master' into fix_key_group
Diffstat:
Mi3lock.1 | 7++++++-
Mi3lock.c | 16++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/i3lock.1 b/i3lock.1
@@ -200,6 +200,11 @@ Allow the following keys to be used while the screen is locked by passing them t
 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
 .B \-\-insidevercolor=rrggbbaa
 Sets the interior circle color while the password is being verified.
 
@@ -337,7 +342,7 @@ Sets the color of the greeter text.
 
 .TP
 .B \-\-greeterpos="x position:y position"
-Sets the position for the date string. All the variables from \-\-indpos and \-\-timepos may be used.
+Sets the position for the greeter string. All the variables from \-\-indpos and \-\-timepos may be used.
 
 .TP
 .B \-\-refresh\-rate=seconds\-as\-double
diff --git a/i3lock.c b/i3lock.c
@@ -236,6 +236,7 @@ bool skip_repeated_empty_password = false;
 bool pass_media_keys = false;
 bool pass_screen_keys = false;
 bool pass_power_keys = false;
+bool pass_volume_keys = false;
 
 // for the rendering thread, so we can clean it up
 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
     switch (ksym) {
         case XKB_KEY_j:
@@ -1469,6 +1481,7 @@ int main(int argc, char *argv[]) {
         {"pass-media-keys", no_argument, NULL, 601},
         {"pass-screen-keys", no_argument, NULL, 602},
         {"pass-power-keys", no_argument, NULL, 603},
+        {"pass-volume-keys", no_argument, NULL, 604},
 
         // bar indicator stuff
         {"bar-indicator", no_argument, NULL, 700},
@@ -1945,6 +1958,9 @@ int main(int argc, char *argv[]) {
             case 603:
                 pass_power_keys = true;
                 break;
+            case 604:
+                pass_volume_keys = true;
+                break;
 
             // Bar indicator
             case 700: