mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-09 15:19:11 +02:00
Add support for default configuration file
This commit is contained in:
parent
47082c9afc
commit
2ab4955c46
3 changed files with 20 additions and 8 deletions
14
cagebreak.c
14
cagebreak.c
|
|
@ -192,7 +192,7 @@ set_configuration(struct cg_server *server,
|
|||
if(config_file == NULL) {
|
||||
wlr_log(WLR_ERROR, "Could not open config file \"%s\"",
|
||||
config_file_path);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
char line[MAX_LINE_SIZE * sizeof(char)];
|
||||
for(unsigned int line_num = 1;
|
||||
|
|
@ -557,7 +557,17 @@ main(int argc, char *argv[]) {
|
|||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
if(set_configuration(&server, config_file) != 0) {
|
||||
int conf_ret = set_configuration(&server, config_file);
|
||||
|
||||
// Configurtion file not found
|
||||
if(conf_ret == 1) {
|
||||
char *default_conf = "/etc/xdg/cagebreak/config";
|
||||
wlr_log(WLR_ERROR, "Loading default configuration file: \"%s\"",
|
||||
default_conf);
|
||||
conf_ret = set_configuration(&server, default_conf);
|
||||
}
|
||||
|
||||
if(conf_ret != 0) {
|
||||
free(config_file);
|
||||
ret = 1;
|
||||
goto end;
|
||||
|
|
|
|||
|
|
@ -75,14 +75,14 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1
|
|||
######################
|
||||
#Output configuration
|
||||
######################
|
||||
output eDP-1 pos 0 0 res 1366x768 rate 60
|
||||
output eDP-1 disable
|
||||
output eDP-1 enable
|
||||
#output eDP-1 pos 0 0 res 1366x768 rate 60
|
||||
#output eDP-1 disable
|
||||
#output eDP-1 enable
|
||||
|
||||
#####################
|
||||
#Input configuration
|
||||
#####################
|
||||
|
||||
input 1234:0:Device_Ident click_method clickfinger
|
||||
input type:pointer scroll_method two_finger
|
||||
input * calibration_matrix 1 2 3 4 5 6
|
||||
#input 1234:0:Device_Ident click_method clickfinger
|
||||
#input type:pointer scroll_method two_finger
|
||||
#input * calibration_matrix 1 2 3 4 5 6
|
||||
|
|
|
|||
|
|
@ -258,6 +258,8 @@ executable(
|
|||
c_args: fuzz_compile_args,
|
||||
)
|
||||
|
||||
install_data('examples/config',install_dir: '/etc/xdg/cagebreak')
|
||||
|
||||
if get_option('man-pages')
|
||||
scdoc = find_program('scdoc')
|
||||
sh = find_program('sh')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue