Added layer config option

This commit is contained in:
Scoopta 2020-07-27 21:49:21 -07:00
parent 3ab6a0d668
commit 592e427133
2 changed files with 17 additions and 1 deletions

View File

@ -174,6 +174,9 @@ Specifies whether the search bar should be hidden. Default is false.
.TP
.B dynamic_lines=\fIBOOL\fR
Specifies whether wofi should be dynamically shrunk to fit the number of visible lines or if it should always stay the same size. Default is false.
.TP
.B layer=\fILAYER\fR
Specifies the layer to open on. The options are background, bottom, top, and overlay. Default is top
.SH CSS SELECTORS
Any GTK widget can be selected by using the name of its CSS node, these however might change with updates and are not guaranteed to stay constant. Wofi also provides certain widgets with names and classes which can be referenced from CSS to give access to the most important widgets easily. \fBwofi\fR(7) contains the current widget layout used by wofi so if you want to get into CSS directly using GTK widget names look there for info.

View File

@ -1618,6 +1618,7 @@ void wofi_init(struct map* _config) {
char* search = map_get(config, "search");
dynamic_lines = strcmp(config_get(config, "dynamic_lines", "false"), "true") == 0;
char* monitor = map_get(config, "monitor");
char* layer = config_get(config, "layer", "top");
keys = map_init_void();
@ -1728,7 +1729,19 @@ void wofi_init(struct map* _config) {
gdk_wayland_window_set_use_custom_surface(gdk_win);
wl_surface = gdk_wayland_window_get_wl_surface(gdk_win);
wlr_surface = zwlr_layer_shell_v1_get_layer_surface(shell, wl_surface, output, ZWLR_LAYER_SHELL_V1_LAYER_TOP, "wofi");
enum zwlr_layer_shell_v1_layer wlr_layer;
if(strcmp(layer, "background") == 0) {
wlr_layer = ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND;
} else if(strcmp(layer, "bottom") == 0) {
wlr_layer = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM;
} else if(strcmp(layer, "top") == 0) {
wlr_layer = ZWLR_LAYER_SHELL_V1_LAYER_TOP;
} else if(strcmp(layer, "overlay") == 0) {
wlr_layer = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY;
}
wlr_surface = zwlr_layer_shell_v1_get_layer_surface(shell, wl_surface, output, wlr_layer, "wofi");
struct zwlr_layer_surface_v1_listener* surface_listener = malloc(sizeof(struct zwlr_layer_surface_v1_listener));
surface_listener->configure = config_surface;
surface_listener->closed = nop;