diff options
-rw-r--r-- | completions/zsh/_swaylock | 3 | ||||
-rw-r--r-- | swaylock/main.c | 11 | ||||
-rw-r--r-- | swaylock/swaylock.1.txt | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/completions/zsh/_swaylock b/completions/zsh/_swaylock index 880237fe..842a884a 100644 --- a/completions/zsh/_swaylock +++ b/completions/zsh/_swaylock | |||
@@ -8,4 +8,5 @@ _arguments -s \ | |||
8 | '(-h --help)'{-h,--help}'[Show help message and quit]' \ | 8 | '(-h --help)'{-h,--help}'[Show help message and quit]' \ |
9 | '(-c --color)'{-c,--color}'[Specify a color (rrggbb) instead of white]' \ | 9 | '(-c --color)'{-c,--color}'[Specify a color (rrggbb) instead of white]' \ |
10 | '(-i --image)'{-i,--image}'[Display an image]:files:_files' \ | 10 | '(-i --image)'{-i,--image}'[Display an image]:files:_files' \ |
11 | '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' | 11 | '(-s --scaling)'{-s,--scaling}'[Scaling mode]:mode:(stretch fill fit center tile)' \ |
12 | '(-u --no-unlock-indicator)'{-u,--no-unlock-indicator}'[Disable the unlock indicator]' | ||
diff --git a/swaylock/main.c b/swaylock/main.c index 666e59d2..2c69f7fd 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <pwd.h> | 10 | #include <pwd.h> |
11 | #include <getopt.h> | 11 | #include <getopt.h> |
12 | #include <signal.h> | 12 | #include <signal.h> |
13 | #include <stdbool.h> | ||
13 | 14 | ||
14 | #include "client/window.h" | 15 | #include "client/window.h" |
15 | #include "client/registry.h" | 16 | #include "client/registry.h" |
@@ -20,6 +21,7 @@ | |||
20 | 21 | ||
21 | struct registry *registry; | 22 | struct registry *registry; |
22 | struct render_data render_data; | 23 | struct render_data render_data; |
24 | bool show_indicator = true; | ||
23 | 25 | ||
24 | void wl_dispatch_events() { | 26 | void wl_dispatch_events() { |
25 | wl_display_flush(registry->display); | 27 | wl_display_flush(registry->display); |
@@ -328,6 +330,7 @@ int main(int argc, char **argv) { | |||
328 | {"tiling", no_argument, NULL, 't'}, | 330 | {"tiling", no_argument, NULL, 't'}, |
329 | {"version", no_argument, NULL, 'v'}, | 331 | {"version", no_argument, NULL, 'v'}, |
330 | {"socket", required_argument, NULL, 'p'}, | 332 | {"socket", required_argument, NULL, 'p'}, |
333 | {"no-unlock-indicator", no_argument, NULL, 'u'}, | ||
331 | {0, 0, 0, 0} | 334 | {0, 0, 0, 0} |
332 | }; | 335 | }; |
333 | 336 | ||
@@ -340,6 +343,7 @@ int main(int argc, char **argv) { | |||
340 | " -t, --tiling Same as --scaling=tile.\n" | 343 | " -t, --tiling Same as --scaling=tile.\n" |
341 | " -v, --version Show the version number and quit.\n" | 344 | " -v, --version Show the version number and quit.\n" |
342 | " -i, --image [<output>:]<path> Display the given image.\n" | 345 | " -i, --image [<output>:]<path> Display the given image.\n" |
346 | " -u, --no-unlock-indicator Disable the unlock indicator.\n" | ||
343 | " --socket <socket> Use the specified socket.\n"; | 347 | " --socket <socket> Use the specified socket.\n"; |
344 | 348 | ||
345 | registry = registry_poll(); | 349 | registry = registry_poll(); |
@@ -347,7 +351,7 @@ int main(int argc, char **argv) { | |||
347 | int c; | 351 | int c; |
348 | while (1) { | 352 | while (1) { |
349 | int option_index = 0; | 353 | int option_index = 0; |
350 | c = getopt_long(argc, argv, "hc:i:s:tv", long_options, &option_index); | 354 | c = getopt_long(argc, argv, "hc:i:s:tvu", long_options, &option_index); |
351 | if (c == -1) { | 355 | if (c == -1) { |
352 | break; | 356 | break; |
353 | } | 357 | } |
@@ -412,6 +416,9 @@ int main(int argc, char **argv) { | |||
412 | #endif | 416 | #endif |
413 | exit(EXIT_SUCCESS); | 417 | exit(EXIT_SUCCESS); |
414 | break; | 418 | break; |
419 | case 'u': | ||
420 | show_indicator = false; | ||
421 | break; | ||
415 | default: | 422 | default: |
416 | fprintf(stderr, "%s", usage); | 423 | fprintf(stderr, "%s", usage); |
417 | exit(EXIT_FAILURE); | 424 | exit(EXIT_FAILURE); |
@@ -575,7 +582,7 @@ void render(struct render_data *render_data) { | |||
575 | const float TYPE_INDICATOR_BORDER_THICKNESS = M_PI / 128.0f; | 582 | const float TYPE_INDICATOR_BORDER_THICKNESS = M_PI / 128.0f; |
576 | 583 | ||
577 | // Add visual indicator | 584 | // Add visual indicator |
578 | if (render_data->auth_state != AUTH_STATE_IDLE) { | 585 | if (show_indicator && render_data->auth_state != AUTH_STATE_IDLE) { |
579 | // Draw circle | 586 | // Draw circle |
580 | cairo_set_line_width(window->cairo, ARC_THICKNESS); | 587 | cairo_set_line_width(window->cairo, ARC_THICKNESS); |
581 | cairo_arc(window->cairo, window->width/2, window->height/2, ARC_RADIUS, 0, 2 * M_PI); | 588 | cairo_arc(window->cairo, window->width/2, window->height/2, ARC_RADIUS, 0, 2 * M_PI); |
diff --git a/swaylock/swaylock.1.txt b/swaylock/swaylock.1.txt index c30e8d3d..c139fb4a 100644 --- a/swaylock/swaylock.1.txt +++ b/swaylock/swaylock.1.txt | |||
@@ -35,6 +35,9 @@ Options | |||
35 | *-t, --tiling*:: | 35 | *-t, --tiling*:: |
36 | Same as --scaling=tile. | 36 | Same as --scaling=tile. |
37 | 37 | ||
38 | *-u, --no-unlock-indicator*:: | ||
39 | Disable the unlock indicator. | ||
40 | |||
38 | *-v, \--version*:: | 41 | *-v, \--version*:: |
39 | Show the version number and quit. | 42 | Show the version number and quit. |
40 | 43 | ||