summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md6
-rw-r--r--sway.1.txt12
-rw-r--r--sway/config.c2
4 files changed, 16 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1298a2ce..9e1e1dde 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.1.0)
2 2
3project(sway C) 3project(sway C)
4 4
5set(FALLBACK_CONFIG_DIR "/etc/sway/")
6add_definitions('-DFALLBACK_CONFIG_DIR=\"${FALLBACK_CONFIG_DIR}\"')
7
5set(CMAKE_C_FLAGS "-g") 8set(CMAKE_C_FLAGS "-g")
6set(CMAKE_C_STANDARD 99) 9set(CMAKE_C_STANDARD 99)
7SET(CMAKE_C_EXTENSIONS OFF) 10SET(CMAKE_C_EXTENSIONS OFF)
@@ -80,7 +83,7 @@ install(
80 COMPONENT runtime) 83 COMPONENT runtime)
81install( 84install(
82 FILES "${CMAKE_CURRENT_SOURCE_DIR}/config" 85 FILES "${CMAKE_CURRENT_SOURCE_DIR}/config"
83 DESTINATION /etc/sway/ 86 DESTINATION "${FALLBACK_CONFIG_DIR}"
84 COMPONENT configuration) 87 COMPONENT configuration)
85 88
86add_custom_target(man ALL) 89add_custom_target(man ALL)
diff --git a/README.md b/README.md
index a962e28a..4bbfa750 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,10 @@ On systems without logind, you need to suid the sway binary:
57## Configuration 57## Configuration
58 58
59If you already use i3, then copy your i3 config to `~/.config/sway/config` and 59If you already use i3, then copy your i3 config to `~/.config/sway/config` and
60it'll work out of the box. Otherwise, copy `/etc/sway/config` to 60it'll work out of the box. Otherwise, copy the sample configuration file to
61`~/.config/sway/config`. Run `man 5 sway` for information on the configuration. 61`~/.config/sway/config`. It is located at `/etc/sway/config`, unless the
62`DFALLBACK_CONFIG_DIR` flag has been set. Run `man 5 sway` for information on
63the configuration.
62 64
63## Running 65## Running
64 66
diff --git a/sway.1.txt b/sway.1.txt
index c80bd917..402b2d77 100644
--- a/sway.1.txt
+++ b/sway.1.txt
@@ -66,11 +66,13 @@ Configuration
66------------- 66-------------
67 67
68If _-c_ is not specified, sway will look in several locations for your config 68If _-c_ is not specified, sway will look in several locations for your config
69file. The default one is provided at /etc/sway/config. The suggested location for 69file. The suggested location for your config file is ~/.config/sway/config.
70your config file is ~/.config/sway/config. ~/.sway/config will also work, and the 70~/.sway/config will also work, and the rest of the usual XDG config locations
71rest of the usual XDG config locations are supported. If no sway config is found, 71are supported. At last, sway looks for a config file in a fallback directory,
72sway will attempt to load an i3 config from all the config locations i3 supports. 72which is /etc/sway/ by default. A standard configuration file is installed at
73If still nothing is found, you will receive an error. 73this location. If no sway config is found, sway will attempt to load an i3
74config from all the config locations i3 supports. If still nothing is found,
75you will receive an error.
74 76
75For information on the config file format, see **sway**(5). 77For information on the config file format, see **sway**(5).
76 78
diff --git a/sway/config.c b/sway/config.c
index 21507c59..dac3e8f8 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -136,7 +136,7 @@ static char *get_config_path(void) {
136 "$XDG_CONFIG_HOME/sway/config", 136 "$XDG_CONFIG_HOME/sway/config",
137 "$HOME/.i3/config", 137 "$HOME/.i3/config",
138 "$XDG_CONFIG_HOME/i3/config", 138 "$XDG_CONFIG_HOME/i3/config",
139 "/etc/sway/config", 139 FALLBACK_CONFIG_DIR "config",
140 "/etc/i3/config", 140 "/etc/i3/config",
141 }; 141 };
142 142