mirror of
https://github.com/mangowm/mango.git
synced 2026-05-02 14:27:27 -07:00
init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Something in dwl isn't working correctly
|
||||
title: ''
|
||||
labels: 'A: bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Info
|
||||
dwl version:
|
||||
wlroots version:
|
||||
## Description
|
||||
<!--
|
||||
Only report bugs that can be reproduced on the main line
|
||||
Report patch issues to their respective authors
|
||||
-->
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Enhancement idea
|
||||
about: Suggest a feature or improvement
|
||||
title: ''
|
||||
labels: 'A: enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/.cache
|
||||
/.vscode
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
Portions of dwl based on dwm code are used under the following license:
|
||||
|
||||
MIT/X Consortium License
|
||||
|
||||
© 2006-2019 Anselm R Garbe <anselm@garbe.ca>
|
||||
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
|
||||
© 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
|
||||
© 2007-2009 Szabolcs Nagy <nszabolcs at gmail dot com>
|
||||
© 2007-2009 Christof Musik <christof at sendfax dot de>
|
||||
© 2007-2009 Premysl Hruby <dfenze at gmail dot com>
|
||||
© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
|
||||
© 2008 Martin Hurton <martin dot hurton at gmail dot com>
|
||||
© 2008 Neale Pickett <neale dot woozle dot org>
|
||||
© 2009 Mate Nagy <mnagy at port70 dot net>
|
||||
© 2010-2016 Hiltjo Posthuma <hiltjo@codemadness.org>
|
||||
© 2010-2012 Connor Lane Smith <cls@lubutu.com>
|
||||
© 2011 Christoph Lohmann <20h@r-36.net>
|
||||
© 2015-2016 Quentin Rameau <quinq@fifth.space>
|
||||
© 2015-2016 Eric Pruitt <eric.pruitt@gmail.com>
|
||||
© 2016-2017 Markus Teich <markus.teich@stusta.mhn.de>
|
||||
|
||||
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.
|
||||
@@ -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.
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
dwl is originally based on TinyWL, which is used under the following license:
|
||||
|
||||
This work is licensed under CC0, which effectively puts it in the public domain.
|
||||
|
||||
---
|
||||
|
||||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
@@ -1,2 +1,63 @@
|
||||
# plumewm
|
||||
A streamlined but feature-rich wayland window tiling manager
|
||||
|
||||
https://github.com/user-attachments/assets/84eb21fd-1782-4edc-b504-50de35201abe
|
||||
|
||||
|
||||
|
||||
# feature
|
||||
- dwl ipc support
|
||||
- maxmize fullscreen
|
||||
- swap window by direction
|
||||
- swith to next not empty-workspace/workspace
|
||||
- move window to next not empty-workspace/workspace
|
||||
- swith focus by direction
|
||||
- wheel/button + mod key bind
|
||||
- hycov like overview
|
||||
- numlock state pre-set in config
|
||||
- portal fix for obs(use hyprland-portal)
|
||||
- master layout support new_on_top
|
||||
- foreign-toplevel support(dunst,waybar wlr taskbar)
|
||||
- acitve on focus/urgent support
|
||||
- hide empty button in waybar
|
||||
- support minimize window by click waybar
|
||||
- support minimize window by keyboard
|
||||
- sway scratchpad support
|
||||
- window pin mode support
|
||||
- text-input-v2
|
||||
- window move/open animaition
|
||||
|
||||
|
||||
# install
|
||||
# wlroots(0.17)
|
||||
```
|
||||
git clone -b 0.17.4 https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||
cd wlroots
|
||||
meson build -Dprefix=/usr
|
||||
sudo ninja -C build install
|
||||
|
||||
git clone https://github.com/DreamMaoMao/mydwl.git
|
||||
cd mydwl
|
||||
meson build -Dprefix=/usr
|
||||
sudo ninja -C build install
|
||||
|
||||
sed -i s#/home/user#$HOME#g dwl.desktop
|
||||
sudo cp dwl.desktop /usr/share/wayland-sessions/
|
||||
```
|
||||
# dependcy
|
||||
|
||||
## tools
|
||||
```
|
||||
yay -S wofi foot
|
||||
|
||||
```
|
||||
# waybar (must use this waybar)
|
||||
```
|
||||
git clone https://gitee.com/DreamMaoMao/Waybar.git
|
||||
cd mywaybar
|
||||
meson build -Dprefix=/usr
|
||||
sudo ninja -C build install
|
||||
```
|
||||
|
||||
# thanks for some refer repo
|
||||
https://github.com/dqrk0jeste/owl - for window animation implementation code
|
||||
https://github.com/djpohly/dwl - for base dwl code
|
||||
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#! /bin/bash
|
||||
|
||||
set +e
|
||||
|
||||
systemctl --user unmask xdg-desktop-portal-hyprland
|
||||
systemctl --user mask xdg-desktop-portal-gnome
|
||||
|
||||
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
|
||||
|
||||
/usr/lib/xdg-desktop-portal-hyprland &
|
||||
|
||||
wl-clip-persist --clipboard regular &
|
||||
wl-paste --type text --watch cliphist store &
|
||||
|
||||
|
||||
@@ -0,0 +1,408 @@
|
||||
/*
|
||||
* Attempt to consolidate unavoidable suck into one file, away from dwl.c. This
|
||||
* file is not meant to be pretty. We use a .h file with static inline
|
||||
* functions instead of a separate .c module, or function pointers like sway, so
|
||||
* that they will simply compile out if the chosen #defines leave them unused.
|
||||
*/
|
||||
|
||||
/* Leave these functions first; they're used in the others */
|
||||
static inline int
|
||||
client_is_x11(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
return c->type == X11;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct wlr_surface *
|
||||
client_surface(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->surface;
|
||||
#endif
|
||||
return c->surface.xdg->surface;
|
||||
}
|
||||
|
||||
static inline int
|
||||
toplevel_from_wlr_surface(struct wlr_surface *s, Client **pc, LayerSurface **pl)
|
||||
{
|
||||
struct wlr_xdg_surface *xdg_surface, *tmp_xdg_surface;
|
||||
struct wlr_surface *root_surface;
|
||||
struct wlr_layer_surface_v1 *layer_surface;
|
||||
Client *c = NULL;
|
||||
LayerSurface *l = NULL;
|
||||
int type = -1;
|
||||
#ifdef XWAYLAND
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
#endif
|
||||
|
||||
if (!s)
|
||||
return -1;
|
||||
root_surface = wlr_surface_get_root_surface(s);
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(root_surface))) {
|
||||
c = xsurface->data;
|
||||
type = c->type;
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(root_surface))) {
|
||||
l = layer_surface->data;
|
||||
type = LayerShell;
|
||||
goto end;
|
||||
}
|
||||
|
||||
xdg_surface = wlr_xdg_surface_try_from_wlr_surface(root_surface);
|
||||
while (xdg_surface) {
|
||||
tmp_xdg_surface = NULL;
|
||||
switch (xdg_surface->role) {
|
||||
case WLR_XDG_SURFACE_ROLE_POPUP:
|
||||
if (!xdg_surface->popup || !xdg_surface->popup->parent)
|
||||
return -1;
|
||||
|
||||
tmp_xdg_surface = wlr_xdg_surface_try_from_wlr_surface(xdg_surface->popup->parent);
|
||||
|
||||
if (!tmp_xdg_surface)
|
||||
return toplevel_from_wlr_surface(xdg_surface->popup->parent, pc, pl);
|
||||
|
||||
xdg_surface = tmp_xdg_surface;
|
||||
break;
|
||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||
c = xdg_surface->data;
|
||||
type = c->type;
|
||||
goto end;
|
||||
case WLR_XDG_SURFACE_ROLE_NONE:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
if (pl)
|
||||
*pl = l;
|
||||
if (pc)
|
||||
*pc = c;
|
||||
return type;
|
||||
}
|
||||
|
||||
/* The others */
|
||||
static inline void
|
||||
client_activate_surface(struct wlr_surface *s, int activated)
|
||||
{
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
#ifdef XWAYLAND
|
||||
struct wlr_xwayland_surface *xsurface;
|
||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
|
||||
wlr_xwayland_surface_activate(xsurface, activated);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if ((toplevel = wlr_xdg_toplevel_try_from_wlr_surface(s)))
|
||||
wlr_xdg_toplevel_set_activated(toplevel, activated);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
client_set_bounds(Client *c, int32_t width, int32_t height)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return 0;
|
||||
#endif
|
||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource) >=
|
||||
XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION && width >= 0 && height >= 0
|
||||
&& (c->bounds.width != width || c->bounds.height != height)) {
|
||||
c->bounds.width = width;
|
||||
c->bounds.height = height;
|
||||
return wlr_xdg_toplevel_set_bounds(c->surface.xdg->toplevel, width, height);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
client_get_appid(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->class;
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->app_id;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_get_clip(Client *c, struct wlr_box *clip)
|
||||
{
|
||||
struct wlr_box xdg_geom = {0};
|
||||
*clip = (struct wlr_box){
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = c->geom.width - c->bw,
|
||||
.height = c->geom.height - c->bw,
|
||||
};
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
|
||||
wlr_xdg_surface_get_geometry(c->surface.xdg, &xdg_geom);
|
||||
clip->x = xdg_geom.x;
|
||||
clip->y = xdg_geom.y;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_get_geometry(Client *c, struct wlr_box *geom)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
geom->x = c->surface.xwayland->x;
|
||||
geom->y = c->surface.xwayland->y;
|
||||
geom->width = c->surface.xwayland->width;
|
||||
geom->height = c->surface.xwayland->height;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
wlr_xdg_surface_get_geometry(c->surface.xdg, geom);
|
||||
}
|
||||
|
||||
static inline Client *
|
||||
client_get_parent(Client *c)
|
||||
{
|
||||
Client *p = NULL;
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
if (c->surface.xwayland->parent)
|
||||
toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
if (c->surface.xdg->toplevel->parent)
|
||||
toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
|
||||
return p;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_has_children(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return !wl_list_empty(&c->surface.xwayland->children);
|
||||
#endif
|
||||
/* surface.xdg->link is never empty because it always contains at least the
|
||||
* surface itself. */
|
||||
return wl_list_length(&c->surface.xdg->link) > 1;
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
client_get_title(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->title;
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->title;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_float_type(Client *c)
|
||||
{
|
||||
struct wlr_xdg_toplevel *toplevel;
|
||||
struct wlr_xdg_toplevel_state state;
|
||||
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
struct wlr_xwayland_surface *surface = c->surface.xwayland;
|
||||
xcb_size_hints_t *size_hints = surface->size_hints;
|
||||
size_t i;
|
||||
if (surface->modal)
|
||||
return 1;
|
||||
|
||||
for (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;
|
||||
|
||||
return 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);
|
||||
}
|
||||
#endif
|
||||
|
||||
toplevel = c->surface.xdg->toplevel;
|
||||
state = toplevel->current;
|
||||
return toplevel->parent || (state.min_width != 0 && state.min_height != 0
|
||||
&& (state.min_width == state.max_width
|
||||
|| state.min_height == state.max_height));
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_rendered_on_mon(Client *c, Monitor *m)
|
||||
{
|
||||
/* This is needed for when you don't want to check formal assignment,
|
||||
* but rather actual displaying of the pixels.
|
||||
* Usually VISIBLEON suffices and is also faster. */
|
||||
struct wlr_surface_output *s;
|
||||
int unused_lx, unused_ly;
|
||||
if (!wlr_scene_node_coords(&c->scene->node, &unused_lx, &unused_ly))
|
||||
return 0;
|
||||
wl_list_for_each(s, &client_surface(c)->current_outputs, link)
|
||||
if (s->output == m->wlr_output)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_stopped(Client *c)
|
||||
{
|
||||
int pid;
|
||||
siginfo_t in = {0};
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
wl_client_get_credentials(c->surface.xdg->client->client, &pid, NULL, NULL);
|
||||
if (waitid(P_PID, pid, &in, WNOHANG|WCONTINUED|WSTOPPED|WNOWAIT) < 0) {
|
||||
/* This process is not our child process, while is very unluckely that
|
||||
* it is stopped, in order to do not skip frames assume that it is. */
|
||||
if (errno == ECHILD)
|
||||
return 1;
|
||||
} else if (in.si_pid) {
|
||||
if (in.si_code == CLD_STOPPED || in.si_code == CLD_TRAPPED)
|
||||
return 1;
|
||||
if (in.si_code == CLD_CONTINUED)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_is_unmanaged(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->override_redirect;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_notify_enter(struct wlr_surface *s, struct wlr_keyboard *kb)
|
||||
{
|
||||
if (kb)
|
||||
wlr_seat_keyboard_notify_enter(seat, s, kb->keycodes,
|
||||
kb->num_keycodes, &kb->modifiers);
|
||||
else
|
||||
wlr_seat_keyboard_notify_enter(seat, s, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_restack_surface(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
wlr_xwayland_surface_restack(c->surface.xwayland, NULL,
|
||||
XCB_STACK_MODE_ABOVE);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_send_close(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_close(c->surface.xwayland);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
wlr_xdg_toplevel_send_close(c->surface.xdg->toplevel);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_set_border_color(Client *c, const float color[static 4])
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
wlr_scene_rect_set_color(c->border[i], color);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_set_fullscreen(Client *c, int fullscreen)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, fullscreen);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg->toplevel, fullscreen);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
client_set_size(Client *c, uint32_t width, uint32_t height)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c)) {
|
||||
wlr_xwayland_surface_configure(c->surface.xwayland,
|
||||
c->geom.x, c->geom.y, width, height);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
if ((int32_t)width == c->surface.xdg->toplevel->current.width
|
||||
&& (int32_t)height == c->surface.xdg->toplevel->current.height)
|
||||
return 0;
|
||||
return wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, (int32_t)width, (int32_t)height);
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_set_tiled(Client *c, uint32_t edges)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
|
||||
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
|
||||
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
|
||||
} else {
|
||||
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
client_set_suspended(Client *c, int suspended)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return;
|
||||
#endif
|
||||
|
||||
wlr_xdg_toplevel_set_suspended(c->surface.xdg->toplevel, suspended);
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_wants_focus(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
return client_is_unmanaged(c)
|
||||
&& wlr_xwayland_or_surface_wants_focus(c->surface.xwayland)
|
||||
&& wlr_xwayland_icccm_input_model(c->surface.xwayland) != WLR_ICCCM_INPUT_MODEL_NONE;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
client_wants_fullscreen(Client *c)
|
||||
{
|
||||
#ifdef XWAYLAND
|
||||
if (client_is_x11(c))
|
||||
return c->surface.xwayland->fullscreen;
|
||||
#endif
|
||||
return c->surface.xdg->toplevel->requested.fullscreen;
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
/* speedie's dwl config */
|
||||
|
||||
#define COLOR(hex) { ((hex >> 24) & 0xFF) / 255.0f, \
|
||||
((hex >> 16) & 0xFF) / 255.0f, \
|
||||
((hex >> 8) & 0xFF) / 255.0f, \
|
||||
(hex & 0xFF) / 255.0f }
|
||||
|
||||
/* animation */
|
||||
static const bool animations = true; // Enable animations
|
||||
static const float zoom_initial_ratio = 0.5; // Initial window ratio for animations
|
||||
static const uint32_t animation_duration = 300; // Animation speed
|
||||
// static const double animation_curve[4] = {0.05,0.9,0.1,1.05}; // Animation curve
|
||||
static const double animation_curve[4] = {0.46,1.0,0.29,0.99}; // Animation curve
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int axis_bind_apply_timeout = 100; // Timeout for wheel binding actions
|
||||
static const unsigned int focus_on_activate = 1; // Automatically focus on window activation request
|
||||
static const unsigned int new_is_master = 1; // New windows are inserted at the head
|
||||
/* logging */
|
||||
static int log_level = WLR_ERROR;
|
||||
static const unsigned int numlockon = 1; // Enable numlock
|
||||
static const unsigned int hotarea_size = 10; // Hot area size, 10x10
|
||||
static const unsigned int enable_hotarea = 1; // Enable mouse hot area
|
||||
static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
|
||||
static int sloppyfocus = 1; /* Focus follows mouse */
|
||||
static unsigned int gappih = 5; /* Horizontal inner gap between windows */
|
||||
static unsigned int gappiv = 5; /* Vertical inner gap between windows */
|
||||
static unsigned int gappoh = 10; /* Horizontal outer gap between windows and screen edge */
|
||||
static unsigned int gappov = 10; /* Vertical outer gap between windows and screen edge */
|
||||
static int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if the surface isn't visible */
|
||||
static unsigned int borderpx = 5; /* Border pixel of windows */
|
||||
static const float rootcolor[] = COLOR(0x323232ff);
|
||||
static const float bordercolor[] = COLOR(0x444444ff);
|
||||
static const float focuscolor[] = COLOR(0xad741fff);
|
||||
static const float fakefullscreencolor[] = COLOR(0x89aa61ff);
|
||||
static const float urgentcolor[] = COLOR(0xad401fff);
|
||||
static const float scratchpadcolor[] = COLOR(0x516c93ff);
|
||||
static const float globalcolor[] = COLOR(0xb153a7ff);
|
||||
// static const char *cursor_theme = "Bibata-Modern-Ice";
|
||||
|
||||
static const int overviewgappi = 5; /* Gap between windows and edges in overview mode */
|
||||
static const int overviewgappo = 30; /* Gap between windows in overview mode */
|
||||
|
||||
/* 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, 1.0};
|
||||
|
||||
static int warpcursor = 1; /* Warp cursor to focused client */
|
||||
|
||||
/* Autostart */
|
||||
static const char *const autostart[] = {
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"$DWL/autostart.sh",
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* tagging
|
||||
* expand the array to add more tags
|
||||
*/
|
||||
static const char *tags[] = {
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
};
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* app_id title tags mask isfloating isfullscreen isnoclip isnoborder monitor width height */
|
||||
/* examples:
|
||||
{ "Gimp", NULL, 0, 1, -1,800,600 },
|
||||
*/
|
||||
{ "Google-chrome", NULL, 1 << 3, 0, 0, 0, 0,-1, 0,0},
|
||||
{ NULL, "Image Viewer", 0, 1, 0, 0, 0,-1, 0,0},
|
||||
{ NULL, "Image View", 0, 1, 0, 0, 0,-1, 0,0},
|
||||
{ NULL, "File Selector", 0, 1, 0, 0, 0,-1, 1200,800},
|
||||
{ NULL, "Open File", 0, 1, 0, 0, 0,-1, 1200,800},
|
||||
{ "polkit-gnome-authentication-agent-1", NULL, 0, 1, 0, 1, 1,-1, 930,230},
|
||||
{ "blueman-manager", NULL, 0, 1, 0, 0, 0,-1, 700,600},
|
||||
{ "Gnome-system-monitor", NULL, 0, 0, 0, 0, 0,-1, 700,600},
|
||||
{ "obs", NULL, 1<<5, 0, 0, 0, 0,-1, 700,600},
|
||||
{ "flameshot", NULL, 0, 0, 1, 0, 0,-1, 0,0},
|
||||
{ NULL, "rofi - Networks", 0, 1, 0, 1, 1,-1, 0,0},
|
||||
{ "Rofi", NULL, 0, 1, 0, 1, 1,-1, 0,0},
|
||||
{ "wofi", NULL, 0, 1, 0, 0, 1,-1, 0,0},
|
||||
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const Layout overviewlayout = { "", overview };
|
||||
|
||||
static const Layout layouts[] = { // At least two layouts, cannot delete less than two
|
||||
/* symbol arrange function */
|
||||
{ "", tile }, // Stack layout
|
||||
{ "", grid }, // Grid layout
|
||||
|
||||
};
|
||||
|
||||
/* monitors */
|
||||
static const MonitorRule monrules[] = {
|
||||
/* name mfact nmaster scale layout rotate/reflect x y*/
|
||||
/* example of a HiDPI laptop monitor:
|
||||
{ "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||
*/
|
||||
/* defaults */
|
||||
// { "eDP-1", 0.5, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
|
||||
{ "eDP-1", 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0,0},
|
||||
{ "HDMI-A-1", 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 1920,0},
|
||||
};
|
||||
|
||||
/* keyboard */
|
||||
static const struct xkb_rule_names xkb_rules = {
|
||||
/* can specify fields: rules, model, layout, variant, options */
|
||||
/* example:
|
||||
.options = "ctrl:nocaps",
|
||||
*/
|
||||
.options = NULL,
|
||||
};
|
||||
|
||||
static int repeat_rate = 25;
|
||||
static int repeat_delay = 600;
|
||||
|
||||
/* Trackpad */
|
||||
static int tap_to_click = 1;
|
||||
static int tap_and_drag = 1;
|
||||
static int drag_lock = 1;
|
||||
static int natural_scrolling = 0;
|
||||
static int disable_while_typing = 1;
|
||||
static int left_handed = 0;
|
||||
static 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_CLICK_METHOD_NONE
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER
|
||||
*/
|
||||
static const enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
|
||||
/* 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;
|
||||
/* You can choose between:
|
||||
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
|
||||
*/
|
||||
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
||||
|
||||
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||
#define MODKEY WLR_MODIFIER_ALT
|
||||
|
||||
#define TAGKEYS(KEY,SKEY,TAG) \
|
||||
{ WLR_MODIFIER_CTRL, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ WLR_MODIFIER_ALT, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
// static const char *termcmd[] = { "foot", NULL };
|
||||
// static const char *menucmd[] = { "wofi --conf $DWL/wofi/config_menu", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XKB_KEY_space, spawn, SHCMD("wofi") },
|
||||
{ MODKEY, XKB_KEY_Return, spawn, SHCMD("foot") },
|
||||
|
||||
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_Tab, focusstack, {.i = +1} },
|
||||
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_Left, focusdir, {.i = LEFT } }, /* alt left | Switch focus window within the current tag */
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_Right, focusdir, {.i = RIGHT } }, /* alt right | Switch focus window within the current tag */
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_Up, focusdir, {.i = UP } }, /* alt up | Switch focus window within the current tag */
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_Down, focusdir, {.i = DOWN } },
|
||||
|
||||
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_e, incnmaster, {.i = +1} },
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_t, incnmaster, {.i = -1} },
|
||||
{ WLR_MODIFIER_ALT|WLR_MODIFIER_CTRL, XKB_KEY_Left, setmfact, {.f = -0.01} },
|
||||
{ WLR_MODIFIER_ALT|WLR_MODIFIER_CTRL, XKB_KEY_Right, setmfact, {.f = +0.01} },
|
||||
{ MODKEY, XKB_KEY_s, zoom, {0} },
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_Up, exchange_client, {.i = UP } }, /* super shift up | 2D exchange window (tiling only) */
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_Down, exchange_client, {.i = DOWN } }, /* super shift down | 2D exchange window (tiling only) */
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_Left, exchange_client, {.i = LEFT} }, /* super shift left | 2D exchange window (tiling only) */
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_Right, exchange_client, {.i = RIGHT } }, /* super shift right | 2D exchange window (tiling only) */
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_g, toggleglobal, {0} },
|
||||
{ MODKEY, XKB_KEY_Tab, toggleoverview, {0} },
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_Left, viewtoleft, {0} },
|
||||
{ WLR_MODIFIER_CTRL, XKB_KEY_Left, viewtoleft_have_client, {0} },
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_Right, viewtoright, {0} },
|
||||
{ WLR_MODIFIER_CTRL, XKB_KEY_Right, viewtoright_have_client, {0} },
|
||||
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_LOGO, XKB_KEY_Left, tagtoleft, {0} }, /* ctrl alt left | Move current window to the left tag */
|
||||
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_LOGO, XKB_KEY_Right, tagtoright, {0} },
|
||||
{ MODKEY, XKB_KEY_q, killclient, {0} },
|
||||
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_LOGO, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_LOGO, XKB_KEY_g, setlayout, {.v = &layouts[1]} },
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_n, switch_layout, {0} },
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_backslash, togglefloating, {0} },
|
||||
{ MODKEY, XKB_KEY_a, togglefakefullscreen, {0} },
|
||||
{ MODKEY, XKB_KEY_f, togglefullscreen, {0} },
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_i, minized, {0} }, // Minimize, move to scratchpad
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_SHIFT, XKB_KEY_I, restore_minized, {0} },
|
||||
{ WLR_MODIFIER_ALT, XKB_KEY_z, toggle_scratchpad, {0} }, // Cycle through scratchpad
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_bracketleft, focusmon, {.i = WLR_DIRECTION_LEFT} }, // super + [
|
||||
{ WLR_MODIFIER_LOGO, XKB_KEY_bracketright, focusmon, {.i = WLR_DIRECTION_RIGHT} }, // suepr + ]
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_CTRL, XKB_KEY_bracketleft, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||
{ WLR_MODIFIER_LOGO|WLR_MODIFIER_CTRL, XKB_KEY_bracketright, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_X, incgaps, {.i = +1 } },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Z, incgaps, {.i = -1 } },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_R, togglegaps, {0} },
|
||||
TAGKEYS( XKB_KEY_KP_1, XKB_KEY_exclam, 0),
|
||||
TAGKEYS( XKB_KEY_KP_2, XKB_KEY_at, 1),
|
||||
TAGKEYS( XKB_KEY_KP_3, XKB_KEY_numbersign, 2),
|
||||
TAGKEYS( XKB_KEY_KP_4, XKB_KEY_dollar, 3),
|
||||
TAGKEYS( XKB_KEY_KP_5, XKB_KEY_percent, 4),
|
||||
TAGKEYS( XKB_KEY_KP_6, XKB_KEY_asciicircum, 5),
|
||||
TAGKEYS( XKB_KEY_KP_7, XKB_KEY_ampersand, 6),
|
||||
TAGKEYS( XKB_KEY_KP_8, XKB_KEY_asterisk, 7),
|
||||
TAGKEYS( XKB_KEY_KP_9, XKB_KEY_parenleft, 8),
|
||||
//{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
||||
|
||||
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
||||
{ WLR_MODIFIER_LOGO,XKB_KEY_m, quit, {0} },
|
||||
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
|
||||
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
|
||||
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
||||
};
|
||||
|
||||
static const Button buttons[] = {
|
||||
{ WLR_MODIFIER_LOGO, BTN_LEFT, moveresize, {.ui = CurMove } },
|
||||
{ 0, BTN_MIDDLE, togglefakefullscreen, {0} }, // Middle button triggers fake fullscreen
|
||||
{ WLR_MODIFIER_LOGO, BTN_RIGHT, moveresize, {.ui = CurResize } },
|
||||
{ WLR_MODIFIER_ALT|WLR_MODIFIER_CTRL, BTN_LEFT, spawn, SHCMD("bash ~/tool/shotTranslate.sh shot")},
|
||||
{ 0, BTN_LEFT, toggleoverview, {0} },
|
||||
{ 0, BTN_RIGHT, killclient, {0} },
|
||||
};
|
||||
|
||||
static const Axis axes[] = {
|
||||
{ WLR_MODIFIER_LOGO, AxisUp, viewtoleft_have_client, {0} }, // Middle button + super to switch workspace forward
|
||||
{ WLR_MODIFIER_LOGO, AxisDown, viewtoright_have_client, {0} }, // Middle button + super to switch workspace backward
|
||||
};
|
||||
@@ -0,0 +1,367 @@
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
#ifndef CURSOR_SHAPE_V1_SERVER_PROTOCOL_H
|
||||
#define CURSOR_SHAPE_V1_SERVER_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "wayland-server.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct wl_client;
|
||||
struct wl_resource;
|
||||
|
||||
/**
|
||||
* @page page_cursor_shape_v1 The cursor_shape_v1 protocol
|
||||
* @section page_ifaces_cursor_shape_v1 Interfaces
|
||||
* - @subpage page_iface_wp_cursor_shape_manager_v1 - cursor shape manager
|
||||
* - @subpage page_iface_wp_cursor_shape_device_v1 - cursor shape for a device
|
||||
* @section page_copyright_cursor_shape_v1 Copyright
|
||||
* <pre>
|
||||
*
|
||||
* Copyright 2018 The Chromium Authors
|
||||
* Copyright 2023 Simon Ser
|
||||
*
|
||||
* 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 (including the next
|
||||
* paragraph) 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.
|
||||
* </pre>
|
||||
*/
|
||||
struct wl_pointer;
|
||||
struct wp_cursor_shape_device_v1;
|
||||
struct wp_cursor_shape_manager_v1;
|
||||
struct zwp_tablet_tool_v2;
|
||||
|
||||
#ifndef WP_CURSOR_SHAPE_MANAGER_V1_INTERFACE
|
||||
#define WP_CURSOR_SHAPE_MANAGER_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_wp_cursor_shape_manager_v1 wp_cursor_shape_manager_v1
|
||||
* @section page_iface_wp_cursor_shape_manager_v1_desc Description
|
||||
*
|
||||
* This global offers an alternative, optional way to set cursor images. This
|
||||
* new way uses enumerated cursors instead of a wl_surface like
|
||||
* wl_pointer.set_cursor does.
|
||||
*
|
||||
* Warning! The protocol described in this file is currently in the testing
|
||||
* phase. Backward compatible changes may be added together with the
|
||||
* corresponding interface version bump. Backward incompatible changes can
|
||||
* only be done by creating a new major version of the extension.
|
||||
* @section page_iface_wp_cursor_shape_manager_v1_api API
|
||||
* See @ref iface_wp_cursor_shape_manager_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_wp_cursor_shape_manager_v1 The wp_cursor_shape_manager_v1 interface
|
||||
*
|
||||
* This global offers an alternative, optional way to set cursor images. This
|
||||
* new way uses enumerated cursors instead of a wl_surface like
|
||||
* wl_pointer.set_cursor does.
|
||||
*
|
||||
* Warning! The protocol described in this file is currently in the testing
|
||||
* phase. Backward compatible changes may be added together with the
|
||||
* corresponding interface version bump. Backward incompatible changes can
|
||||
* only be done by creating a new major version of the extension.
|
||||
*/
|
||||
extern const struct wl_interface wp_cursor_shape_manager_v1_interface;
|
||||
#endif
|
||||
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_INTERFACE
|
||||
#define WP_CURSOR_SHAPE_DEVICE_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_wp_cursor_shape_device_v1 wp_cursor_shape_device_v1
|
||||
* @section page_iface_wp_cursor_shape_device_v1_desc Description
|
||||
*
|
||||
* This interface advertises the list of supported cursor shapes for a
|
||||
* device, and allows clients to set the cursor shape.
|
||||
* @section page_iface_wp_cursor_shape_device_v1_api API
|
||||
* See @ref iface_wp_cursor_shape_device_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_wp_cursor_shape_device_v1 The wp_cursor_shape_device_v1 interface
|
||||
*
|
||||
* This interface advertises the list of supported cursor shapes for a
|
||||
* device, and allows clients to set the cursor shape.
|
||||
*/
|
||||
extern const struct wl_interface wp_cursor_shape_device_v1_interface;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_manager_v1
|
||||
* @struct wp_cursor_shape_manager_v1_interface
|
||||
*/
|
||||
struct wp_cursor_shape_manager_v1_interface {
|
||||
/**
|
||||
* destroy the manager
|
||||
*
|
||||
* Destroy the cursor shape manager.
|
||||
*/
|
||||
void (*destroy)(struct wl_client *client,
|
||||
struct wl_resource *resource);
|
||||
/**
|
||||
* manage the cursor shape of a pointer device
|
||||
*
|
||||
* Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
|
||||
*/
|
||||
void (*get_pointer)(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t cursor_shape_device,
|
||||
struct wl_resource *pointer);
|
||||
/**
|
||||
* manage the cursor shape of a tablet tool device
|
||||
*
|
||||
* Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2
|
||||
* object.
|
||||
*/
|
||||
void (*get_tablet_tool_v2)(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t cursor_shape_device,
|
||||
struct wl_resource *tablet_tool);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_manager_v1
|
||||
*/
|
||||
#define WP_CURSOR_SHAPE_MANAGER_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_manager_v1
|
||||
*/
|
||||
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_POINTER_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_manager_v1
|
||||
*/
|
||||
#define WP_CURSOR_SHAPE_MANAGER_V1_GET_TABLET_TOOL_V2_SINCE_VERSION 1
|
||||
|
||||
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM
|
||||
#define WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_device_v1
|
||||
* cursor shapes
|
||||
*
|
||||
* This enum describes cursor shapes.
|
||||
*
|
||||
* The names are taken from the CSS W3C specification:
|
||||
* https://w3c.github.io/csswg-drafts/css-ui/#cursor
|
||||
*/
|
||||
enum wp_cursor_shape_device_v1_shape {
|
||||
/**
|
||||
* default cursor
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT = 1,
|
||||
/**
|
||||
* a context menu is available for the object under the cursor
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU = 2,
|
||||
/**
|
||||
* help is available for the object under the cursor
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP = 3,
|
||||
/**
|
||||
* pointer that indicates a link or another interactive element
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER = 4,
|
||||
/**
|
||||
* progress indicator
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS = 5,
|
||||
/**
|
||||
* program is busy, user should wait
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT = 6,
|
||||
/**
|
||||
* a cell or set of cells may be selected
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL = 7,
|
||||
/**
|
||||
* simple crosshair
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR = 8,
|
||||
/**
|
||||
* text may be selected
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT = 9,
|
||||
/**
|
||||
* vertical text may be selected
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT = 10,
|
||||
/**
|
||||
* drag-and-drop: alias of/shortcut to something is to be created
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS = 11,
|
||||
/**
|
||||
* drag-and-drop: something is to be copied
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY = 12,
|
||||
/**
|
||||
* drag-and-drop: something is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_MOVE = 13,
|
||||
/**
|
||||
* drag-and-drop: the dragged item cannot be dropped at the current cursor location
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP = 14,
|
||||
/**
|
||||
* drag-and-drop: the requested action will not be carried out
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED = 15,
|
||||
/**
|
||||
* drag-and-drop: something can be grabbed
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB = 16,
|
||||
/**
|
||||
* drag-and-drop: something is being grabbed
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING = 17,
|
||||
/**
|
||||
* resizing: the east border is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE = 18,
|
||||
/**
|
||||
* resizing: the north border is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE = 19,
|
||||
/**
|
||||
* resizing: the north-east corner is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE = 20,
|
||||
/**
|
||||
* resizing: the north-west corner is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE = 21,
|
||||
/**
|
||||
* resizing: the south border is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE = 22,
|
||||
/**
|
||||
* resizing: the south-east corner is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE = 23,
|
||||
/**
|
||||
* resizing: the south-west corner is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE = 24,
|
||||
/**
|
||||
* resizing: the west border is to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE = 25,
|
||||
/**
|
||||
* resizing: the east and west borders are to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE = 26,
|
||||
/**
|
||||
* resizing: the north and south borders are to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE = 27,
|
||||
/**
|
||||
* resizing: the north-east and south-west corners are to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE = 28,
|
||||
/**
|
||||
* resizing: the north-west and south-east corners are to be moved
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE = 29,
|
||||
/**
|
||||
* resizing: that the item/column can be resized horizontally
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE = 30,
|
||||
/**
|
||||
* resizing: that the item/row can be resized vertically
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE = 31,
|
||||
/**
|
||||
* something can be scrolled in any direction
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL = 32,
|
||||
/**
|
||||
* something can be zoomed in
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN = 33,
|
||||
/**
|
||||
* something can be zoomed out
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT = 34,
|
||||
};
|
||||
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ENUM */
|
||||
|
||||
#ifndef WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM
|
||||
#define WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM
|
||||
enum wp_cursor_shape_device_v1_error {
|
||||
/**
|
||||
* the specified shape value is invalid
|
||||
*/
|
||||
WP_CURSOR_SHAPE_DEVICE_V1_ERROR_INVALID_SHAPE = 1,
|
||||
};
|
||||
#endif /* WP_CURSOR_SHAPE_DEVICE_V1_ERROR_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_device_v1
|
||||
* @struct wp_cursor_shape_device_v1_interface
|
||||
*/
|
||||
struct wp_cursor_shape_device_v1_interface {
|
||||
/**
|
||||
* destroy the cursor shape device
|
||||
*
|
||||
* Destroy the cursor shape device.
|
||||
*
|
||||
* The device cursor shape remains unchanged.
|
||||
*/
|
||||
void (*destroy)(struct wl_client *client,
|
||||
struct wl_resource *resource);
|
||||
/**
|
||||
* set device cursor to the shape
|
||||
*
|
||||
* Sets the device cursor to the specified shape. The compositor
|
||||
* will change the cursor image based on the specified shape.
|
||||
*
|
||||
* The cursor actually changes only if the input device focus is
|
||||
* one of the requesting client's surfaces. If any, the previous
|
||||
* cursor image (surface or shape) is replaced.
|
||||
*
|
||||
* The "shape" argument must be a valid enum entry, otherwise the
|
||||
* invalid_shape protocol error is raised.
|
||||
*
|
||||
* This is similar to the wl_pointer.set_cursor and
|
||||
* zwp_tablet_tool_v2.set_cursor requests, but this request accepts
|
||||
* a shape instead of contents in the form of a surface. Clients
|
||||
* can mix set_cursor and set_shape requests.
|
||||
*
|
||||
* The serial parameter must match the latest wl_pointer.enter or
|
||||
* zwp_tablet_tool_v2.proximity_in serial number sent to the
|
||||
* client. Otherwise the request will be ignored.
|
||||
* @param serial serial number of the enter event
|
||||
*/
|
||||
void (*set_shape)(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t serial,
|
||||
uint32_t shape);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_device_v1
|
||||
*/
|
||||
#define WP_CURSOR_SHAPE_DEVICE_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_wp_cursor_shape_device_v1
|
||||
*/
|
||||
#define WP_CURSOR_SHAPE_DEVICE_V1_SET_SHAPE_SINCE_VERSION 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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 foot .
|
||||
.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 foot 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.
|
||||
@@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Dwl
|
||||
Comment=Dynamic window manager for wayland
|
||||
Exec=env XDG_CURRENT_DESKTOP=sway DWL=/home/user/.config/dwl dwl
|
||||
Icon=dwl
|
||||
Type=Application
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
project('dwl', ['c', 'cpp'],
|
||||
version : '0.4'
|
||||
)
|
||||
|
||||
subdir('protocols')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
libm = cc.find_library('m')
|
||||
xcb = dependency('xcb', required : get_option('xwayland'))
|
||||
xlibs = dependency('xcb-icccm', required : get_option('xwayland'))
|
||||
wayland_server_dep = dependency('wayland-server')
|
||||
wlroots_dep = dependency('wlroots', version : ['>=0.17.0', '<0.18.0'])
|
||||
xkbcommon_dep = dependency('xkbcommon')
|
||||
libinput_dep = dependency('libinput')
|
||||
libwayland_client_dep = dependency('wayland-client')
|
||||
|
||||
c_args = [
|
||||
'-g',
|
||||
'-Wno-unused-function',
|
||||
'-DWLR_USE_UNSTABLE',
|
||||
'-D_POSIX_C_SOURCE=200809L',
|
||||
'-DVERSION="@0@"'.format(meson.project_version())
|
||||
]
|
||||
|
||||
if xcb.found() and xlibs.found()
|
||||
c_args += '-DXWAYLAND'
|
||||
c_args += '-DIM'
|
||||
endif
|
||||
|
||||
executable('dwl',
|
||||
'dwl.c',
|
||||
'util.c',
|
||||
'wlr_foreign_toplevel_management_v1.c',
|
||||
'wlr_foreign_toplevel_management_v1.h',
|
||||
wayland_sources,
|
||||
dependencies : [
|
||||
libm,
|
||||
xcb,
|
||||
xlibs,
|
||||
wayland_server_dep,
|
||||
wlroots_dep,
|
||||
xkbcommon_dep,
|
||||
libinput_dep,
|
||||
libwayland_client_dep,
|
||||
],
|
||||
install : true,
|
||||
c_args : c_args
|
||||
)
|
||||
|
||||
install_man('dwl.1')
|
||||
@@ -0,0 +1 @@
|
||||
option('xwayland', type : 'feature', value : 'enabled')
|
||||
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This is largely ripped from somebar's ipc patchset; just with some personal modifications.
|
||||
I would probably just submit raphi's patchset but I don't think that would be polite.
|
||||
-->
|
||||
<protocol name="dwl_ipc_unstable_v2">
|
||||
<description summary="inter-proccess-communication about dwl's state">
|
||||
This protocol allows clients to update and get updates from dwl.
|
||||
|
||||
Warning! The protocol described in this file is experimental and
|
||||
backward incompatible changes may be made. Backward compatible
|
||||
changes may be added together with the corresponding interface
|
||||
version bump.
|
||||
Backward incompatible changes are done by bumping the version
|
||||
number in the protocol and interface names and resetting the
|
||||
interface version. Once the protocol is to be declared stable,
|
||||
the 'z' prefix and the version number in the protocol and
|
||||
interface names are removed and the interface version number is
|
||||
reset.
|
||||
</description>
|
||||
|
||||
<interface name="zdwl_ipc_manager_v2" version="1">
|
||||
<description summary="manage dwl state">
|
||||
This interface is exposed as a global in wl_registry.
|
||||
|
||||
Clients can use this interface to get a dwl_ipc_output.
|
||||
After binding the client will recieve the dwl_ipc_manager.tags and dwl_ipc_manager.layout events.
|
||||
The dwl_ipc_manager.tags and dwl_ipc_manager.layout events expose tags and layouts to the client.
|
||||
</description>
|
||||
|
||||
<request name="release" type="destructor">
|
||||
<description summary="release dwl_ipc_manager">
|
||||
Indicates that the client will not the dwl_ipc_manager object anymore.
|
||||
Objects created through this instance are not affected.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="get_output">
|
||||
<description summary="get a dwl_ipc_outout for a wl_output">
|
||||
Get a dwl_ipc_outout for the specified wl_output.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="zdwl_ipc_output_v2"/>
|
||||
<arg name="output" type="object" interface="wl_output"/>
|
||||
</request>
|
||||
|
||||
<event name="tags">
|
||||
<description summary="Announces tag amount">
|
||||
This event is sent after binding.
|
||||
A roundtrip after binding guarantees the client recieved all tags.
|
||||
</description>
|
||||
<arg name="amount" type="uint"/>
|
||||
</event>
|
||||
|
||||
<event name="layout">
|
||||
<description summary="Announces a layout">
|
||||
This event is sent after binding.
|
||||
A roundtrip after binding guarantees the client recieved all layouts.
|
||||
</description>
|
||||
<arg name="name" type="string"/>
|
||||
</event>
|
||||
</interface>
|
||||
|
||||
<interface name="zdwl_ipc_output_v2" version="1">
|
||||
<description summary="control dwl output">
|
||||
Observe and control a dwl output.
|
||||
|
||||
Events are double-buffered:
|
||||
Clients should cache events and redraw when a dwl_ipc_output.frame event is sent.
|
||||
|
||||
Request are not double-buffered:
|
||||
The compositor will update immediately upon request.
|
||||
</description>
|
||||
|
||||
<enum name="tag_state">
|
||||
<entry name="none" value="0" summary="no state"/>
|
||||
<entry name="active" value="1" summary="tag is active"/>
|
||||
<entry name="urgent" value="2" summary="tag has at least one urgent client"/>
|
||||
</enum>
|
||||
|
||||
<request name="release" type="destructor">
|
||||
<description summary="release dwl_ipc_outout">
|
||||
Indicates to that the client no longer needs this dwl_ipc_output.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<event name="toggle_visibility">
|
||||
<description summary="Toggle client visibilty">
|
||||
Indicates the client should hide or show themselves.
|
||||
If the client is visible then hide, if hidden then show.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
<event name="active">
|
||||
<description summary="Update the selected output.">
|
||||
Indicates if the output is active. Zero is invalid, nonzero is valid.
|
||||
</description>
|
||||
<arg name="active" type="uint"/>
|
||||
</event>
|
||||
|
||||
<event name="tag">
|
||||
<description summary="Update the state of a tag.">
|
||||
Indicates that a tag has been updated.
|
||||
</description>
|
||||
<arg name="tag" type="uint" summary="Index of the tag"/>
|
||||
<arg name="state" type="uint" enum="tag_state" summary="The state of the tag."/>
|
||||
<arg name="clients" type="uint" summary="The number of clients in the tag."/>
|
||||
<arg name="focused" type="uint" summary="If there is a focused client. Nonzero being valid, zero being invalid."/>
|
||||
</event>
|
||||
|
||||
<event name="layout">
|
||||
<description summary="Update the layout.">
|
||||
Indicates a new layout is selected.
|
||||
</description>
|
||||
<arg name="layout" type="uint" summary="Index of the layout."/>
|
||||
</event>
|
||||
|
||||
<event name="title">
|
||||
<description summary="Update the title.">
|
||||
Indicates the title has changed.
|
||||
</description>
|
||||
<arg name="title" type="string" summary="The new title name."/>
|
||||
</event>
|
||||
|
||||
<event name="appid" since="1">
|
||||
<description summary="Update the appid.">
|
||||
Indicates the appid has changed.
|
||||
</description>
|
||||
<arg name="appid" type="string" summary="The new appid."/>
|
||||
</event>
|
||||
|
||||
<event name="layout_symbol" since="1">
|
||||
<description summary="Update the current layout symbol">
|
||||
Indicates the layout has changed. Since layout symbols are dynamic.
|
||||
As opposed to the zdwl_ipc_manager.layout event, this should take precendence when displaying.
|
||||
You can ignore the zdwl_ipc_output.layout event.
|
||||
</description>
|
||||
<arg name="layout" type="string" summary="The new layout"/>
|
||||
</event>
|
||||
|
||||
<event name="frame">
|
||||
<description summary="The update sequence is done.">
|
||||
Indicates that a sequence of status updates have finished and the client should redraw.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
<request name="set_tags">
|
||||
<description summary="Set the active tags of this output"/>
|
||||
<arg name="tagmask" type="uint" summary="bitmask of the tags that should be set."/>
|
||||
<arg name="toggle_tagset" type="uint" summary="toggle the selected tagset, zero for invalid, nonzero for valid."/>
|
||||
</request>
|
||||
|
||||
<request name="set_client_tags">
|
||||
<description summary="Set the tags of the focused client.">
|
||||
The tags are updated as follows:
|
||||
new_tags = (current_tags AND and_tags) XOR xor_tags
|
||||
</description>
|
||||
<arg name="and_tags" type="uint"/>
|
||||
<arg name="xor_tags" type="uint"/>
|
||||
</request>
|
||||
|
||||
<request name="set_layout">
|
||||
<description summary="Set the layout of this output"/>
|
||||
<arg name="index" type="uint" summary="index of a layout recieved by dwl_ipc_manager.layout"/>
|
||||
</request>
|
||||
</interface>
|
||||
</protocol>
|
||||
@@ -0,0 +1,24 @@
|
||||
wayland_scanner = find_program('wayland-scanner')
|
||||
wayland_protos_dep = dependency('wayland-protocols')
|
||||
wl_protocol_dir = wayland_protos_dep.get_pkgconfig_variable('pkgdatadir')
|
||||
wayland_scanner_code = generator(
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.c',
|
||||
arguments: ['private-code', '@INPUT@', '@OUTPUT@'])
|
||||
wayland_scanner_client = generator(
|
||||
wayland_scanner,
|
||||
output: '@BASENAME@-protocol.h',
|
||||
arguments: ['server-header', '@INPUT@', '@OUTPUT@'])
|
||||
|
||||
wayland_xmls = [
|
||||
wl_protocol_dir + '/stable/xdg-shell/xdg-shell.xml',
|
||||
'wlr-layer-shell-unstable-v1.xml',
|
||||
'pointer-constraints-unstable-v1.xml',
|
||||
'wlr-foreign-toplevel-management-unstable-v1.xml',
|
||||
'dwl-ipc-unstable-v2.xml',
|
||||
# 'cursor-shape-v1.xml'
|
||||
]
|
||||
wayland_sources = [
|
||||
wayland_scanner_code.process(wayland_xmls),
|
||||
wayland_scanner_client.process(wayland_xmls),
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user