mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 07:51:28 +00:00
Reload command now matches i3's implementation
(cherry picked from commit ea3ba203cc
)
This commit is contained in:
parent
585cf904c5
commit
f5ba5cbcf6
|
@ -500,6 +500,7 @@ struct sway_config {
|
|||
struct side_gaps gaps_outer;
|
||||
|
||||
list_t *config_chain;
|
||||
bool user_config_path;
|
||||
const char *current_config_path;
|
||||
const char *current_config;
|
||||
int current_config_line_number;
|
||||
|
|
|
@ -22,7 +22,12 @@ static void do_reload(void *data) {
|
|||
list_add(bar_ids, strdup(bar->id));
|
||||
}
|
||||
|
||||
if (!load_main_config(config->current_config_path, true, false)) {
|
||||
const char *path = NULL;
|
||||
if (config->user_config_path) {
|
||||
path = config->current_config_path;
|
||||
}
|
||||
|
||||
if (!load_main_config(path, true, false)) {
|
||||
sway_log(SWAY_ERROR, "Error(s) reloading config");
|
||||
list_free_items_and_destroy(bar_ids);
|
||||
return;
|
||||
|
@ -55,7 +60,12 @@ struct cmd_results *cmd_reload(int argc, char **argv) {
|
|||
return error;
|
||||
}
|
||||
|
||||
if (!load_main_config(config->current_config_path, true, true)) {
|
||||
const char *path = NULL;
|
||||
if (config->user_config_path) {
|
||||
path = config->current_config_path;
|
||||
}
|
||||
|
||||
if (!load_main_config(path, true, true)) {
|
||||
return cmd_results_new(CMD_FAILURE, "Error(s) reloading config.");
|
||||
}
|
||||
|
||||
|
|
|
@ -447,6 +447,7 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
|
|||
}
|
||||
}
|
||||
|
||||
config->user_config_path = file ? true : false;
|
||||
config->current_config_path = path;
|
||||
list_add(config->config_chain, real_path);
|
||||
|
||||
|
|
|
@ -272,7 +272,9 @@ set|plus|minus <amount>
|
|||
optional comment argument is ignored, but logged for debugging purposes.
|
||||
|
||||
*reload*
|
||||
Reloads the sway config file and applies any changes.
|
||||
Reloads the sway config file and applies any changes. The config file is
|
||||
located at path specified by the command line arguments when started,
|
||||
otherwise according to the priority stated in *sway*(1).
|
||||
|
||||
*rename workspace* [<old_name>] to <new_name>
|
||||
Rename either <old_name> or the focused workspace to the <new_name>
|
||||
|
|
Loading…
Reference in a new issue