Skip to content

Commit

Permalink
Allow en.ini load and add config to hide f1 commands (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
systemraen committed Apr 23, 2022
1 parent 2ca457a commit 9fd7779
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions res/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#hide_borders = false
#hide_borders = true

# remove f1 commands
#hide_f1_commands = false
#hide_f1_commands = true

# number of visible chars on an input
#input_len = 34

Expand Down
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ void config_load(const char *cfg_path)
{"default_input", &config.default_input, config_handle_u8},
{"fg", &config.fg, config_handle_u8},
{"hide_borders", &config.hide_borders, config_handle_bool},
{"hide_f1_commands", &config.hide_f1_commands, config_handle_bool},
{"input_len", &config.input_len, config_handle_u8},
{"lang", &config.lang, config_handle_str},
{"load", &config.load, config_handle_bool},
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct config
uint8_t default_input;
uint8_t fg;
bool hide_borders;
bool hide_f1_commands;
uint8_t input_len;
char* lang;
bool load;
Expand Down
9 changes: 3 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ int main(int argc, char** argv)
}

config_load(config_path);

if (strcmp(config.lang, "en") != 0)
{
lang_load();
}
lang_load();

void* input_structs[3] =
{
Expand Down Expand Up @@ -178,7 +174,8 @@ int main(int argc, char** argv)
animate(&buf);
draw_box(&buf);
draw_labels(&buf);
draw_f_commands();
if(!config.hide_f1_commands)
draw_f_commands();
draw_lock_state(&buf);
position_input(&buf, &desktop, &login, &password);
draw_desktop(&desktop);
Expand Down

0 comments on commit 9fd7779

Please sign in to comment.