Changeset 3959 for neercs/trunk


Ignore:
Timestamp:
Nov 19, 2009, 2:53:09 PM (11 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added --lock-after (-l) command line option (locks after N seconds), fixed indentation glitch
Location:
neercs/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/configuration.c

    r3942 r3959  
    314314        }  else if(IS_TOKEN("autolock_timeout"))
    315315        {
    316             screen_list->autolock_timeout = atoi(option->value) * 1000000;
    317             /* if timeout is 0, set it to 0xFFFFFFFFFFFFFFFF */
    318             if(!screen_list->autolock_timeout) screen_list->autolock_timeout-=1;
     316            debug("Autolock is %d\n", screen_list->autolock_timeout);
     317            if(screen_list->autolock_timeout == 0 ||
     318               screen_list->autolock_timeout == -1)
     319            {
     320                screen_list->autolock_timeout = atoi(option->value) * 1000000;
     321                /* if timeout is 0, set it to 0xFFFFFFFFFFFFFFFF */
     322                if(!screen_list->autolock_timeout) screen_list->autolock_timeout-=1;
     323            }
    319324        }  else if(IS_TOKEN("lock_on_detach"))
    320325        {
  • neercs/trunk/src/main.c

    r3942 r3959  
    7373    printf("\t\t\t-R [session]\t\treattach if possible, otherwise start a new session\n");
    7474    printf("\t\t\t-S <name>\t\tname this session <name> instead of <pid>\n");
     75    printf("\t--lock-after\t-l [n]\t\t\tlock screen after n seconds\n");
    7576    printf("\t--version\t-v \t\t\tdisplay version and exit\n");
    7677    printf("\t--help\t\t-h \t\t\tthis help\n");
     
    349350                { "pid",         0, NULL, 'P' },
    350351#endif
     352                { "lock-after",  1, NULL, 'l' },
    351353                { "help",        0, NULL, 'h' },
    352354                { "version",     0, NULL, 'v' },
     
    354356            };
    355357#if defined USE_GRAB
    356         int c = mygetopt(argc, argv, "c:S:R::r::P::hv", long_options, &option_index);
     358        int c = mygetopt(argc, argv, "c:S:R::l::r::P::hv", long_options, &option_index);
    357359#else
    358         int c = mygetopt(argc, argv, "c:S:R::r::hv", long_options, &option_index);
     360        int c = mygetopt(argc, argv, "c:S:R::l::r::hv", long_options, &option_index);
    359361#endif
    360362        if(c == -1)
     
    407409            s+=2;
    408410            break;
     411        case 'l':
     412            screen_list->autolock_timeout = atoi(myoptarg) * 1000000;
     413                debug("Command line autolock : %d\n", screen_list->autolock_timeout);
     414            break;
    409415        case 'r':
    410416            screen_list->forceattach = 1;
  • neercs/trunk/src/term.c

    r3957 r3959  
    597597            size_t bytes;
    598598
    599             if(i + 6 < size) {
     599            if(i + 6 < size)
     600            {
    600601                ch = caca_utf8_to_utf32((char const *)(buffer + i), &bytes);
    601602            } else
Note: See TracChangeset for help on using the changeset viewer.