diff --git a/README.md b/README.md index 512bf0b..b41e99b 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ force_update=1 ### Configuration All the configuration takes place in `/etc/ly/config.ini`. -A complete reference is available on the wiki. +The file is commented, and includes useful defaults. ### Controls Use the up and down arrow keys to change the current field, and the @@ -70,6 +70,8 @@ while on the desktop field (above the login field). ### Tips The numlock and capslock state is printed in the top-right corner. Use the F1 and F2 keys to respectively shutdown and reboot. +Take a look at your .xsession if X doesn't start, as it can interfere +(this filed is launched with X to configure the display properly). ### Additionnal informations The name "Ly" is a tribute to the fairy from the game Rayman. diff --git a/res/config.ini b/res/config.ini index c9d607f..e2aba4d 100644 --- a/res/config.ini +++ b/res/config.ini @@ -1,13 +1,67 @@ [box_main] -bg=0x000000 -fg=0x00ff00 -margin_box_main_h=2 -margin_box_main_v=1 -input_len=34 -blank_box=1 -min_refresh_delta=10 -force_update=1 -animate=1 +# spaces between border and content +#margin_box_main_h=2 +#margin_box_main_v=1 + +# visible input characters limit +#input_len=34 + +# background and foreground truecolors +#bg=0x000000 +#fg=0xffffff + +# total input characters limit - the values here are safe static defaults +# these are detected automatically if empty, though +#max_desktop_len=100 +#max_login_len=255 +#max_password_len=255 + +# animation stuff - the values here enable the example spiral +# event timeout in millis +#min_refresh_delta=10 +# blank the background of the main box on update +#blank_box=1 +# force update the screen on event timeout +#force_update=1 +# use a background animation +#animate=1 + +# xsessions path +#xsessions=/usr/share/xsessions + +# do not set this, pam requires it to be "login" +#service_name=login + +#x_cmd=/usr/bin/X +#x_cmd_setup=/etc/ly/xsetup.sh +#mcookie_cmd=/usr/bin/mcookie +#xauthority=.lyxauth +#path=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/env + +# shutdown is given parameters, do not use an alternative +# this is here only to allow you to change its location +#shutdown_cmd=/sbin/shutdown + +# reflect this change in ly.service as well +#console_dev=/dev/console +#tty=2 + +# login and desktop environment fields persistence save=1 load=1 +#save_file=/etc/ly/ly.save + +# if your screen resolution is not detected properly +# and the main box is not center, you can force it here +#custom_res=1 +#res_width=100 +#res_height=50 +# also, if you endure an nvidia graphics card, this might help you +# https://wiki.archlinux.org/index.php/NVIDIA/Tips_and_tricks#Fixing_terminal_resolution + +# x log visibility and output hide_x=1 +#hide_x_save_log=/dev/null + +# pour les compatriotes +#lang=fr diff --git a/src/config.c b/src/config.c index 6df1f10..2d1e733 100644 --- a/src/config.c +++ b/src/config.c @@ -369,10 +369,6 @@ int config_config_handler(void* user, const char* section, const char* name, con { cfg_dup(&config.service_name, value); } - else if (strcmp(name, "tty_id") == 0) - { - config.tty_id = abs(atoi(value)); - } else if (strcmp(name, "x_cmd") == 0) { cfg_dup(&config.x_cmd, value); @@ -508,23 +504,6 @@ void config_config_patch() { config.min_refresh_delta = 1000; } - - // commenting theses because the defaults are 0 - //#if 0 - if (config.blank_box == 0) - { - config.blank_box = false; - } - if (config.force_update == 0) - { - config.force_update = false; - } - if (config.animate == 0) - { - config.animate = 0; - } - //#endif - if (config.xsessions == 0) { config.xsessions = strdup("/usr/share/xsessions"); @@ -533,10 +512,6 @@ void config_config_patch() { config.service_name = strdup("login"); } - if (config.tty_id == 0) - { - config.tty_id = 2; - } if (config.x_cmd == 0) { config.x_cmd = strdup("/usr/bin/X"); diff --git a/src/config.h b/src/config.h index 44a8550..287d514 100644 --- a/src/config.h +++ b/src/config.h @@ -63,7 +63,6 @@ struct config u16 animate; char* xsessions; char* service_name; - u16 tty_id; char* x_cmd; char* x_cmd_setup; char* mcookie_cmd; diff --git a/src/login.c b/src/login.c index 0c5af43..6618a48 100644 --- a/src/login.c +++ b/src/login.c @@ -273,8 +273,8 @@ enum err login_desktop(struct desktop* desktop, display_id = get_free_display(); snprintf(display_name, sizeof(display_name), ":%d", display_id); - snprintf(tty_id, sizeof(tty_id), "%d", config.tty_id); - snprintf(vt, sizeof(vt), "vt%d", config.tty_id); + snprintf(tty_id, sizeof(tty_id), "%d", config.tty); + snprintf(vt, sizeof(vt), "vt%d", config.tty); // starting pam transations pam_result = pam_start(config.service_name, login->text, &conv, &handle);