mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-23 16:33:25 +01:00
Example conf updated
This commit is contained in:
parent
18610668b8
commit
8960eb98f4
@ -22,6 +22,7 @@ LIBS = libtoxcore ncursesw libconfig
|
|||||||
CFLAGS = -std=gnu99 -pthread -Wall -g
|
CFLAGS = -std=gnu99 -pthread -Wall -g
|
||||||
CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
|
CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED
|
||||||
CFLAGS += -DPACKAGE_DATADIR="\"$(abspath $(DATADIR))\""
|
CFLAGS += -DPACKAGE_DATADIR="\"$(abspath $(DATADIR))\""
|
||||||
|
CFLAGS += -fdiagnostics-color
|
||||||
CFLAGS += $(USER_CFLAGS)
|
CFLAGS += $(USER_CFLAGS)
|
||||||
LDFLAGS = $(USER_LDFLAGS)
|
LDFLAGS = $(USER_LDFLAGS)
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// SAMPLE TOXIC CONFIGURATION
|
|
||||||
// USES LIBCONFIG-ACCEPTED SYNTAX
|
|
||||||
|
|
||||||
ui = {
|
ui = {
|
||||||
// true to enable timestamps, false to disable
|
// true to enable timestamps, false to disable
|
||||||
@ -10,43 +8,22 @@ ui = {
|
|||||||
|
|
||||||
// true to use native terminal colours, false to use toxic default colour theme
|
// true to use native terminal colours, false to use toxic default colour theme
|
||||||
native_colors:false;
|
native_colors:false;
|
||||||
|
|
||||||
// true to enable autologging, false to disable
|
|
||||||
autolog:false;
|
|
||||||
|
|
||||||
// 24 or 12 hour time
|
|
||||||
time_format=24;
|
time_format=24;
|
||||||
|
autolog:false;
|
||||||
// maximum lines for chat window history
|
|
||||||
history_size=700;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
audio = {
|
//Only Ctrl modified keys and Tab supported right now
|
||||||
// preferred audio input device; numbers correspond to /lsdev in
|
//All printable keys register as input anyway
|
||||||
input_device=2;
|
keys = {
|
||||||
|
next_tab="Ctrl+P";
|
||||||
// preferred audio output device; numbers correspond to /lsdev out
|
//next_tab="Tab";
|
||||||
output_device=0;
|
prev_tab="Ctrl+O";
|
||||||
|
scroll_line_up="PAGEUP";
|
||||||
// default VAD treshold; float (recommended values are around 40)
|
scroll_line_down="PAGEDOWN";
|
||||||
VAD_treshold=40.0;
|
half_page_up="Ctrl+F";
|
||||||
|
half_page_down="Ctrl+V";
|
||||||
|
page_bottom="Ctrl+H";
|
||||||
|
peer_list_up="Ctrl+[";
|
||||||
|
peer_list_down="Ctrl+]";
|
||||||
};
|
};
|
||||||
|
|
||||||
tox = {
|
|
||||||
// where to store received files
|
|
||||||
// download_path="/home/USERNAME/Downloads/";
|
|
||||||
};
|
|
||||||
|
|
||||||
// To disable a sound set the path to "silent"
|
|
||||||
sounds = {
|
|
||||||
error="__DATADIR__/sounds/Error.wav";
|
|
||||||
self_log_in="__DATADIR__/sounds/LogIn.wav";
|
|
||||||
self_log_out="__DATADIR__/sounds/LogOut.wav";
|
|
||||||
user_log_in="__DATADIR__/sounds/ContactLogsIn.wav";
|
|
||||||
user_log_out="__DATADIR__/sounds/ContactLogsOut.wav";
|
|
||||||
call_incoming="__DATADIR__/sounds/IncomingCall.wav";
|
|
||||||
call_outgoing="__DATADIR__/sounds/OutgoingCall.wav";
|
|
||||||
generic_message="__DATADIR__/sounds/NewMessage.wav";
|
|
||||||
transfer_pending="__DATADIR__/sounds/TransferPending.wav";
|
|
||||||
transfer_completed="__DATADIR__/sounds/TransferComplete.wav";
|
|
||||||
};
|
|
||||||
|
@ -201,8 +201,6 @@ int settings_load(struct user_settings *s, const char *patharg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!config_read_file(cfg, path)) {
|
if (!config_read_file(cfg, path)) {
|
||||||
char* chk = config_error_text(cfg);
|
|
||||||
int lin = config_error_line(cfg);
|
|
||||||
config_destroy(cfg);
|
config_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -226,15 +224,16 @@ int settings_load(struct user_settings *s, const char *patharg)
|
|||||||
}
|
}
|
||||||
/* keys */
|
/* keys */
|
||||||
if((setting = config_lookup(cfg, key_strings.self)) != NULL) {
|
if((setting = config_lookup(cfg, key_strings.self)) != NULL) {
|
||||||
config_setting_lookup_int(setting, key_strings.next_tab, &s->key_next_tab);
|
const char* tmp = NULL;
|
||||||
config_setting_lookup_int(setting, key_strings.prev_tab, &s->key_prev_tab);
|
if(config_setting_lookup_string(setting, key_strings.next_tab, &tmp)) s->key_next_tab = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.scroll_line_up, &s->key_scroll_line_up);
|
if(config_setting_lookup_string(setting, key_strings.prev_tab, &tmp)) s->key_prev_tab = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.scroll_line_down, &s->key_scroll_line_down);
|
if(config_setting_lookup_string(setting, key_strings.scroll_line_up, &tmp)) s->key_scroll_line_up = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.half_page_up, &s->key_half_page_up);
|
if(config_setting_lookup_string(setting, key_strings.scroll_line_down, &tmp)) s->key_scroll_line_down= key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.half_page_down, &s->key_half_page_down);
|
if(config_setting_lookup_string(setting, key_strings.half_page_up, &tmp)) s->key_half_page_up = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.page_bottom, &s->key_page_bottom);
|
if(config_setting_lookup_string(setting, key_strings.half_page_down, &tmp)) s->key_half_page_down = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.peer_list_up, &s->key_peer_list_up);
|
if(config_setting_lookup_string(setting, key_strings.page_bottom, &tmp)) s->key_page_bottom = key_parse(&tmp);
|
||||||
config_setting_lookup_int(setting, key_strings.peer_list_down, &s->key_peer_list_down);
|
if(config_setting_lookup_string(setting, key_strings.peer_list_up, &tmp)) s->key_peer_list_up = key_parse(&tmp);
|
||||||
|
if(config_setting_lookup_string(setting, key_strings.peer_list_down, &tmp)) s->key_peer_list_down = key_parse(&tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _AUDIO
|
#ifdef _AUDIO
|
||||||
@ -328,3 +327,14 @@ int settings_load(struct user_settings *s, const char *patharg)
|
|||||||
config_destroy(cfg);
|
config_destroy(cfg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int key_parse(const char** bind){
|
||||||
|
if(strlen(*bind) > 5){
|
||||||
|
if(strncmp(*bind,"Ctrl+", 5)==0) return bind[0][5]-'A'+1;
|
||||||
|
}
|
||||||
|
if(strncmp(*bind,"Tab",3)==0) return 9;
|
||||||
|
if(strncmp(*bind,"PAGE",4==0)) {
|
||||||
|
if(strlen(*bind) == 6) return 0523;
|
||||||
|
return 0522;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
@ -69,5 +69,5 @@ enum {
|
|||||||
} settings_values;
|
} settings_values;
|
||||||
|
|
||||||
int settings_load(struct user_settings *s, const char *patharg);
|
int settings_load(struct user_settings *s, const char *patharg);
|
||||||
|
int key_parse(const char** bind);
|
||||||
#endif /* #define _settings_h */
|
#endif /* #define _settings_h */
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
ui = {
|
|
||||||
// true to enable timestamps, false to disable
|
|
||||||
timestamps:true;
|
|
||||||
|
|
||||||
// true to enable terminal alerts on messages, false to disable
|
|
||||||
alerts:true;
|
|
||||||
|
|
||||||
// true to use native terminal colours, false to use toxic default colour theme
|
|
||||||
native_colors:false;
|
|
||||||
time_format=24;
|
|
||||||
autolog:false;
|
|
||||||
};
|
|
||||||
|
|
||||||
//Only Ctrl modified keys and Tab supported right now
|
|
||||||
//All printable keys register as input anyway
|
|
||||||
keys = {
|
|
||||||
next_tab="Ctrl+P";
|
|
||||||
//next_tab="Tab";
|
|
||||||
prev_tab="Ctrl+O";
|
|
||||||
scroll_line_up="PAGEUP";
|
|
||||||
scroll_line_down="PAGEDOWN";
|
|
||||||
half_page_up="Ctrl+F";
|
|
||||||
half_page_down="Ctrl+V";
|
|
||||||
page_bottom="Ctrl+H";
|
|
||||||
peer_list_up="Ctrl+[";
|
|
||||||
peer_list_down="Ctrl+]";
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user