Changeset 2484 for neercs/trunk
- Timestamp:
- Jun 24, 2008, 4:13:18 PM (13 years ago)
- Location:
- neercs/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/man/neercs.1
r2472 r2484 11 11 ($SHELL environment variable). 12 12 .PP 13 \fBneercs\fR will search for a configuration file called \fBneercs.ini\fR in14 the current directory, your home directory, and /etc(in that order).13 \fBneercs\fR will search for a configuration file called /etc/neercs.conf, then \fB.neercsrc\fR in 14 your home directory (in that order). 15 15 .SH EXAMPLES 16 16 .PP -
neercs/trunk/src/main.c
r2481 r2484 28 28 #include <sys/time.h> 29 29 #include <time.h> 30 #include <pwd.h> 31 30 32 31 33 #if !defined HAVE_GETOPT_LONG … … 78 80 struct screen_list *screen_list = NULL; 79 81 struct recurrent_list *recurrent_list = NULL; 80 char *default_shell = NULL; 82 struct passwd *user_info; 83 char *default_shell = NULL, *user_path = NULL; 81 84 int i, w, h, args, s=0; 82 85 int eof = 0, refresh = 1, command = 0; … … 133 136 memset(screen_list->lockpass, 0, 1024); 134 137 135 if(!read_configuration_file("neercs.ini", screen_list)) 136 { 137 138 if(!read_configuration_file("~/neercs.ini", screen_list)) 139 { 140 if(!read_configuration_file("/etc/neercs.ini", screen_list)) 141 { 142 printf("Failed to read configuration file\n"); 143 } 144 } 145 } 138 139 /* Read global configuration first */ 140 read_configuration_file("/etc/neercs.conf", screen_list); 141 142 /* Then local one */ 143 user_info = getpwuid(getuid()); 144 if(user_info) 145 { 146 user_path = malloc(strlen(user_info->pw_dir) + strlen("/.neercsrc") + 1); 147 sprintf(user_path, "%s/%s", user_info->pw_dir, ".neercsrc"); 148 read_configuration_file(user_path, screen_list); 149 free(user_path); 150 } 151 146 152 147 153 recurrent_list = (struct recurrent_list*) malloc(sizeof(struct recurrent_list)); … … 277 283 last_key_time = get_us(); 278 284 279 /* Refresh */280 caca_refresh_display(dp);281 285 282 286 for(;;) … … 524 528 { 525 529 draw_lock(cv, screen_list); 526 caca_refresh_display(dp);530 refresh = 1; 527 531 } 528 532 else … … 531 535 (get_us() - last_key_time < screen_list->screensaver_timeout)) 532 536 { 533 refresh = 0;534 537 refresh_screens(cv, screen_list); 535 538 if(screen_list->screen[screen_list->pty]->title) … … 537 540 else 538 541 caca_set_display_title(dp, PACKAGE_STRING); 539 caca_refresh_display(dp); 542 refresh = 1; 543 540 544 } 541 545 … … 548 552 caca_set_cursor(dp, 0); 549 553 draw_screensaver(cv, dp, screen_list); 550 caca_refresh_display(dp); 551 } 554 refresh = 1; 555 } 556 } 557 558 /* Refresh screen if needed */ 559 if(refresh) 560 { 561 caca_refresh_display(dp); 562 refresh = 0; 552 563 } 553 564 … … 601 612 free(recurrent_list->recurrent); 602 613 free(recurrent_list); 614 615 free(user_path); 616 603 617 604 618 return mainret; -
neercs/trunk/src/neercs.ini
r2465 r2484 11 11 [windows] 12 12 window_manager = hsplit ; full card hsplit vsplit 13 status_bar = true ; Activate status bar 13 14 14 15 [eyecandy] ; Not-that-useful stuff 15 thumbnails = true ; Activate thumbnails 16 status_bar = true ; Activate status bar 16 thumbnails = false ; Activate thumbnails 17 17 screensaver_timeout = 60 ; Screen Saver timeout in seconds, 0 to desactivate
Note: See TracChangeset
for help on using the changeset viewer.