diff --git a/src/bar.cpp b/src/bar.cpp index 05751b9..5aa0f1f 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -15,9 +15,12 @@ const zwlr_layer_surface_v1_listener Bar::_layerSurfaceListener = { Bar::Bar(const wl_output *output) { _surface = wl_compositor_create_surface(compositor); - _layerSurface = zwlr_layer_shell_v1_get_layer_surface(wlrLayerShell, _surface, nullptr, ZWLR_LAYER_SHELL_V1_LAYER_TOP, "net.tapesoftware.Somebar"); + _layerSurface = zwlr_layer_shell_v1_get_layer_surface(wlrLayerShell, + _surface, nullptr, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM, "net.tapesoftware.Somebar"); zwlr_layer_surface_v1_add_listener(_layerSurface, &_layerSurfaceListener, this); - zwlr_layer_surface_v1_set_anchor(_layerSurface, ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); + auto anchor = topbar ? ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP : ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; + zwlr_layer_surface_v1_set_anchor(_layerSurface, + anchor | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT); zwlr_layer_surface_v1_set_size(_layerSurface, 0, barSize); zwlr_layer_surface_v1_set_exclusive_zone(_layerSurface, barSize); wl_surface_commit(_surface); diff --git a/src/config.hpp b/src/config.hpp index 648a08a..4759a5c 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -2,3 +2,4 @@ // See LICENSE file for copyright and license details. constexpr int barSize = 20; +constexpr bool topbar = 1;