@@ -68,6 +68,8 @@ enum log_importance {
6868
6969static enum log_importance verbosity = LOG_INFO ;
7070
71+ static bool lock_on_start = false;
72+
7173static void swayidle_log (enum log_importance importance , const char * fmt , ...) {
7274 if (importance < verbosity ) {
7375 return ;
@@ -780,7 +782,7 @@ static int parse_idlehint(int argc, char **argv) {
780782
781783static int parse_args (int argc , char * argv [], char * * config_path ) {
782784 int c ;
783- while ((c = getopt (argc , argv , "C:hdwS :" )) != -1 ) {
785+ while ((c = getopt (argc , argv , "C:hdwlS :" )) != -1 ) {
784786 switch (c ) {
785787 case 'C' :
786788 * config_path = strdup (optarg );
@@ -794,13 +796,17 @@ static int parse_args(int argc, char *argv[], char **config_path) {
794796 case 'S' :
795797 state .seat_name = strdup (optarg );
796798 break ;
799+ case 'l' :
800+ lock_on_start = true;
801+ break ;
797802 case 'h' :
798803 case '?' :
799804 printf ("Usage: %s [OPTIONS]\n" , argv [0 ]);
800805 printf (" -h\tthis help menu\n" );
801806 printf (" -C\tpath to config file\n" );
802807 printf (" -d\tdebug\n" );
803808 printf (" -w\twait for command to finish\n" );
809+ printf (" -l\tstart locked\n" );
804810 printf (" -S\tpick the seat to work with\n" );
805811 return 1 ;
806812 default :
@@ -1067,6 +1073,11 @@ int main(int argc, char *argv[]) {
10671073 display_event , NULL );
10681074 wl_event_source_check (source );
10691075
1076+
1077+ if (lock_on_start ) {
1078+ kill (getpid (), SIGUSR1 );
1079+ }
1080+
10701081 while (wl_event_loop_dispatch (state .event_loop , -1 ) != 1 ) {
10711082 // This space intentionally left blank
10721083 }
0 commit comments