mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-21 14:42:44 +00:00
Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9bedb7908 | |||
| a92504d8bf | |||
| 5493e0bbf2 | |||
| f342b7d412 | |||
| 4dfa45659a | |||
| b91017e713 | |||
| 2623a96ebf | |||
| 52e0d00942 | |||
| 7018b9b65c | |||
| 48ec914f43 | |||
| 40449fa64f | |||
| ecbc2c61db | |||
| cc9f4a3dc4 | |||
| 8841d17ec8 | |||
| 491fa291fa | |||
| 561acf650a | |||
| fe8280bf39 | |||
| fbd698479a | |||
| 8870ba0bb8 | |||
| 5de68ba713 | |||
| 2f8736b986 | |||
| ac1aef7ead | |||
| 27bf627a97 | |||
| c86f2f73fd | |||
| 3c11ad9aa6 | |||
| 06d9230a96 | |||
| 22bd75226b | |||
| 063736f898 | |||
| d5a741c9b4 | |||
| 5d8084daa7 | |||
| 07d56c6d7b | |||
| e0d310fd84 | |||
| 3a4b7d104f | |||
| d071a899f3 | |||
| a48ce99e6a | |||
| b86fcf6504 | |||
| c00697e643 | |||
| af741e586b | |||
| 02ac9378c4 | |||
| 437aea8662 | |||
| 6901743b0c | |||
| 720f56161e | |||
| 4d3adea683 | |||
| 79b7e755b0 | |||
| b424602ebc | |||
| ae31391115 | |||
| 2d6f932ecf | |||
| aab397c30b | |||
| cb4265ac8c | |||
| a95338ca43 | |||
| ae614ee512 | |||
| feb972acd0 | |||
| bf8cc526de | |||
| 7a2e0eef74 | |||
| 3bace9ce6b | |||
| 4ef8999624 | |||
| 7d724dc7f3 | |||
| 326eee1444 | |||
| d8f430accf | |||
| 6aed9dc1ac | |||
| 358562e2df | |||
| 9aec6049ec | |||
| 330792b1fc | |||
| 86fe15f76c | |||
| ee1a72211d | |||
| 2bc01debdc | |||
| c50f187c1f | |||
| 0dea553428 | |||
| 0c4740b277 | |||
| 8aa50dfdf1 |
@@ -7,4 +7,16 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Info
|
||||||
|
dwl's commit:
|
||||||
|
wlroots version:
|
||||||
|
## Description
|
||||||
|
<!--
|
||||||
|
Only report bugs that can be reproduced on the main line
|
||||||
|
Report patch issues to their respective authors
|
||||||
|
If the patch author doesn't respond within a reasonable time, email me:
|
||||||
|
|
||||||
|
Leonardo Hernández Hernández <leohdz172@protonmail.com>
|
||||||
|
|
||||||
|
but note that I'm NOT making any promises
|
||||||
|
-->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ dwl - dwm for Wayland
|
|||||||
|
|
||||||
Copyright © 2020 dwl team
|
Copyright © 2020 dwl team
|
||||||
|
|
||||||
See also the files LICENSE.tinywl and LICENSE.dwm.
|
See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2016-2017 Drew DeVault
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99
|
CFLAGS += -I. -DWLR_USE_UNSTABLE -std=c99 -pedantic -DVERSION=\"$(VERSION)\"
|
||||||
|
|
||||||
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
||||||
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
|
WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner)
|
||||||
@@ -14,13 +14,23 @@ all: dwl
|
|||||||
clean:
|
clean:
|
||||||
rm -f dwl *.o *-protocol.h *-protocol.c
|
rm -f dwl *.o *-protocol.h *-protocol.c
|
||||||
|
|
||||||
|
dist: clean
|
||||||
|
mkdir -p dwl-$(VERSION)
|
||||||
|
cp -R LICENSE* Makefile README.md generate-version.sh client.h\
|
||||||
|
config.def.h config.mk protocols dwl.1 dwl.c util.c util.h\
|
||||||
|
dwl-$(VERSION)
|
||||||
|
echo "echo $(VERSION)" > dwl-$(VERSION)/generate-version.sh
|
||||||
|
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
||||||
|
rm -rf dwl-$(VERSION)
|
||||||
|
|
||||||
install: dwl
|
install: dwl
|
||||||
install -D dwl $(PREFIX)/bin/dwl
|
install -Dm755 dwl $(DESTDIR)$(PREFIX)/bin/dwl
|
||||||
|
install -Dm644 dwl.1 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(PREFIX)/bin/dwl
|
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||||
|
|
||||||
.PHONY: all clean install uninstall
|
.PHONY: all clean dist install uninstall
|
||||||
|
|
||||||
# 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
|
||||||
# protocols, which are specified in XML. wlroots requires you to rig these up
|
# protocols, which are specified in XML. wlroots requires you to rig these up
|
||||||
@@ -58,6 +68,6 @@ idle-protocol.o: idle-protocol.h
|
|||||||
config.h: | config.def.h
|
config.h: | config.def.h
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
|
|
||||||
dwl.o: config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h
|
dwl.o: config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h idle-protocol.h util.h
|
||||||
|
|
||||||
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o
|
dwl: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o idle-protocol.o util.o
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ dwl is not meant to provide every feature under the sun. Instead, like dwm, it s
|
|||||||
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well.
|
- Any features provided by dwm/Xlib: simple window borders, tags, keybindings, client rules, mouse move/resize. Providing a built-in status bar is an exception to this goal, to avoid dependencies on font rendering and/or drawing libraries when an external bar could work well.
|
||||||
- Configurable multi-monitor layout support, including position and rotation
|
- Configurable multi-monitor layout support, including position and rotation
|
||||||
- Configurable HiDPI/multi-DPI support
|
- Configurable HiDPI/multi-DPI support
|
||||||
|
- Idle-inhibit protocol which lets applications such as mpv disable idle monitoring
|
||||||
- Provide information to external status bars via stdout/stdin
|
- Provide information to external status bars via stdout/stdin
|
||||||
- Urgency hints via xdg-activate protocol
|
- Urgency hints via xdg-activate protocol
|
||||||
|
- Support screen lockers via input-inhibitor protocol
|
||||||
- Various Wayland protocols
|
- Various Wayland protocols
|
||||||
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
- XWayland support as provided by wlroots (can be enabled in `config.mk`)
|
||||||
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
- Zero flickering - Wayland users naturally expect that "every frame is perfect"
|
||||||
@@ -25,8 +27,6 @@ dwl is not meant to provide every feature under the sun. Instead, like dwm, it s
|
|||||||
Features under consideration (possibly as patches) are:
|
Features under consideration (possibly as patches) are:
|
||||||
|
|
||||||
- Protocols made trivial by wlroots
|
- Protocols made trivial by wlroots
|
||||||
- Implement the input-inhibitor protocol to support screen lockers (see https://github.com/djpohly/dwl/pull/132)
|
|
||||||
- Implement the idle-inhibit protocol which lets applications such as mpv disable idle monitoring (see https://github.com/djpohly/dwl/pull/133)
|
|
||||||
- Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12)
|
- Implement the text-input and input-method protocols to support IME once ibus implements input-method v2 (see https://github.com/ibus/ibus/pull/2256 and https://github.com/djpohly/dwl/pull/12)
|
||||||
|
|
||||||
Feature *non-goals* for the main codebase include:
|
Feature *non-goals* for the main codebase include:
|
||||||
@@ -77,7 +77,7 @@ You can find a [list of Wayland applications on the sway wiki](https://github.co
|
|||||||
|
|
||||||
## IRC channel
|
## IRC channel
|
||||||
|
|
||||||
dwl's IRC channel is #dwl on irc.freenode.net.
|
dwl's IRC channel is #dwl on irc.libera.chat.
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
|
|||||||
@@ -30,16 +30,19 @@ client_surface(Client *c)
|
|||||||
static inline void
|
static inline void
|
||||||
client_activate_surface(struct wlr_surface *s, int activated)
|
client_activate_surface(struct wlr_surface *s, int activated)
|
||||||
{
|
{
|
||||||
|
struct wlr_xdg_surface *surface;
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (wlr_surface_is_xwayland_surface(s)) {
|
struct wlr_xwayland_surface *xsurface;
|
||||||
wlr_xwayland_surface_activate(
|
if (wlr_surface_is_xwayland_surface(s)
|
||||||
wlr_xwayland_surface_from_wlr_surface(s), activated);
|
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) {
|
||||||
|
wlr_xwayland_surface_activate(xsurface, activated);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (wlr_surface_is_xdg_surface(s))
|
if (wlr_surface_is_xdg_surface(s)
|
||||||
wlr_xdg_toplevel_set_activated(
|
&& (surface = wlr_xdg_surface_from_wlr_surface(s))
|
||||||
wlr_xdg_surface_from_wlr_surface(s), activated);
|
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
|
||||||
|
wlr_xdg_toplevel_set_activated(surface, activated);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -91,16 +94,39 @@ client_get_title(Client *c)
|
|||||||
static inline int
|
static inline int
|
||||||
client_is_float_type(Client *c)
|
client_is_float_type(Client *c)
|
||||||
{
|
{
|
||||||
|
struct wlr_xdg_toplevel *toplevel;
|
||||||
|
struct wlr_xdg_toplevel_state state;
|
||||||
|
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
if (client_is_x11(c))
|
if (client_is_x11(c)) {
|
||||||
for (size_t i = 0; i < c->surface.xwayland->window_type_len; i++)
|
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||||
if (c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeDialog] ||
|
struct wlr_xwayland_surface_size_hints *size_hints;
|
||||||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeSplash] ||
|
if (surface->modal)
|
||||||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
|
|
||||||
c->surface.xwayland->window_type[i] == netatom[NetWMWindowTypeUtility])
|
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
|
||||||
|
for (size_t i = 0; i < surface->window_type_len; i++)
|
||||||
|
if (surface->window_type[i] == netatom[NetWMWindowTypeDialog] ||
|
||||||
|
surface->window_type[i] == netatom[NetWMWindowTypeSplash] ||
|
||||||
|
surface->window_type[i] == netatom[NetWMWindowTypeToolbar] ||
|
||||||
|
surface->window_type[i] == netatom[NetWMWindowTypeUtility])
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
size_hints = surface->size_hints;
|
||||||
|
if (size_hints && size_hints->min_width > 0 && size_hints->min_height > 0
|
||||||
|
&& (size_hints->max_width == size_hints->min_width ||
|
||||||
|
size_hints->max_height == size_hints->min_height))
|
||||||
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
toplevel = c->surface.xdg->toplevel;
|
||||||
|
state = toplevel->current;
|
||||||
|
return (state.min_width != 0 && state.min_height != 0
|
||||||
|
&& (state.min_width == state.max_width
|
||||||
|
|| state.min_height == state.max_height))
|
||||||
|
|| toplevel->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@@ -189,8 +215,13 @@ client_min_size(Client *c, int *width, int *height)
|
|||||||
if (client_is_x11(c)) {
|
if (client_is_x11(c)) {
|
||||||
struct wlr_xwayland_surface_size_hints *size_hints;
|
struct wlr_xwayland_surface_size_hints *size_hints;
|
||||||
size_hints = c->surface.xwayland->size_hints;
|
size_hints = c->surface.xwayland->size_hints;
|
||||||
|
if (size_hints) {
|
||||||
*width = size_hints->min_width;
|
*width = size_hints->min_width;
|
||||||
*height = size_hints->min_height;
|
*height = size_hints->min_height;
|
||||||
|
} else {
|
||||||
|
*width = 0;
|
||||||
|
*height = 0;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -200,6 +231,13 @@ client_min_size(Client *c, int *width, int *height)
|
|||||||
*height = state->min_height;
|
*height = state->min_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline Client *
|
||||||
|
client_from_wlr_surface(struct wlr_surface *surface)
|
||||||
|
{
|
||||||
|
struct wlr_scene_node *n = surface->data;
|
||||||
|
return n ? n->data : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline Client *
|
static inline Client *
|
||||||
client_from_popup(struct wlr_xdg_popup *popup)
|
client_from_popup(struct wlr_xdg_popup *popup)
|
||||||
{
|
{
|
||||||
|
|||||||
+32
-7
@@ -1,6 +1,7 @@
|
|||||||
/* appearance */
|
/* appearance */
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||||
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
|
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
|
||||||
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
|
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
|
||||||
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
|
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
|
||||||
@@ -12,8 +13,8 @@ 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 },
|
||||||
{ "firefox", NULL, 1 << 8, 0, -1 },
|
|
||||||
*/
|
*/
|
||||||
|
{ "firefox", NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -24,16 +25,14 @@ static const Layout layouts[] = {
|
|||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* monitors
|
/* monitors */
|
||||||
* The order in which monitors are defined determines their position.
|
|
||||||
* 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 */
|
||||||
/* example of a HiDPI laptop monitor:
|
/* example of a HiDPI laptop monitor:
|
||||||
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
|
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||||
*/
|
*/
|
||||||
/* defaults */
|
/* defaults */
|
||||||
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0 },
|
{ NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
@@ -42,6 +41,7 @@ static const struct xkb_rule_names xkb_rules = {
|
|||||||
/* example:
|
/* example:
|
||||||
.options = "ctrl:nocaps",
|
.options = "ctrl:nocaps",
|
||||||
*/
|
*/
|
||||||
|
.options = "",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int repeat_rate = 25;
|
static const int repeat_rate = 25;
|
||||||
@@ -49,8 +49,33 @@ static const int repeat_delay = 600;
|
|||||||
|
|
||||||
/* Trackpad */
|
/* Trackpad */
|
||||||
static const int tap_to_click = 1;
|
static const int tap_to_click = 1;
|
||||||
|
static const int tap_and_drag = 1;
|
||||||
|
static const int drag_lock = 1;
|
||||||
static const int natural_scrolling = 0;
|
static const int natural_scrolling = 0;
|
||||||
|
static const int disable_while_typing = 1;
|
||||||
|
static const int left_handed = 0;
|
||||||
|
static const int middle_button_emulation = 0;
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_SCROLL_NO_SCROLL
|
||||||
|
LIBINPUT_CONFIG_SCROLL_2FG
|
||||||
|
LIBINPUT_CONFIG_SCROLL_EDGE
|
||||||
|
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN
|
||||||
|
*/
|
||||||
|
static const enum libinput_config_scroll_method scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED
|
||||||
|
LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE
|
||||||
|
*/
|
||||||
|
static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
|
||||||
|
/* You can choose between:
|
||||||
|
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
|
||||||
|
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
|
||||||
|
*/
|
||||||
|
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
|
||||||
|
static const double accel_speed = 0.0;
|
||||||
|
|
||||||
|
/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */
|
||||||
#define MODKEY WLR_MODIFIER_ALT
|
#define MODKEY WLR_MODIFIER_ALT
|
||||||
#define TAGKEYS(KEY,SKEY,TAG) \
|
#define TAGKEYS(KEY,SKEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
_VERSION = 0.3.1
|
||||||
|
VERSION = $(shell ./generate-version.sh $(_VERSION))
|
||||||
|
|
||||||
# paths
|
# paths
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
MANDIR = $(PREFIX)/share/man
|
||||||
|
|
||||||
# Default compile flags (overridable by environment)
|
# Default compile flags (overridable by environment)
|
||||||
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
|
CFLAGS ?= -g -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
.Dd January 8, 2021
|
||||||
|
.Dt DWL 1
|
||||||
|
.Os
|
||||||
|
.Sh NAME
|
||||||
|
.Nm dwl
|
||||||
|
.Nd dwm for Wayland
|
||||||
|
.Sh SYNOPSIS
|
||||||
|
.Nm
|
||||||
|
.Op Fl v
|
||||||
|
.Op Fl s Ar startup command
|
||||||
|
.Sh DESCRIPTION
|
||||||
|
.Nm
|
||||||
|
is a Wayland compositor based on wlroots.
|
||||||
|
It is intended to fill the same space in the Wayland world that
|
||||||
|
.Nm dwm
|
||||||
|
does for X11.
|
||||||
|
.Pp
|
||||||
|
When given the
|
||||||
|
.Fl v
|
||||||
|
option,
|
||||||
|
.Nm
|
||||||
|
writes its name and version to standard error and exits unsuccessfully.
|
||||||
|
.Pp
|
||||||
|
When given the
|
||||||
|
.Fl s
|
||||||
|
option,
|
||||||
|
.Nm
|
||||||
|
starts a shell process running
|
||||||
|
.Ar command
|
||||||
|
when starting.
|
||||||
|
When stopping, it sends
|
||||||
|
.Dv SIGTERM
|
||||||
|
to the child process and waits for it to exit.
|
||||||
|
.Pp
|
||||||
|
Users are encouraged to customize
|
||||||
|
.Nm
|
||||||
|
by editing the sources, in particular
|
||||||
|
.Pa config.h .
|
||||||
|
The default key bindings are as follows:
|
||||||
|
.Bl -tag -width 20n -offset indent -compact
|
||||||
|
.It Mod-[1-9]
|
||||||
|
Show only all windows with a tag.
|
||||||
|
.It Mod-Ctrl-[1-9]
|
||||||
|
Show all windows with a tag.
|
||||||
|
.It Mod-Shift-[1-9]
|
||||||
|
Move window to a single tag.
|
||||||
|
.It Mod-Ctrl-Shift-[1-9]
|
||||||
|
Toggle tag for window.
|
||||||
|
.It Mod-p
|
||||||
|
Spawn
|
||||||
|
.Nm bemenu-run .
|
||||||
|
.It Mod-Shift-Return
|
||||||
|
Spawn
|
||||||
|
.Nm alacritty .
|
||||||
|
.It Mod-[jk]
|
||||||
|
Move focus down/up the stack.
|
||||||
|
.It Mod-[id]
|
||||||
|
Increase/decrease number of windows in master area.
|
||||||
|
.It Mod-[hl]
|
||||||
|
Decrease/increase master area.
|
||||||
|
.It Mod-Return
|
||||||
|
Move window on top of stack or switch top of stack with second window.
|
||||||
|
.It Mod-Tab
|
||||||
|
Show only all windows with previous tag.
|
||||||
|
.It Mod-Shift-c
|
||||||
|
Close window.
|
||||||
|
.It Mod-t
|
||||||
|
Switch to tabbed layout.
|
||||||
|
.It Mod-f
|
||||||
|
Switch to floating layout.
|
||||||
|
.It Mod-m
|
||||||
|
Switch to monocle layout.
|
||||||
|
.It Mod-Space
|
||||||
|
Switch to previous layout.
|
||||||
|
.It Mod-Shift-Space
|
||||||
|
Toggle floating state of window.
|
||||||
|
.It Mod-e
|
||||||
|
Toggle fullscreen state of window.
|
||||||
|
.It Mod-0
|
||||||
|
Show all windows.
|
||||||
|
.It Mod-Shift-0
|
||||||
|
Set all tags for window.
|
||||||
|
.It Mod-,
|
||||||
|
Move focus to previous monitor.
|
||||||
|
.It Mod-.
|
||||||
|
Move focus to next monitor.
|
||||||
|
.It Mod-Shift-,
|
||||||
|
Move window to previous monitor.
|
||||||
|
.It Mod-Shift-.
|
||||||
|
Move window to next monitor.
|
||||||
|
.It Mod-Shift-q
|
||||||
|
Quit
|
||||||
|
.Nm .
|
||||||
|
.El
|
||||||
|
These might differ depending on your keyboard layout.
|
||||||
|
.Sh ENVIRONMENT
|
||||||
|
These environment variables are used by
|
||||||
|
.Nm :
|
||||||
|
.Bl -tag -width XDG_RUNTIME_DIR
|
||||||
|
.It Ev XDG_RUNTIME_DIR
|
||||||
|
A directory where temporary user files, such as the Wayland socket,
|
||||||
|
are stored.
|
||||||
|
.It Ev XDG_CONFIG_DIR
|
||||||
|
A directory containung configuration of various programs and
|
||||||
|
libraries, including libxkbcommon.
|
||||||
|
.It Ev DISPLAY , WAYLAND_DISPLAY , WAYLAND_SOCKET
|
||||||
|
Tell how to connect to an underlying X11 or Wayland server.
|
||||||
|
.It Ev WLR_*
|
||||||
|
Various variables specific to wlroots.
|
||||||
|
.It Ev XKB_* , XLOCALEDIR , XCOMPOSEFILE
|
||||||
|
Various variables specific to libxkbcommon.
|
||||||
|
.It Ev XCURSOR_PATH
|
||||||
|
List of directories to search for XCursor themes in.
|
||||||
|
.It Ev HOME
|
||||||
|
A directory where there are always dear files there for you.
|
||||||
|
Waiting for you to clean them up.
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
These are set by
|
||||||
|
.Nm :
|
||||||
|
.Bl -tag -width WAYLAND_DISPLAY
|
||||||
|
.It Ev WAYLAND_DISPLAY
|
||||||
|
Tell how to connect to
|
||||||
|
.Nm .
|
||||||
|
.It Ev DISPLAY
|
||||||
|
If using
|
||||||
|
.Nm Xwayland ,
|
||||||
|
tell how to connect to the
|
||||||
|
.Nm Xwayland
|
||||||
|
server.
|
||||||
|
.El
|
||||||
|
.Sh EXAMPLES
|
||||||
|
Start
|
||||||
|
.Nm
|
||||||
|
with s6 in the background:
|
||||||
|
.Dl dwl -s 's6-svscan <&-'
|
||||||
|
.Sh SEE ALSO
|
||||||
|
.Xr alacritty 1 ,
|
||||||
|
.Xr bemenu 1 ,
|
||||||
|
.Xr dwm 1 ,
|
||||||
|
.Xr xkeyboard-config 7
|
||||||
|
.Sh CAVEATS
|
||||||
|
The child process's standard input is connected with a pipe to
|
||||||
|
.Nm .
|
||||||
|
If the child process neither reads from the pipe nor closes its
|
||||||
|
standard input,
|
||||||
|
.Nm
|
||||||
|
will freeze after a while due to it blocking when writing to the full
|
||||||
|
pipe buffer.
|
||||||
|
.Sh BUGS
|
||||||
|
All of them.
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if git tag --contains HEAD | grep -q $1; then
|
||||||
|
echo $1
|
||||||
|
else
|
||||||
|
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
commit="$(git rev-parse --short HEAD)"
|
||||||
|
if [ "${branch}" != "main" ]; then
|
||||||
|
echo $1-$branch-$commit
|
||||||
|
else
|
||||||
|
echo $1-$commit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/* See LICENSE.dwm file for copyright and license details. */
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
void *
|
||||||
|
ecalloc(size_t nmemb, size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
if (!(p = calloc(nmemb, size)))
|
||||||
|
die("calloc:");
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
die(const char *fmt, ...) {
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||||
|
fputc(' ', stderr);
|
||||||
|
perror(NULL);
|
||||||
|
} else {
|
||||||
|
fputc('\n', stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user