mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 09:21:28 +00:00
Spaces to Tabs
This commit is contained in:
parent
68beabda03
commit
7c02a1967b
|
@ -79,10 +79,10 @@ int cmd_exec(struct sway_config *config, int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (config->reloading) {
|
||||
sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc));
|
||||
return 0;
|
||||
}
|
||||
if (config->reloading) {
|
||||
sway_log(L_DEBUG, "Ignoring exec %s due to reload", join_args(argv, argc));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fork() == 0) {
|
||||
char *args = join_args(argv, argc);
|
||||
|
@ -190,7 +190,7 @@ int cmd_reload(struct sway_config *config, int argc, char **argv) {
|
|||
if (!f) {
|
||||
sway_log(L_ERROR, "Sway config file not found, aborting reload!");
|
||||
free(temp);
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
free(temp);
|
||||
config = read_config(f, true);
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "config.h"
|
||||
|
||||
struct cmd_handler {
|
||||
char *command;
|
||||
int (*handle)(struct sway_config *config, int argc, char **argv);
|
||||
char *command;
|
||||
int (*handle)(struct sway_config *config, int argc, char **argv);
|
||||
};
|
||||
|
||||
int handle_command(struct sway_config *config, char *command);
|
||||
|
|
|
@ -18,16 +18,16 @@ void config_defaults(struct sway_config *config) {
|
|||
// Flags
|
||||
config->focus_follows_mouse = true;
|
||||
config->mouse_warping = true;
|
||||
config->reloading = false;
|
||||
config->reloading = false;
|
||||
}
|
||||
|
||||
struct sway_config *read_config(FILE *file, bool is_active) {
|
||||
struct sway_config *config = malloc(sizeof(struct sway_config));
|
||||
config_defaults(config);
|
||||
|
||||
if (is_active) {
|
||||
config->reloading = true;
|
||||
}
|
||||
if (is_active) {
|
||||
config->reloading = true;
|
||||
}
|
||||
|
||||
bool success = true;
|
||||
|
||||
|
@ -61,9 +61,9 @@ _continue:
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (is_active) {
|
||||
config->reloading = true;
|
||||
}
|
||||
if (is_active) {
|
||||
config->reloading = true;
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -6,31 +6,31 @@
|
|||
#include "list.h"
|
||||
|
||||
struct sway_variable {
|
||||
char *name;
|
||||
char *value;
|
||||
char *name;
|
||||
char *value;
|
||||
};
|
||||
|
||||
struct sway_binding {
|
||||
list_t *keys;
|
||||
uint32_t modifiers;
|
||||
char *command;
|
||||
list_t *keys;
|
||||
uint32_t modifiers;
|
||||
char *command;
|
||||
};
|
||||
|
||||
struct sway_mode {
|
||||
char *name;
|
||||
list_t *bindings;
|
||||
char *name;
|
||||
list_t *bindings;
|
||||
};
|
||||
|
||||
struct sway_config {
|
||||
list_t *symbols;
|
||||
list_t *modes;
|
||||
struct sway_mode *current_mode;
|
||||
list_t *symbols;
|
||||
list_t *modes;
|
||||
struct sway_mode *current_mode;
|
||||
|
||||
// Flags
|
||||
bool focus_follows_mouse;
|
||||
bool mouse_warping;
|
||||
// Flags
|
||||
bool focus_follows_mouse;
|
||||
bool mouse_warping;
|
||||
|
||||
bool reloading;
|
||||
bool reloading;
|
||||
};
|
||||
|
||||
struct sway_config *read_config(FILE *file, bool is_active);
|
||||
|
|
|
@ -5,38 +5,38 @@
|
|||
#include "list.h"
|
||||
|
||||
struct sway_container {
|
||||
wlc_handle handle;
|
||||
wlc_handle handle;
|
||||
|
||||
enum {
|
||||
C_ROOT,
|
||||
C_OUTPUT,
|
||||
C_WORKSPACE,
|
||||
C_CONTAINER,
|
||||
C_VIEW
|
||||
} type;
|
||||
enum {
|
||||
C_ROOT,
|
||||
C_OUTPUT,
|
||||
C_WORKSPACE,
|
||||
C_CONTAINER,
|
||||
C_VIEW
|
||||
} type;
|
||||
|
||||
enum {
|
||||
L_NONE,
|
||||
L_HORIZ,
|
||||
L_VERT,
|
||||
L_STACKED,
|
||||
L_TABBED,
|
||||
L_FLOATING
|
||||
} layout;
|
||||
enum {
|
||||
L_NONE,
|
||||
L_HORIZ,
|
||||
L_VERT,
|
||||
L_STACKED,
|
||||
L_TABBED,
|
||||
L_FLOATING
|
||||
} layout;
|
||||
|
||||
// Not including borders or margins
|
||||
int width, height;
|
||||
// Not including borders or margins
|
||||
int width, height;
|
||||
|
||||
int x, y;
|
||||
int x, y;
|
||||
|
||||
int weight;
|
||||
int weight;
|
||||
|
||||
char *name;
|
||||
char *name;
|
||||
|
||||
list_t *children;
|
||||
list_t *children;
|
||||
|
||||
struct sway_container *parent;
|
||||
struct sway_container *focused;
|
||||
struct sway_container *parent;
|
||||
struct sway_container *focused;
|
||||
};
|
||||
|
||||
typedef struct sway_container swayc_t;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#define _SWAY_LIST_H
|
||||
|
||||
typedef struct {
|
||||
int capacity;
|
||||
int length;
|
||||
void **items;
|
||||
int capacity;
|
||||
int length;
|
||||
void **items;
|
||||
} list_t;
|
||||
|
||||
list_t *create_list();
|
||||
|
|
|
@ -18,7 +18,7 @@ void init_log(int verbosity) {
|
|||
}
|
||||
|
||||
void sway_log_colors(int mode) {
|
||||
colored = (mode == 1) ? 1 : 0;
|
||||
colored = (mode == 1) ? 1 : 0;
|
||||
}
|
||||
|
||||
void sway_abort(char *format, ...) {
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
#define _SWAY_LOG_H
|
||||
|
||||
typedef enum {
|
||||
L_SILENT = 0,
|
||||
L_ERROR = 1,
|
||||
L_INFO = 2,
|
||||
L_DEBUG = 3,
|
||||
L_SILENT = 0,
|
||||
L_ERROR = 1,
|
||||
L_INFO = 2,
|
||||
L_DEBUG = 3,
|
||||
} log_importance_t;
|
||||
|
||||
void init_log(int verbosity);
|
||||
|
|
Loading…
Reference in a new issue