aboutsummaryrefslogtreecommitdiffstats
path: root/swaylock
diff options
context:
space:
mode:
authorLibravatar Zandr Martin <zandrmartin+git@gmail.com>2016-05-26 10:16:34 -0500
committerLibravatar Zandr Martin <zandrmartin+git@gmail.com>2016-05-26 10:16:34 -0500
commit54d38d3931c55bb7ce8c88a2c7578c14215f0741 (patch)
treeb9259a3cb1025d5b4529a259421a75e9d4c9fa75 /swaylock
parentMerge pull request #672 from zandrmartin/add-ctrlu-to-swaylock (diff)
downloadsway-54d38d3931c55bb7ce8c88a2c7578c14215f0741.tar.gz
sway-54d38d3931c55bb7ce8c88a2c7578c14215f0741.tar.zst
sway-54d38d3931c55bb7ce8c88a2c7578c14215f0741.zip
add --no-unlock-indicator to swaylock
Diffstat (limited to 'swaylock')
-rw-r--r--swaylock/main.c11
-rw-r--r--swaylock/swaylock.1.txt3
2 files changed, 12 insertions, 2 deletions
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
21struct registry *registry; 22struct registry *registry;
22struct render_data render_data; 23struct render_data render_data;
24bool show_indicator = true;
23 25
24void wl_dispatch_events() { 26void 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