layer shell

This commit is contained in:
2026-05-19 12:17:13 +07:00
parent 393cc02b4f
commit d98771900c
8 changed files with 113 additions and 103 deletions
+44 -44
View File
@@ -4,11 +4,7 @@
#include "keybinds.h"
#include "types.h"
#define CURSOR_MOD WLR_MODIFIER_ALT
#define CURSOR_MOVE_BUTTON BTN_LEFT
#define CURSOR_RESIZE_BUTTON BTN_RIGHT
#define TOPLEVEL_BW 2
#define TOPLEVEL_BW 1
static const float bgcolor[4] = {0.0, 0.0, 0.0, 1.0};
@@ -19,8 +15,8 @@ static const float unfocused_bc[4] = {0.28, 0.28, 0.28, 1.0};
#define STACK_COUNT 1
#define STACK_SIZE 0.5
#define OUTPUT_GAP 10
#define LAYOUT_GAP 5
#define OUTPUT_GAP 0
#define LAYOUT_GAP 0
#define ALT WLR_MODIFIER_ALT
#define CTRL WLR_MODIFIER_CTRL
@@ -31,53 +27,57 @@ static const char *workspaces[] = {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
};
#define CURSOR_MOD ALT
#define CURSOR_MOVE_BUTTON BTN_LEFT
#define CURSOR_RESIZE_BUTTON BTN_RIGHT
static const absn_keybind keybinds[] = {
{LOGO, XKB_KEY_Escape, quit, {0}},
{ALT, XKB_KEY_Escape, quit, {0}},
{LOGO, XKB_KEY_Return, &run, {.v = "alacritty"}},
{LOGO, XKB_KEY_d, &run, {.v = "wofi --show drun"}},
{LOGO, XKB_KEY_q, kill_focus, {0}},
{ALT, XKB_KEY_Return, &run, {.v = "alacritty"}},
{ALT, XKB_KEY_d, &run, {.v = "wofi --show drun"}},
{ALT, XKB_KEY_q, kill_focus, {0}},
{LOGO, XKB_KEY_j, cycle_focus, {.i = +1}},
{LOGO, XKB_KEY_k, cycle_focus, {.i = -1}},
{ALT, XKB_KEY_j, cycle_focus, {.i = +1}},
{ALT, XKB_KEY_k, cycle_focus, {.i = -1}},
{LOGO | SHIFT, XKB_KEY_j, swap_focus, {.i = +1}},
{LOGO | SHIFT, XKB_KEY_k, swap_focus, {.i = -1}},
{ALT | SHIFT, XKB_KEY_j, swap_focus, {.i = +1}},
{ALT | SHIFT, XKB_KEY_k, swap_focus, {.i = -1}},
{LOGO, XKB_KEY_f, toggle_fullscreen, {0}},
{LOGO, XKB_KEY_v, toggle_floating, {0}},
{ALT, XKB_KEY_f, toggle_fullscreen, {0}},
{ALT, XKB_KEY_v, toggle_floating, {0}},
{LOGO, XKB_KEY_h, increase_master_count, {.i = +1}},
{LOGO, XKB_KEY_l, increase_master_count, {.i = -1}},
{ALT, XKB_KEY_h, increase_master_count, {.i = +1}},
{ALT, XKB_KEY_l, increase_master_count, {.i = -1}},
{LOGO | SHIFT, XKB_KEY_h, increase_master_width, {.f = -0.05}},
{LOGO | SHIFT, XKB_KEY_l, increase_master_width, {.f = +0.05}},
{ALT | SHIFT, XKB_KEY_h, increase_master_width, {.f = -0.05}},
{ALT | SHIFT, XKB_KEY_l, increase_master_width, {.f = +0.05}},
{LOGO, XKB_KEY_t, set_layout, {.i = LAYOUT_TILE}},
{LOGO, XKB_KEY_r, set_layout, {.i = LAYOUT_TILELEFT}},
{LOGO, XKB_KEY_m, set_layout, {.i = LAYOUT_MONOCLE}},
{ALT, XKB_KEY_t, set_layout, {.i = LAYOUT_TILE}},
{ALT, XKB_KEY_r, set_layout, {.i = LAYOUT_TILELEFT}},
{ALT, XKB_KEY_m, set_layout, {.i = LAYOUT_MONOCLE}},
{LOGO, XKB_KEY_1, switch_workspace, {.v = "1"}},
{LOGO, XKB_KEY_2, switch_workspace, {.v = "2"}},
{LOGO, XKB_KEY_3, switch_workspace, {.v = "3"}},
{LOGO, XKB_KEY_4, switch_workspace, {.v = "4"}},
{LOGO, XKB_KEY_5, switch_workspace, {.v = "5"}},
{LOGO, XKB_KEY_6, switch_workspace, {.v = "6"}},
{LOGO, XKB_KEY_7, switch_workspace, {.v = "7"}},
{LOGO, XKB_KEY_8, switch_workspace, {.v = "8"}},
{LOGO, XKB_KEY_9, switch_workspace, {.v = "9"}},
{LOGO, XKB_KEY_0, switch_workspace, {.v = "10"}},
{ALT, XKB_KEY_1, switch_workspace, {.v = "1"}},
{ALT, XKB_KEY_2, switch_workspace, {.v = "2"}},
{ALT, XKB_KEY_3, switch_workspace, {.v = "3"}},
{ALT, XKB_KEY_4, switch_workspace, {.v = "4"}},
{ALT, XKB_KEY_5, switch_workspace, {.v = "5"}},
{ALT, XKB_KEY_6, switch_workspace, {.v = "6"}},
{ALT, XKB_KEY_7, switch_workspace, {.v = "7"}},
{ALT, XKB_KEY_8, switch_workspace, {.v = "8"}},
{ALT, XKB_KEY_9, switch_workspace, {.v = "9"}},
{ALT, XKB_KEY_0, switch_workspace, {.v = "10"}},
{LOGO | SHIFT, XKB_KEY_exclam, move_focus_to_workspace, {.v = "1"}},
{LOGO | SHIFT, XKB_KEY_at, move_focus_to_workspace, {.v = "2"}},
{LOGO | SHIFT, XKB_KEY_numbersign, move_focus_to_workspace, {.v = "3"}},
{LOGO | SHIFT, XKB_KEY_dollar, move_focus_to_workspace, {.v = "4"}},
{LOGO | SHIFT, XKB_KEY_percent, move_focus_to_workspace, {.v = "5"}},
{LOGO | SHIFT, XKB_KEY_asciicircum, move_focus_to_workspace, {.v = "6"}},
{LOGO | SHIFT, XKB_KEY_ampersand, move_focus_to_workspace, {.v = "7"}},
{LOGO | SHIFT, XKB_KEY_asterisk, move_focus_to_workspace, {.v = "8"}},
{LOGO | SHIFT, XKB_KEY_parenleft, move_focus_to_workspace, {.v = "9"}},
{LOGO | SHIFT, XKB_KEY_parenright, move_focus_to_workspace, {.v = "10"}},
{ALT | SHIFT, XKB_KEY_exclam, move_focus_to_workspace, {.v = "1"}},
{ALT | SHIFT, XKB_KEY_at, move_focus_to_workspace, {.v = "2"}},
{ALT | SHIFT, XKB_KEY_numbersign, move_focus_to_workspace, {.v = "3"}},
{ALT | SHIFT, XKB_KEY_dollar, move_focus_to_workspace, {.v = "4"}},
{ALT | SHIFT, XKB_KEY_percent, move_focus_to_workspace, {.v = "5"}},
{ALT | SHIFT, XKB_KEY_asciicircum, move_focus_to_workspace, {.v = "6"}},
{ALT | SHIFT, XKB_KEY_ampersand, move_focus_to_workspace, {.v = "7"}},
{ALT | SHIFT, XKB_KEY_asterisk, move_focus_to_workspace, {.v = "8"}},
{ALT | SHIFT, XKB_KEY_parenleft, move_focus_to_workspace, {.v = "9"}},
{ALT | SHIFT, XKB_KEY_parenright, move_focus_to_workspace, {.v = "10"}},
};
#endif
+2
View File
@@ -1,4 +1,6 @@
#include "types.h"
void client_from_coords(absn_server *server, double x, double y, struct wlr_surface **rsurface, absn_toplevel **rtoplevel, absn_layer_surface **rlayer_surface, double *rx, double *ry);
void reset_cursor_mode(absn_server *server);
void process_cursor_motion(absn_server *server, uint32_t time);
-2
View File
@@ -3,8 +3,6 @@
#include "types.h"
absn_toplevel *toplevel_at(absn_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy);
bool toplevel_is_unmanaged(absn_toplevel *toplevel);
void toplevel_get_geom(absn_toplevel *toplevel);
+3 -1
View File
@@ -183,6 +183,7 @@ struct absn_output {
};
typedef struct {
int type;
struct wl_list link;
absn_server *server;
@@ -201,6 +202,8 @@ typedef struct {
} absn_layer_surface;
struct absn_toplevel {
int type;
struct wl_list link;
struct wl_list flink; /* link for focus stack */
uint32_t tag;
@@ -223,7 +226,6 @@ struct absn_toplevel {
struct wlr_box geom;
struct wlr_box prev_geom;
int type;
union {
struct wlr_xdg_toplevel *xdg;
struct wlr_xwayland_surface *xw;