2014-10-22 11:53:03 +02:00
|
|
|
/* Copyright (c) 2012, Bastien Dejean
|
2013-10-08 21:05:56 +02:00
|
|
|
* All rights reserved.
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
2014-01-19 14:41:37 +01:00
|
|
|
*
|
2014-01-18 16:30:00 +01:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
2013-10-08 21:05:56 +02:00
|
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
2014-01-18 16:30:00 +01:00
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
2013-10-08 21:05:56 +02:00
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2015-12-22 19:25:45 +01:00
|
|
|
#include <stdio.h>
|
2012-09-11 13:12:53 +02:00
|
|
|
#include <unistd.h>
|
2015-12-22 19:25:45 +01:00
|
|
|
#include <sys/types.h>
|
2012-09-11 13:12:53 +02:00
|
|
|
#include "bspwm.h"
|
2012-08-20 22:38:29 +02:00
|
|
|
#include "settings.h"
|
2012-07-30 14:54:20 +02:00
|
|
|
|
2013-07-29 10:27:04 +02:00
|
|
|
void run_config(void)
|
2012-09-11 13:12:53 +02:00
|
|
|
{
|
2014-01-18 16:30:00 +01:00
|
|
|
if (fork() == 0) {
|
2015-12-22 19:25:45 +01:00
|
|
|
if (dpy != NULL) {
|
2014-01-18 16:30:00 +01:00
|
|
|
close(xcb_get_file_descriptor(dpy));
|
2015-12-22 19:25:45 +01:00
|
|
|
}
|
2014-01-18 16:30:00 +01:00
|
|
|
setsid();
|
|
|
|
execl(config_path, config_path, NULL);
|
|
|
|
err("Couldn't execute the configuration file.\n");
|
|
|
|
}
|
2012-09-11 13:12:53 +02:00
|
|
|
}
|
|
|
|
|
2012-09-27 10:46:04 +02:00
|
|
|
void load_settings(void)
|
2012-07-30 19:43:54 +02:00
|
|
|
{
|
2014-01-18 16:30:00 +01:00
|
|
|
snprintf(external_rules_command, sizeof(external_rules_command), "%s", EXTERNAL_RULES_COMMAND);
|
|
|
|
snprintf(status_prefix, sizeof(status_prefix), "%s", STATUS_PREFIX);
|
2013-11-05 20:09:24 +01:00
|
|
|
|
2014-01-18 16:30:00 +01:00
|
|
|
snprintf(normal_border_color, sizeof(normal_border_color), "%s", NORMAL_BORDER_COLOR);
|
|
|
|
snprintf(active_border_color, sizeof(active_border_color), "%s", ACTIVE_BORDER_COLOR);
|
2015-12-22 19:25:45 +01:00
|
|
|
snprintf(focused_border_color, sizeof(focused_border_color), "%s", FOCUSED_BORDER_COLOR);
|
|
|
|
snprintf(presel_feedback_color, sizeof(presel_feedback_color), "%s", PRESEL_FEEDBACK_COLOR);
|
2012-08-07 12:17:47 +02:00
|
|
|
|
2016-03-21 14:28:04 +01:00
|
|
|
padding = (padding_t) PADDING;
|
2014-05-06 18:24:25 +02:00
|
|
|
window_gap = WINDOW_GAP;
|
|
|
|
border_width = BORDER_WIDTH;
|
2015-12-22 19:25:45 +01:00
|
|
|
split_ratio = SPLIT_RATIO;
|
2015-01-06 20:10:09 +01:00
|
|
|
initial_polarity = FIRST_CHILD;
|
2016-04-07 18:08:32 +02:00
|
|
|
pointer_modifier = POINTER_MODIFIER;
|
2016-05-28 09:43:05 +02:00
|
|
|
pointer_motion_interval = POINTER_MOTION_INTERVAL;
|
2012-09-29 10:10:58 +02:00
|
|
|
|
2016-04-11 02:53:05 +10:00
|
|
|
pointer_actions[0] = ACTION_MOVE;
|
|
|
|
pointer_actions[1] = ACTION_RESIZE_SIDE;
|
|
|
|
pointer_actions[2] = ACTION_RESIZE_CORNER;
|
|
|
|
|
2014-01-18 16:30:00 +01:00
|
|
|
borderless_monocle = BORDERLESS_MONOCLE;
|
|
|
|
gapless_monocle = GAPLESS_MONOCLE;
|
2016-01-10 18:29:51 +01:00
|
|
|
paddingless_monocle = PADDINGLESS_MONOCLE;
|
2015-12-22 19:25:45 +01:00
|
|
|
single_monocle = SINGLE_MONOCLE;
|
2014-01-18 16:30:00 +01:00
|
|
|
focus_follows_pointer = FOCUS_FOLLOWS_POINTER;
|
2014-10-22 11:24:51 +02:00
|
|
|
pointer_follows_focus = POINTER_FOLLOWS_FOCUS;
|
2014-01-18 16:30:00 +01:00
|
|
|
pointer_follows_monitor = POINTER_FOLLOWS_MONITOR;
|
|
|
|
ignore_ewmh_focus = IGNORE_EWMH_FOCUS;
|
2015-01-15 14:18:25 +01:00
|
|
|
center_pseudo_tiled = CENTER_PSEUDO_TILED;
|
2016-04-07 18:08:32 +02:00
|
|
|
click_to_focus = CLICK_TO_FOCUS;
|
|
|
|
honor_size_hints = HONOR_SIZE_HINTS;
|
2014-05-05 11:58:12 +02:00
|
|
|
remove_disabled_monitors = REMOVE_DISABLED_MONITORS;
|
2014-05-05 11:46:55 +02:00
|
|
|
remove_unplugged_monitors = REMOVE_UNPLUGGED_MONITORS;
|
2014-05-05 11:54:49 +02:00
|
|
|
merge_overlapping_monitors = MERGE_OVERLAPPING_MONITORS;
|
2012-08-01 12:25:18 +02:00
|
|
|
}
|