mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-01-14 04:47:30 -08:00
updates
This commit is contained in:
parent
8eee19f93c
commit
cb86dd01f1
4 changed files with 413 additions and 544 deletions
27
Makefile
27
Makefile
|
@ -5,21 +5,22 @@ include config.mk
|
||||||
|
|
||||||
# flags for compiling
|
# flags for compiling
|
||||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
||||||
DWLDEVCFLAGS = -g3 -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\
|
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\
|
||||||
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
|
-Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types
|
||||||
|
|
||||||
# CFLAGS / LDFLAGS
|
# CFLAGS / LDFLAGS
|
||||||
CC = gcc -flto=auto
|
CC = gcc -flto=auto
|
||||||
CFLAGS = -O2 -march=native
|
CFLAGS = -O2 -march=native
|
||||||
PKGS = wlroots wayland-server xkbcommon libinput pixman-1 $(XLIBS)
|
PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
|
||||||
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
||||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
||||||
|
|
||||||
all: dwl
|
all: dwl
|
||||||
dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
|
dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
|
||||||
$(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
$(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
||||||
dwl.o: dwl.c config.mk config.def.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h wlr-output-power-management-unstable-v1-protocol.h dwl-ipc-unstable-v2-protocol.h pointer-constraints-unstable-v1-protocol.h
|
dwl.o: dwl.c config.mk config.def.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h dwl-ipc-unstable-v2-protocol.h wlr-output-power-management-unstable-v1-protocol.h pointer-constraints-unstable-v1-protocol.h
|
||||||
util.o: util.c util.h
|
util.o: util.c util.h
|
||||||
|
|
||||||
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||||
|
@ -28,27 +29,27 @@ dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.h
|
||||||
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner`
|
||||||
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols`
|
||||||
|
|
||||||
xdg-shell-protocol.h:
|
|
||||||
$(WAYLAND_SCANNER) server-header \
|
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
|
||||||
wlr-layer-shell-unstable-v1-protocol.h:
|
|
||||||
$(WAYLAND_SCANNER) server-header \
|
|
||||||
protocols/wlr-layer-shell-unstable-v1.xml $@
|
|
||||||
cursor-shape-v1-protocol.h:
|
cursor-shape-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/staging/cursor-shape/cursor-shape-v1.xml $@
|
||||||
wlr-output-power-management-unstable-v1-protocol.h:
|
|
||||||
$(WAYLAND_SCANNER) server-header \
|
|
||||||
protocols/wlr-output-power-management-unstable-v1.xml $@
|
|
||||||
dwl-ipc-unstable-v2-protocol.h:
|
dwl-ipc-unstable-v2-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
protocols/dwl-ipc-unstable-v2.xml $@
|
protocols/dwl-ipc-unstable-v2.xml $@
|
||||||
dwl-ipc-unstable-v2-protocol.c:
|
dwl-ipc-unstable-v2-protocol.c:
|
||||||
$(WAYLAND_SCANNER) private-code \
|
$(WAYLAND_SCANNER) private-code \
|
||||||
protocols/dwl-ipc-unstable-v2.xml $@
|
protocols/dwl-ipc-unstable-v2.xml $@
|
||||||
|
wlr-output-power-management-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
protocols/wlr-output-power-management-unstable-v1.xml $@
|
||||||
pointer-constraints-unstable-v1-protocol.h:
|
pointer-constraints-unstable-v1-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
$(WAYLAND_PROTOCOLS)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $@
|
||||||
|
xdg-shell-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||||
|
wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
|
$(WAYLAND_SCANNER) server-header \
|
||||||
|
protocols/wlr-layer-shell-unstable-v1.xml $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f dwl *.o *-protocol.h
|
rm -f dwl *.o *-protocol.h
|
||||||
|
|
7
client.h
7
client.h
|
@ -10,7 +10,7 @@ static inline int
|
||||||
client_is_x11(Client *c)
|
client_is_x11(Client *c)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
return c->type == X11Managed || c->type == X11Unmanaged;
|
return c->type == X11;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,8 @@ static inline int
|
||||||
client_is_unmanaged(Client *c)
|
client_is_unmanaged(Client *c)
|
||||||
{
|
{
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
return c->type == X11Unmanaged;
|
if (client_is_x11(c))
|
||||||
|
return c->surface.xwayland->override_redirect;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +352,7 @@ client_set_tiled(Client *c, uint32_t edges)
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
if (wl_resource_get_version(c->surface.xdg->resource)
|
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
|
||||||
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
||||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
||||||
} else {
|
} else {
|
||||||
|
|
57
config.def.h
57
config.def.h
|
@ -5,29 +5,19 @@
|
||||||
(hex & 0xFF) / 255.0f }
|
(hex & 0xFF) / 255.0f }
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const int bypass_surface_visibility = 1; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||||
static const int numlock = 1;
|
|
||||||
static const int capslock = 0;
|
|
||||||
static const int smartborders = 1;
|
static const int smartborders = 1;
|
||||||
static const unsigned int borderpx = 3; /* border pixel of windows */
|
static const unsigned int borderpx = 3; /* border pixel of windows */
|
||||||
|
static const float rootcolor[] = COLOR(0x222222ff);
|
||||||
static const float bordercolor[] = COLOR(0x00000000);
|
static const float bordercolor[] = COLOR(0x00000000);
|
||||||
static const float focuscolor[] = COLOR(0x7aa6daff);
|
static const float focuscolor[] = COLOR(0x7aa6daff);
|
||||||
static const float urgentcolor[] = COLOR(0xd54e53ff);
|
static const float urgentcolor[] = COLOR(0xd54e53ff);
|
||||||
static const float stickycolor[] = COLOR(0x8abeb7ff);
|
static const float stickycolor[] = COLOR(0x8abeb7ff);
|
||||||
static const float mixedcolor[] = COLOR(0xb5bd68ff);
|
static const float mixedcolor[] = COLOR(0xb5bd68ff);
|
||||||
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0};
|
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
||||||
static const int center_relative_to_monitor = 1; /* 0 means center floating relative to the window area */
|
static const int center_relative_to_monitor = 1; /* 0 means center floating relative to the window area */
|
||||||
|
|
||||||
static const char *const autostart[] = {
|
|
||||||
"/home/korei/.config/dwl/dwlinit.sh", NULL,
|
|
||||||
NULL /* terminate */
|
|
||||||
};
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
|
||||||
#define TAGCOUNT (10)
|
|
||||||
|
|
||||||
static int log_level = WLR_ERROR;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VIEW_L = -1,
|
VIEW_L = -1,
|
||||||
VIEW_R = 1,
|
VIEW_R = 1,
|
||||||
|
@ -35,24 +25,32 @@ typedef enum {
|
||||||
SHIFT_R = 2,
|
SHIFT_R = 2,
|
||||||
} RotateTags;
|
} RotateTags;
|
||||||
|
|
||||||
/* keyboard layout change notification for status bar */
|
/* Autostart */
|
||||||
static const char kblayout_file[] = "/tmp/dwl-keymap";
|
static const char *const autostart[] = {
|
||||||
static const char *kblayout_cmd[] = {"pkill", "-RTMIN+1", "someblocks", NULL};
|
"/home/korei/.config/dwl/dwlinit.sh", NULL,
|
||||||
static const int kblayout_perclient = 0;
|
NULL /* terminate */
|
||||||
|
};
|
||||||
|
|
||||||
/* keyboard layout change notification for status bar */
|
/* keyboard layout change notification for status bar */
|
||||||
/* example using someblocks:
|
|
||||||
static const char kblayout_file[] = "/tmp/dwl-keymap";
|
static const char kblayout_file[] = "/tmp/dwl-keymap";
|
||||||
static const char *kblayout_cmd[] = {"pkill", "-RTMIN+1", "someblocks", NULL};
|
static const char *kblayout_cmd[] = {"pkill", "-RTMIN+1", "someblocks", NULL};
|
||||||
*/
|
|
||||||
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
|
#define TAGCOUNT (10)
|
||||||
|
|
||||||
|
/* logging */
|
||||||
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
/* examples:
|
/* examples:
|
||||||
{ "Gimp", NULL, 0, 1, -1 },
|
{ "Gimp", NULL, 0, 1, -1 },
|
||||||
*/
|
*/
|
||||||
{ "corectrl", NULL, 1 << 5, 0, -1 },
|
{"corectrl", NULL, 1 << 5, 0, -1},
|
||||||
{ NULL, "Save File", 0, 1, -1 },
|
{ NULL, "Save File", 0, 1, -1},
|
||||||
|
{ NULL, "Confirm to replace files", 0, 1, -1},
|
||||||
|
{ NULL, "File Operation Progress", 0, 1, -1},
|
||||||
|
{ NULL, "Seer Console", 0, 1, -1},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
|
@ -64,9 +62,8 @@ static const Layout layouts[] = {
|
||||||
{ "><>", NULL } /* no layout function means floating behavior */
|
{ "><>", NULL } /* no layout function means floating behavior */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* monitors
|
/* monitors */
|
||||||
* The order in which monitors are defined determines their position.
|
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
|
||||||
* Non-configured monitors are always added to the left. */
|
|
||||||
static const MonitorRule monrules[] = {
|
static const MonitorRule monrules[] = {
|
||||||
/* name mfact nmaster scale layout rotate/reflect x y */
|
/* name mfact nmaster scale layout rotate/reflect x y */
|
||||||
/* example of a HiDPI laptop monitor:
|
/* example of a HiDPI laptop monitor:
|
||||||
|
@ -76,7 +73,6 @@ static const MonitorRule monrules[] = {
|
||||||
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
static const struct xkb_rule_names xkb_rules = {
|
static const struct xkb_rule_names xkb_rules = {
|
||||||
/* can specify fields: rules, model, layout, variant, options */
|
/* can specify fields: rules, model, layout, variant, options */
|
||||||
|
@ -127,11 +123,8 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
|
||||||
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
|
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
|
||||||
static const double accel_speed = -0.5;
|
static const double accel_speed = -0.5;
|
||||||
|
|
||||||
static const int cursor_timeout = 2;
|
|
||||||
/* separate variables for trackpad */
|
|
||||||
static const enum libinput_config_accel_profile accel_profile_trackpad = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
static const enum libinput_config_accel_profile accel_profile_trackpad = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
||||||
static const double accel_speed_trackpad = -0.0;
|
static const double accel_speed_trackpad = -0.0;
|
||||||
|
|
||||||
/* You can choose between:
|
/* You can choose between:
|
||||||
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
|
LIBINPUT_CONFIG_TAP_MAP_LRM -- 1/2/3 finger tap maps to left/right/middle
|
||||||
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
|
||||||
|
@ -155,7 +148,7 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
static const char* Term[] = { "footclient", NULL };
|
static const char* Term[] = { "footclient", NULL };
|
||||||
static const char* TermAlt[] = { "foot", NULL };
|
static const char* TermAlt[] = { "foot", "--maximized", NULL };
|
||||||
static const char* Menu[] = { "fuzzel", NULL };
|
static const char* Menu[] = { "fuzzel", NULL };
|
||||||
static const char* PowerMenu[] = { "powermenu.sh", NULL };
|
static const char* PowerMenu[] = { "powermenu.sh", NULL };
|
||||||
static const char* AudioUpdate[] = { "pkill", "-RTMIN+12", "someblocks", NULL };
|
static const char* AudioUpdate[] = { "pkill", "-RTMIN+12", "someblocks", NULL };
|
||||||
|
@ -260,7 +253,7 @@ static const Key keys[] = {
|
||||||
TAGKEYS(Key_8, 7),
|
TAGKEYS(Key_8, 7),
|
||||||
TAGKEYS(Key_9, 8),
|
TAGKEYS(Key_9, 8),
|
||||||
TAGKEYS(Key_0, 9),
|
TAGKEYS(Key_0, 9),
|
||||||
{ SUPER | ALT, Key_q, quit, { 0 } },
|
{ SUPER | CTRL, Key_q, quit, { 0 } },
|
||||||
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
||||||
{ WLR_MODIFIER_CTRL | WLR_MODIFIER_ALT, XKB_KEY_Terminate_Server, quit, { 0 } },
|
{ WLR_MODIFIER_CTRL | WLR_MODIFIER_ALT, XKB_KEY_Terminate_Server, quit, { 0 } },
|
||||||
#define CHVT(KEY, n) \
|
#define CHVT(KEY, n) \
|
||||||
|
|
Loading…
Reference in a new issue