Compare commits

214 Commits

Author SHA1 Message Date
Ben Collerson 9f8b0d3866 fix singletagset patch issue #56 2024-05-08 13:15:51 +10:00
Palanix 8bef5b09a4 Fix monitorconfig patch 2024-05-03 23:37:08 +02:00
choc 63ad4cff6d tablet-input: new patch 2024-05-04 01:23:26 +08:00
wochap d9cd3ece0e remove unnecessary changes in client.h 2024-05-02 22:27:19 +00:00
choc 6b4abeeb48 swallow: update patch 2024-05-02 00:33:56 +08:00
wochap 5841138587 add foreign-toplevel-management.patch 2024-04-29 14:55:41 +00:00
sewn f719481787 bar: 2024-04-25 2024-04-25 17:51:44 +03:00
sewn 2c53203176 bar: 2024-24-04 2024-04-24 15:45:30 +03:00
Eldar Yusupov 1424a2e4d5 restoremon: switch to early return 2024-04-23 11:09:25 +03:00
sewn 5be9643bbd bar: use patch from git repo
diff --git a/bar/bar.patch b/bar/bar.patch
index d8a367a..a8a6f96 100644
--- a/bar/bar.patch
+++ b/bar/bar.patch
@@ -1,4 +1,4 @@
-From c84dbb5d4fa84e37d9bf6addde065dc7d3b13ec5 Mon Sep 17 00:00:00 2001
+From a47820e26cbbcc3af7591d5676276a07def21c91 Mon Sep 17 00:00:00 2001
 From: sewn <sewn@disroot.org>
 Date: Tue, 16 Apr 2024 23:58:41 +0300
 Subject: [PATCH] Implement dwm bar clone
@@ -994,6 +994,3 @@ index bf763df..54273ae 100644

  	if (c->isurgent && surface && surface->mapped)
  		client_set_border_color(c, urgentcolor);
---
-2.44.0
-
2024-04-17 00:03:01 +03:00
sewn 84564e656d bar: remove utf8.h, included with drwl 2024-04-16 23:59:41 +03:00
Dhruva Sambrani 587c226f8b update dim-unfocused to allow temporary toggling 2024-04-16 14:25:52 +02:00
sewn 7d892cf813 barborder: bar 2024-04-14 2024-04-14 08:47:19 +03:00
sewn d62bced500 barpadding: bar 2024-04-14 2024-04-14 08:21:50 +03:00
sewn 12a8307629 hide_vacant_tags: update for bar 2024-04-14 2024-04-14 07:59:38 +03:00
sewn 28fa4c79d4 bar: update 2024-04-14 2024-04-14 07:46:05 +03:00
Eldar Yusupov 6905f26b30 Fix crash when there is no active client 2024-04-13 18:29:35 +03:00
wochap d46409b726 update scenefx for HEAD 2024-04-11 18:26:36 -05:00
wochap a0102f17ec update minimalborders for HEAD 2024-04-11 18:24:54 -05:00
wochap 53991f99ed update gestures for HEAD 2024-04-11 18:23:43 -05:00
wochap fc2252bd80 update relative-mouse-resize for HEAD 2024-04-11 18:20:49 -05:00
wochap 26477981b9 update cursortheme for HEAD 2024-04-11 18:18:52 -05:00
wochap a386148ba5 update pointer-gestures-unstable-v1 for HEAD 2024-04-11 18:12:30 -05:00
wochap 3b0efde6d1 update lockedkeys for HEAD 2024-04-11 18:10:58 -05:00
wochap 4383783071 update regexrules patch 2024-04-11 18:09:11 -05:00
wochap c599b81e8c update customfloat for HEAD 2024-04-11 18:06:35 -05:00
wochap 5258059c85 update pertag for HEAD 2024-04-11 18:04:04 -05:00
wochap f73a215be1 update centeredmaster for HEAD 2024-04-11 17:58:47 -05:00
wochap 3b6daafd33 update bottomstack for HEAD 2024-04-11 17:56:11 -05:00
wochap f9ae4415a4 add options for blur and opacity 2024-04-10 16:01:50 +00:00
Nikita Ivanov 861ae80894 Add attachtop patch 2024-04-10 00:00:00 +00:00
sewn f0d24ce8a5 update bar patch 2024-04-09 11:07:03 +03:00
wochap 44d448afe3 add headless patch 2024-04-09 02:51:11 +00:00
wochap 560cc7c692 add virtual-pointer patch 2024-04-09 02:50:12 +00:00
Eldar Yusupov 9182bdafe6 Add restore-monitor patch
Moves clients to their old output when it is reattached.
2024-04-07 15:41:44 +03:00
nullsystem 382028c7ba primaryselection - disable/enable primary selection
* Just simply adds a config to disable/enable primary selection
* Revives Palanix's Primary-Selection patch
2024-04-06 15:31:32 +01:00
nullsystem 198c265698 buttonbystate.patch - allow config for release (and press)
- Adds "state" (enum wlr_button_state) to configure a button action on
  either press or release. This basically enables release to be used
  for button actions.
2024-04-06 15:29:01 +01:00
oak 5d43995529 port barheight patch from dwm 2024-04-06 13:49:34 +00:00
Oak bd0fdd6121 port barheight patch from dwm 2024-04-06 13:49:34 +00:00
Guido Cella 49b1aa5848 update unclutter
Remember the last cursor shape when restoring the cursor.

Remove the condition that returns early when a pointer constraint is
active because it is not necessary now that pointer focus is no longer
cleared.

I didn't call wlr_seat_pointer_notify_enter() while the cursor is hidden
to avoid restoring it, but this is no longer necessary now that
setcursor() and setcursorshape() don't change the cursor while it is
hidden: those calls were what restored the cursor.

By calling wlr_seat_pointer_notify_enter() even when the cursor is
hidden, we no longer have to manually restore pointer focus when the
cursor is restored.
2024-04-06 08:03:47 +02:00
wochap 3f964d83c7 Update scenefx/scenefx.patch 2024-04-05 14:49:25 +00:00
sewn ff2881f32a bar: split sub-patches 2024-04-05 14:19:08 +03:00
choc aa61f857b3 swallow: update config.def.h 2024-04-03 11:31:20 +08:00
nullsystem cd3fc471ed perinputconfig - Add backported v0.5 patch
- Backport perinputconfig from main-tracking to v0.5
- It's actually simpler since v0.5 already has the keyboard groups as a
  list as opposed to what's in current main
2024-04-01 22:32:13 +01:00
sewn 1843f21b81 remove stale uselessgaps 2024-04-01 17:24:19 +03:00
sewn 15ff36805c gaps: introduce 2024-04-01 17:16:51 +03:00
korei999 0c4b6175f1 update xwayland-handle-minimize 2024-04-01 15:19:06 +03:00
Guido Cella 3cb9b3596b update switchtotag 2024-04-01 08:51:32 +02:00
nullsystem 3dfdfb1eda add perinputconfig.patch - set configuration per input
- Array replaced singular variables for configuration
- Pointer: Only applies to enable-state, acceleration profile, and speed
- Keyboard: Basically xkb_rule_names plus name
- Like EX: Rules, requires NULL/default set at the end
2024-03-31 20:05:12 +01:00
choc bedc1d5e56 add fakefullscreenclient patch
enable fake fullscreen per client
2024-03-29 22:57:26 +08:00
wochap 36a355a4cd Update scenefx/scenefx.patch 2024-03-29 13:52:35 +00:00
A Frederick Christensen 9821f7d463 Remove simple-touch-input in favor of less-simple-touch-input 2024-03-28 20:19:35 +00:00
Micah N Gorrell 8f25c8b838 Updated the less-simple-touch-input patch 2024-03-28 11:27:42 -06:00
Guido Cella 831e910b94 update unclutter
Don't clear the pointer focus when hiding the cursor. This was annoying
because if you e.g. had the cursor over a spoiler tag it becomes black
again after the timeout, or if the cursor was opening a popup by
hovering over a button the popup disappears after the timeout.

Not clearing the pointer focus requires adding a check when changing the
cursor image to not make the cursor reappear when it does. Skipping the
image change results in having the old cursor image if it changed while
the cursor was hidden, until it is changed again. Don't keep track of
the last cursor image for simplicity.
2024-03-28 07:50:51 +01:00
Micah N Gorrell 279d0f70ec Modified logic of press_repeat_release patch so that an unmodified keybinding with default values for the new flags will behave as it does in vanilla, while keybindings with customized flags will function as expected 2024-03-27 16:27:59 -06:00
Micah N Gorrell 40cc73221a Add press_repeat_release patch 2024-03-27 16:01:42 -06:00
Micah N Gorrell d038194afc Add remembertags patch 2024-03-27 13:06:24 -06:00
Micah N Gorrell 065f04e423 Add hiderule patch 2024-03-27 12:55:06 -06:00
Micah N Gorrell 277cf1f076 Add varcol layout patch 2024-03-27 12:36:36 -06:00
David Donahue ca0c67979d Added toggle_constraints patch 2024-03-26 17:52:34 -06:00
Micah N Gorrell 2e5f0138a0 Update less-simple-touch-input patch based on pointer contstraints being added upstream 2024-03-26 10:35:19 -06:00
choc 21ad6439f4 add setupenv patch
allow configuring environment variables in config.h
2024-03-26 22:16:17 +08:00
sewn 2fbc9f286b bar: fix bug (updatebardims) 2024-03-25 00:16:26 +03:00
sewn 5066a878bb bar: add hide_vacant_tags 2024-03-24 23:07:40 +03:00
wochap a913eee690 add scenefx patch 2024-03-24 00:19:22 +00:00
A Frederick Christensen 0c4413e256 Cleanup after image hosting testing 2024-03-23 13:49:01 -05:00
A Frederick Christensen d8abfd97aa Testing image inclusion 2024-03-23 12:42:45 -05:00
sewn f92769a2bc bar: update patches 2024-03-23 19:21:10 +03:00
sewn 1af42ffa1b bar: add border patch 2024-03-23 14:10:37 +03:00
korei999 2e2c61565a add xwayland-handle-minimize patch 2024-03-21 23:30:08 +02:00
wochap dbfbf788a0 fix https://discord.com/channels/792077480227110922/792077928728494131/1219337522073702490 2024-03-18 22:51:06 +00:00
sewn 925e2d643f bar: add barpadding 2024-03-19 00:20:10 +03:00
sewn 6a8cc7ecad bar: update 2024-03-18 2024-03-18 20:19:25 +03:00
Gavin M 4412927fe9 Updated tab/tab.patch, fixed floating window labels 2024-03-18 01:36:46 +00:00
Gavin M cc70bf6524 Add limitnmaster patch 2024-03-16 12:11:44 +00:00
Gavin M aa41569ab6 Added togglekblayoutandoptions patch 2024-03-16 12:11:10 +00:00
Gavin M 4c6fbd79d7 added tab patch 2024-03-15 16:43:41 -05:00
choc 65aaf50aa5 update ipc 2024-03-13 21:48:59 +08:00
Marcin Pachur 9f4d94e106 Remove screenshots
Signed-off-by: Marcin Pachur <pm4rcin@noreply.codeberg.org>
2024-03-13 04:22:16 +00:00
Marcin Pachur 179f38e8de Remove pointerconstraints patches
Signed-off-by: Marcin Pachur <pm4rcin@noreply.codeberg.org>
2024-03-13 04:22:16 +00:00
A Frederick Christensen 1430751ccb Update simple-touch-input.patch since pointer constraints merge 2024-03-12 23:07:44 -05:00
wochap 42c3bf1a03 add relative-mouse-resize patch
allow you to resize from each corner
2024-03-11 22:26:51 +00:00
wochap aa3c82446c add minimalborders patch
it merge adjacent borders
2024-03-11 22:26:51 +00:00
wochap 5d66670ac3 add borders patch
this patch adds 2 borders to each side (top,bottom,left,right)
2024-03-11 22:26:51 +00:00
wochap 16fed77bc9 reintroduce togglekblayout 2024-03-11 22:26:51 +00:00
wochap 2246fbb99b remove swapandfocusdir from stale folder
export swapandfocusdir with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 3fa6690f27 remvoe regexrules from stale folder
export regexrules patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 630e658acd remove pointer-gestures-unstable-v1 from stale folder
export pointer-gestures-unstable-v1 with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap caca5ee090 reintroduce pertag 2024-03-11 22:26:51 +00:00
wochap 9dafc49450 reintroduce namedscratchpads 2024-03-11 22:26:51 +00:00
wochap 27e3b52483 reintroduce movestack 2024-03-11 22:26:51 +00:00
wochap 4f2fdb76a9 remove moveresizekb from stale folder
export moveresize patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 4ac31e8fbe reintroduce movecenter 2024-03-11 22:26:51 +00:00
wochap a11d028c42 remove modes patch from stale folder
re export modes patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap a99f3012da remove lockedkeys from stale folder
re export lockedkeys with `git format-path`
2024-03-11 22:26:51 +00:00
wochap ecaa3ea2da remove gesture from stale folder
re export patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 9a349e1f6d reintroduce customfloat 2024-03-11 22:26:51 +00:00
wochap 300a0eed96 reintroduce cursortheme 2024-03-11 22:26:51 +00:00
wochap 587104be92 reintroduce centeredmaster 2024-03-11 22:26:51 +00:00
wochap fdb1e6760a reintroduce bottomstack 2024-03-11 22:26:51 +00:00
wochap ac2ddd312a reintroduce lockedkeys 2024-03-11 22:26:51 +00:00
wochap a6e6e63cfa reintroduce modes patch 2024-03-11 22:26:51 +00:00
wochap a5044494b0 reintroduce moveresizekb patch 2024-03-11 22:26:51 +00:00
wochap ea2f5ee3e4 reintroduce swapandfocusdir patch 2024-03-11 22:26:51 +00:00
wochap 9a5f4cd294 reintroduce regexrules patch 2024-03-11 22:26:51 +00:00
wochap 83f381cd10 reintroduce gestures patch 2024-03-11 22:26:51 +00:00
wochap 0eae875e3f reintroduce pointer-gestures-unstable-v1 patch 2024-03-11 22:26:51 +00:00
Guido Cella b20dcd2800 update unclutter 2024-03-11 18:55:39 +01:00
Guido Cella 403548b562 update unclutter 2024-03-11 18:48:08 +01:00
Guido Cella 99df63c75e update switchtotag 2024-03-11 18:45:48 +01:00
sewn f00b6c944d update bar patch 2024-03-01 18:47:45 +03:00
Palanix e57563ea71 Update monfig 2024-02-26 19:27:43 +01:00
sewn 82a3d12bd8 introduce bar patch 2024-02-20 21:27:30 +03:00
choc 5a2b05dc5d ipc: integer comparison expression fixed
Co-authored-by: @snuk <slackernetuk@gmail.com>
2024-02-20 22:36:04 +08:00
Palanix deb5c2b793 Update monfig 2024-02-19 17:33:14 +01:00
choc a829f6da81 remove virtualpointer patch
already implemented in base dwl since commit ac6074f
2024-02-19 22:36:23 +08:00
choc 6fbb0cf30e Reintroduce ipc patch 2024-02-19 22:36:13 +08:00
Palanix 84d28404c2 Reintroduce monfig patch 2024-02-16 23:43:55 +01:00
Palanix ef9a89f7a3 Update dragmfact 2024-02-16 23:29:23 +01:00
Palanix d30d411ecd Reintroduce dragmfact 2024-02-16 23:24:31 +01:00
Palanix f2b54ac379 Reintroduce zoomswap 2024-02-15 19:06:19 +01:00
Palanix 7f79fd831f Update cfact patch 2024-02-15 18:19:24 +01:00
sewn aa13a3190b re-introduce regions patch 2024-02-14 22:09:35 +03:00
Abanoub 26aedf8e99 Add define-modkey-with-make-argument patch 2024-02-13 23:07:42 +00:00
ldev 2ce58c6ca7 focusdir fix whitespace was edited above the focusdir function 2024-02-12 21:54:23 +01:00
Dima Krasner b1b8409147 update dimkr patches 2024-02-11 09:10:28 +02:00
Micah N Gorrell 20374e1f94 Add less-simple-touch-input 2024-02-10 19:40:59 +00:00
korei999 e61e29a006 Delete _STALE_PATCHES/rotatetags.md 2024-02-10 15:05:25 +00:00
Guido Cella e8ff67c6c0 update unclutter 2024-02-09 14:58:59 +01:00
Guido Cella 1e1ad97943 remove upstreamed toggle-layout-immediately 2024-02-07 07:17:23 +01:00
Guido Cella 541fa20344 update alwayscenter and center-terminal 2024-02-06 09:21:22 +01:00
Guido Cella 713487ebcd update unclutter 2024-02-05 13:28:05 +01:00
Palanix d9658f10e1 Reintroduce cfacts patch 2024-01-27 23:03:51 +00:00
Guido Cella e7e6a83e3a update shiftview 2024-01-27 22:45:46 +01:00
A Frederick Christensen d898e7e50f Update simple-touch-input patch 2024-01-25 19:21:21 -06:00
Guido Cella db78ce728d update unclutter
Make it compatible with the newly merged virtual pointer protocol.
2024-01-25 19:19:51 +01:00
ldev bc89ad64bb update patch 2024-01-23 11:44:06 +00:00
ldev 53f2d37ec5 fixed: patch file wasn't in the right directory 2024-01-23 11:44:06 +00:00
ldev 9efb29925b added focusdir patch 2024-01-23 11:44:06 +00:00
korei999 00e381e802 add rotatetags patch 2024-01-23 11:37:11 +00:00
korei999 a9242e781d add rotatetags 2024-01-23 11:37:11 +00:00
ForzCross 31119dba18 revive kblayout 2024-01-21 16:32:41 +03:00
Guido Cella 3d9d172866 update shiftview
Fix a warning.
2024-01-17 21:18:22 +01:00
Ben Collerson 303f152329 update chainkeys patch 2024-01-17 11:33:58 +10:00
Guido Cella bc201acb5f update my patches 2024-01-16 19:11:34 +01:00
A Frederick Christensen 019c96b0c3 Add simple-touch-input 2024-01-14 11:18:58 -06:00
A Frederick Christensen 283746d524 naturalscrolltrackpad updated, removed from _STALE_PATCHES 2024-01-14 09:50:49 -06:00
ForzCross 07659e6084 Add en-keycodes 2024-01-11 20:32:41 +03:00
A Frederick Christensen 444fa60bef remove old en-keycodes patch 2024-01-10 14:04:53 -06:00
Dhruva Sambrani fc19168621 revive gaplessgrid 2024-01-08 16:17:38 +01:00
Dhruva Sambrani 6d731299e0 update skipfocus 2024-01-08 15:41:58 +01:00
Dhruva Sambrani 596cc2fb95 update dhruva_sambrani patches 2024-01-08 15:18:22 +01:00
neuromagus ba164236d6 added naturalscrolltrackpad patch 2024-01-07 06:08:56 +03:00
Ben Collerson 4f7be3e33e add simpleborders 2024-01-07 11:26:39 +10:00
Dhruva Sambrani 708f71484b rename skipfocus name 2024-01-06 15:50:59 +01:00
Dhruva Sambrani 0c1f06fe6f Merge branch 'main' of https://codeberg.org/dwl/dwl-patches 2024-01-06 15:48:24 +01:00
Dhruva Sambrani 86ca8b3ebd fix skipfocus patch Rule order 2024-01-06 15:48:17 +01:00
Ben Collerson 104e1fa8f0 add viewnextocctag patch 2024-01-06 22:47:04 +10:00
Ben Collerson a0ddd5486d add singlemaster patch 2024-01-06 22:26:46 +10:00
Dhruva Sambrani d85555f7b9 add skipfocus 2024-01-06 00:44:24 +01:00
Ben Collerson cdd5005f0a singletagset was missing VISIBLEON fix 2024-01-05 11:01:46 +10:00
A Frederick Christensen d860f90bcf Update README.md 2024-01-02 17:00:26 +00:00
A Frederick Christensen 694083b6d1 "Reporting Issues" segment added 2024-01-02 16:08:51 +00:00
A Frederick Christensen d1189c91ef Update README.md 2024-01-02 15:41:02 +00:00
Ben Collerson 896710da17 layout fix for titleurgent patch 2024-01-03 00:23:13 +10:00
Ben Collerson 8ee7ec27a1 add unclutter patch 2024-01-02 23:39:59 +10:00
Ben Collerson 8685039c10 add titleurgent patch 2024-01-02 22:36:52 +10:00
Ben Collerson 7ed530c5f7 remove updated stale patches 2024-01-02 22:19:09 +10:00
Ben Collerson 46313a8745 add column patch 2024-01-02 21:59:06 +10:00
Ben Collerson 9ae7acbecd add singletagset patch 2024-01-02 21:38:53 +10:00
Ben Collerson cde0fa7993 add chainkeys patch 2024-01-02 21:21:19 +10:00
A Frederick Christensen a07d0adb8b Patches.md page erroneously copied from dwl/dwl 2024-01-02 01:17:04 -06:00
A Frederick Christensen 29848bc99a Move stale patches in from dwl/dwl 2024-01-02 00:59:59 -06:00
A Frederick Christensen 0c2e7427d9 Move en-keycodes.patch from dwl/dwl.wiki 2024-01-02 00:35:38 -06:00
A Frederick Christensen c7d4497905 Move dimkr patches from dwl/dwl.wiki 2024-01-01 23:40:54 -06:00
A Frederick Christensen 3604232b55 Move dhruva_sambrani patches in from dwl/dwl wiki 2024-01-01 22:58:13 -06:00
Leonardo Hernández Hernández 1185e3e026 add client-opacity (adbc47f) 2024-01-01 15:09:24 -06:00
A Frederick Christensen e3a0afb1b4 Update README.md 2024-01-01 07:30:01 +00:00
A Frederick Christensen bf055d8eb6 Update README.md 2024-01-01 07:24:43 +00:00
A Frederick Christensen 8816654a75 Update README.md 2024-01-01 05:34:19 +00:00
choc a214c8e798 add swallow patch 2024-01-01 09:13:47 +08:00
A Frederick Christensen 1c0f2e12dc Update README.md 2023-12-31 23:39:34 +00:00
A Frederick Christensen 0594755d4c Update README.md 2023-12-31 23:25:39 +00:00
Leonardo Hernández Hernández 7fda823649 separate author and branch 2023-12-31 15:46:00 -06:00
Leonardo Hernández Hernández c9571999ca suggest upstream instead of codeberg-dwl 2023-12-31 15:37:10 -06:00
Leonardo Hernández Hernández c512f6c55f simplify links 2023-12-31 15:37:10 -06:00
A Frederick Christensen 907fd82db2 Update README.md 2023-12-31 20:54:21 +00:00
A Frederick Christensen 1bebfa4fb9 Update README.md 2023-12-31 20:29:19 +00:00
A Frederick Christensen 4d23ba308f Update README.md 2023-12-31 20:13:54 +00:00
Leonardo Hernández Hernández 390ac6663a update numlock/capslock
f876192

no one noticed, right?
2023-12-29 02:27:16 +00:00
Leonardo Hernández Hernández a069d6b078 update vanitygaps patch
4ef9eed

no one noticed, right?
2023-12-29 02:23:19 +00:00
Leonardo Hernández Hernández d734ddc91f update smartborders patch
c7120b6

no one noticed, right?
2023-12-29 02:23:19 +00:00
Leonardo Hernández Hernández f8d999990a update master-right patch
4693a27

no one noticed, right?
2023-12-29 02:23:19 +00:00
Leonardo Hernández Hernández 7f5e626ded update keycodes patch
9d24eaa

no one noticed, right?
2023-12-29 02:23:19 +00:00
Leonardo Hernández Hernández 9a34bfb7ea update hide-behind-monocle patch
1ba8580

no one noticed, right?
2023-12-29 02:23:18 +00:00
Leonardo Hernández Hernández dc5b4743ba update hide-behind-fullscreen patch
da92f84

no one noticed, right?
2023-12-29 02:23:18 +00:00
Leonardo Hernández Hernández 46c3c99d90 update coredump patch
38bf347

no one noticed, right?
2023-12-29 02:23:18 +00:00
Leonardo Hernández Hernández e31a8f677e update autostart patch
51d56a4

no one noticed, right?
2023-12-29 02:23:18 +00:00
A Frederick Christensen 6ab3eb59e3 Update README.md 2023-12-27 12:35:00 +00:00
A Frederick Christensen 7311907859 Update README.md 2023-12-27 04:49:33 +00:00
A Frederick Christensen f616c9f1b7 Update README.md 2023-12-27 04:33:06 +00:00
A Frederick Christensen 1f97ea8f11 Update README.md 2023-12-27 04:24:30 +00:00
A Frederick Christensen 5612dfc27a Update README.md 2023-12-27 03:45:32 +00:00
A Frederick Christensen 64f8ec3f36 Update README.md 2023-12-27 03:43:57 +00:00
Leonardo Hernández Hernández 05ae24aeaf add vanitygaps patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández eb3d0d48bd add smartborders patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 5e6e11e142 add numlock-capslock patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 678e3d01c9 add master-right patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 28ad880bde add keycodes patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández b405cc06d7 add hide-behind-monocle patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández e2990c338b add hide-behind-fullscreen patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 303cc53294 add coredump patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 1946640804 add autostart patch
c2e6583
2023-12-26 16:09:27 -06:00
Leonardo Hernández Hernández 6e1ef071b0 first commit 2023-12-15 23:40:47 -06:00
472 changed files with 5873 additions and 45478 deletions
-692
View File
@@ -1,692 +0,0 @@
dwl - dwm for Wayland
Copyright © 2020 dwl team
See also the files LICENSE.tinywl, LICENSE.dwm and LICENSE.sway.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
----
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-39
View File
@@ -1,39 +0,0 @@
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.
-19
View File
@@ -1,19 +0,0 @@
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
View File
@@ -1,127 +0,0 @@
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.
+4 -87
View File
@@ -1,88 +1,5 @@
# dwl-patches
* A general [dwl wiki](https://codeberg.org/dwl/dwl/wiki) is available at the main [dwl] repository.
* This repository is exclusively for dwl PATCHES.
## Welcome to [dwl-patches](https://codeberg.org/dwl/dwl-patches)!
The dwl project is available at [https://codeberg.org/dwl/dwl](https://codeberg.org/dwl/dwl).
This repository and the associated wiki is exclusively for dwl PATCHES.
*Note: All patches are user-submitted content. The authors of dwl do not continually monitor them. You are responsible for downloading and reviewing a patch before using it!*
## Reporting Issues
- Issues with existing patches can be generated here in the dwl-patches [issues]. Please be sure to "@" reference the patch author in your issue.
## Contributing Patches to `dwl-patches`
Since dwl follows [suckless](https://suckless.org/) philosophy, it doesn't provide every feature under the sun. To broaden dwl's functionality, one needs to get familiar with the concept of patching. To get your feet wet, consult [the hacking page](https://suckless.org/hacking/) of the suckless website.
Patches should normally target the latest dwl [release].
If you target an older release, specify that in the `Download` link on your `README.md` page.
If you target the unstable `main` branch, specify that in the `Download` link on your `README.md` page.
0. Starting from a local clone of [dwl] (not dwl-patches)
1. If you do not have it already, add the remote for the main dwl repository in your local copy and fetch it:
`git remote add --fetch upstream https://codeberg.org/dwl/dwl`
2. Use git to create a branch for your new patch and hack away creating your patched version of [dwl].
3. In your local clone of dwl, create a .patch file
`git format-patch upstream/main...<branch-name> --stdout > PATCHNAME.patch`
4. Now fork [dwl-patches] (not dwl) in Codeberg and clone it locally
5. Configure your `dwl-patches` local clone
`git config --local pull.rebase true`
6. In your local `dwl-patches` clone, add a directory called `patches/PATCHNAME`. Place the `PATCHNAME.patch` you created in step (2) into the `patches/PATCHNAME` directory.
7. Add a `README.md` page to the `PATCHNAME` directory using this template (add/remove sections as you like):
```markdown
### Description
Insert a short summary of changes that your patch implements.
### Download
- [git branch](/USERNAME/dwl/src/branch/PATCHNAME)
^^^^^^^^^^ OPTIONAL: Patchers are no longer obligated to maintain public `dwl` branches devoted to their patches
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/PATCHNAME/PATCHNAME.patch)
Use the ^RAW^ patch link here
^^^ "0.7" is an example. Use the release that your patch targets
- [main YYYY-MM-DD](/dwl/dwl-patches/raw/branch/main/patches/PATCHNAME/PATCHNAME.patch)
^^^^^^^^^^ Patches targeting the unstable "main" branch include a YYYY-MM-DD indicator
### Authors - latest at top
- [YOUR_NICK](https://codeberg.org/USERNAME)
^^^^^^^^^ Codeberg nick is mandatory; other contact methods optional
your_email@if_you_wish_to.share.it
your_irc_nick at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl)
your_discord_handle at [dwl Discord](https://discord.gg/jJxZnrGPWN)
```
You may choose to include screenshots (hosted in your patch's subdirectory) in your `README.md`. The process is described [here](https://docs.codeberg.org/markdown/using-images/).
8. Use the Codeberg web interface to send a pull request to [dwl-patches] (NOT to [dwl])
9. WHEN YOUR PULL REQUEST IS APPROVED, your Codeberg account will also be granted commit access to [dwl-patches]. Once you have write access, you can make direct modifications/updates to your patches and you are free to create new patches rather than creating pull requests.
Individuals who have made known that they no longer intend to maintain their patches will have commit access to the [dwl-patches] repository removed.
A returning user who formerly had commit access is welcome to open an issue on [dwl-patches] requesting commit access be reinstated. When doing so, please link to the original issue opened that granted commit access.
## Updating/Modifying/Adopting Existing Patches
- If the existing patch is already being maintained by another author, do not make modifications to it.
- Create an issue at [issues] @mentioning the current maintainer.
- If you receive no reply for seven days, you may assume the patch abandoned and you may adopt the patch.
- Modify the `README.md` with new links for your raw patch and for your git branch.
- **LEAVE PREVIOUS AUTHOR(S)' NICKS/LINKS INTACT UNDER THE "Authors" HEADING!**
- Add your own nick/link to the top of the "Authors" list.
## Deprecating Existing Patches
- Patches will not be removed from this archive but may instead be deprecated if the author(s)/maintainer(s) of a patch so desire.
- Please do not open issues or contact maintainers to request deprecation of a patch.
- Deprecation of a patch will only occur if *all* authors or current maintainers of the patch agree to the decision to deprecate.
- In such a circumstance the author(s)/maintainer(s):
- Will create a commit moving the patch to the `stale-patches` directory
- May explain in the associated `README.md` any relevant details of the decision to deprecate the patch.
- This process allows current or future users of the patch the option to adopt, modify, or integrate stale/historical code or portions thereof.
## stale-patches
Deprecated or unmaintained patches are held in the [stale-patches] directory.
Currently, this directory also contains `.md` description files from ancient patches predating the move to Codeberg.
If you have the inclination to revive one of these, please follow the same procedures outlined below for contributing new patches.
In your initial pull request (or in the commit that revives the stale patch if you already have write access), remove the corresponding `.md` file or the patch directory from [stale-patches].
[stale-patches]: https://codeberg.org/dwl/dwl-patches/src/branch/main/stale-patches
[dwl]: https://codeberg.org/dwl/dwl
[dwl-patches]: https://codeberg.org/dwl/dwl-patches
[issues]: https://codeberg.org/dwl/dwl-patches/issues
[release]: https://codeberg.org/dwl/dwl/releases
[Codeberg]: https://codeberg.org
##
Please see the dwl-patches [wiki](https://codeberg.org/dwl/dwl-patches/wiki) for patch descriptions and for [instructions](https://codeberg.org/dwl/dwl-patches/wiki/instructions) on contributing/updating/reporting issues.
+8
View File
@@ -0,0 +1,8 @@
### Description
This implements the DRM lease protocol, which is needed to use devices such as VR headsets.
### Download
- [2023-05-26](https://github.com/djpohly/dwl/compare/main...minego:drm_lease_patch.patch)
### Authors
- [Micah N Gorrell](https://github.com/minego)
+10
View File
@@ -0,0 +1,10 @@
### Description
Utilizing the [/usr/include/X11/XF86keysym.h](https://cgit.freedesktop.org/xorg/proto/x11proto/tree/XF86keysym.h) header file to change the volume via the appropriate keys.
### Download
- [2023-10-15](https://github.com/djpohly/dwl/compare/main...nakibrayan3:dwl:update-XF86keysym-patch.patch)
- [2021-05-06](https://github.com/djpohly/dwl/compare/main...917Wolf:vol.patch)
### Authors
- [917Wolf](https://github.com/917Wolf)
- [Rayan Nakib](https://nakibrayan2.pages.dev)
+8
View File
@@ -0,0 +1,8 @@
### Description
Adds configurable transparency for focused and unfocused windows.
### Download
- [2021-12-03](https://github.com/djpohly/dwl/compare/main...juliag2:alphafocus.patch)
### Authors
- [Julia](https://github.com/juliag2)
+8
View File
@@ -0,0 +1,8 @@
### Description
Newly created windows are placed above the currently selected window in the stack.
### Download
- [2021-01-16](https://github.com/djpohly/dwl/compare/main...ss7m:attachabove.patch)
### Authors
- [sam-barr](https://github.com/ss7m)
+9
View File
@@ -0,0 +1,9 @@
### Description
Newly created windows are placed at the bottom of the client tile stack.
### Download
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-attachbottom.patch)
- [2021-10-05](https://github.com/djpohly/dwl/compare/main...AurelWeinhold:attachbottom.patch)
### Authors
- [Aurel Weinhold](https://github.com/AurelWeinhold)
@@ -1,4 +1,5 @@
### Description
This is a port of attachtop patch for dwm: https://dwm.suckless.org/patches/attachtop
New client attaches below the last master/on top of the stack.
@@ -6,8 +7,7 @@ New client attaches below the last master/on top of the stack.
Behavior feels very intuitive as it doesn't disrupt existing masters no matter the amount of them, it only pushes the clients in stack down.
### Download
- [git branch](https://codeberg.org/nikitaivanov/dwl/src/branch/attachtop)
- [2025-06-16](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/attachtop/attachtop.patch)
- [2023-07-15](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:attachtop.patch)
### Authors
- [Nikita Ivanov](https://codeberg.org/nikitaivanov)
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
+40
View File
@@ -0,0 +1,40 @@
### Description
Adds keybindings for screen rotation and auto rotation from an accelerometer.
### Setup
Find an accelerometer device in sysfs (`cat /sys/bus/iio/devices/iio*/name`,
or using a script: [monitor-iio.sh](https://github.com/Unprex/dotfiles/blob/main/scripts/monitor-iio.sh)) \
Find the raw output file of the accelerometer
(e.g. `cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw` should output an integer). \
Add the raw output file names to the dwl configuration **accel_\***.
Add a udev rule to uniquely identify the device, for example:
```
sudo echo 'SUBSYSTEM=="iio", KERNEL=="iio*", ATTR{name}=="accel_3d", GROUP="input", SYMLINK+="input/accel"' >> /etc/udev/rules.d/99-accel.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
```
(the device is probably already in /dev/ e.g. `/dev/iio:device0` but on my computer the number changes after a reboot)
A symlink to the device should now be available in `/dev/input/` and accessible to input group members. \
Add the device path to the dwl configuration **accel_path**.
### Config
* `rotation_enabled`: If the auto rotation is enabled on startup.
* `rotation_delay`: How often to check the accelerometer values in milliseconds.
* `rotation_flat`: Threshold on the normalized Z axis to consider the device flat and stop the auto rotation.
* `rotation_thresh`: Rotation threshold after which the screen flips (values less than 0.5 will cause a back and forth).
+ `accel_path`: The path to the accelerometer device file (e.g. "/dev/input/accel").
+ `accel_x`: The name of the sysfs file for the accelerometer x axis.
+ `accel_y`: The name of the sysfs file for the accelerometer y axis.
+ `accel_z`: The name of the sysfs file for the accelerometer z axis.
Default keybindings:
* `<Modkey>` + `<Shift>` + `<Arrows>`: Change the screen rotation manually (doesn't disable the auto rotation).
* `<Modkey>` + `<Shift>` + `<R>`: Enable/disable the auto rotation.
### Download
- [2022-10-25](https://github.com/djpohly/dwl/compare/main...Unprex:rotation.patch)
### Authors
- [Unprex](https://github.com/Unprex)
+10
View File
@@ -0,0 +1,10 @@
### Description
Adds a rule to automatically center clients on the current monitor.
### Download
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-center.patch)
- [v0.4-r1](https://github.com/djpohly/dwl/compare/main...dm1tz:04rc1-iscenter.patch)
- [2022-08-27](https://github.com/djpohly/dwl/compare/main...dm1tz:iscenter.patch)
### Authors
- [Dmitry Zakharchenko](https://github.com/dm1tz)
+27
View File
@@ -0,0 +1,27 @@
### Description
Store your clipboard history using `clipman` clipboard manager without your KeePassXC passwords leaking into clipman.
Ensure these dependencies are installed (instructions for debian, other distros are left as an exercise...):
apt install clipman libmodern-perl-perl moreutils wl-clipboard
Change your command to launch `dwl` to something like the following:
dwl -s 'pee somebar dwl-getwindowtitle'
Ensure the following command is running in the background of your `dwl` session. Put it whereever your auto-started stuff is.
exec wl-paste -t text --watch dwl-clipman
This solution is based on the following reddit post, modified to support `dwl`. https://www.reddit.com/r/swaywm/comments/ljl0dh/keeping_secrets_secret_with_keepassxc_clipman_and/
Feel free to use this code however you want, but I can't guarantee it will work for what you are trying to do. Licenced under the same license as `dwl`, "WITHOUT WARRANTY OF ANY KIND".
### Download
- [2022-12-21](https://github.com/djpohly/dwl/compare/main...bencollerson:clipboard-manager.patch)
- [2022-12-01](https://github.com/djpohly/dwl/compare/main...bencollerson:94d0a21.patch)
### Authors
- [Ben Collerson](https://github.com/bencollerson)
+8
View File
@@ -0,0 +1,8 @@
### Description
Adds clipboard functionality. Requires the [ipc](https://github.com/djpohly/dwl/wiki/ipc) patch for dwl and `wl-clipboard` to be installed. By default, requires [clipman](https://github.com/yory8/clipman) for the clipboard and [dwl-state](https://github.com/MadcowOG/dwl-state) for getting the appid of the focused application, but you can change these in the script if you have alternatives. You may change which applications to not record by modifying the `excludes` array in `dwl-cliboard-watcher`. Make sure `wl-paste -t text -w dwl-clipboard-watcher` is running after dwl.
### Downloads
- [2023-3-01](https://github.com/djpohly/dwl/compare/main...MadcowOG:ipc-clipboard.patch)
### Authors
- [MadcowOG](https://github.com/MadcowOG)
+8
View File
@@ -0,0 +1,8 @@
### Description
When focus is changed, warp the cursor the the center of the new focused client (if it wasn't already within the client's geometry).
### Download
- [2022-05-26](https://github.com/djpohly/dwl/compare/main...faerryn:cursor_warp.patch)
### Authors
- [Faerryn](https://github.com/faerryn)
+9
View File
@@ -0,0 +1,9 @@
### Description
Adds function to cycle through available layouts.
### Download
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-cyclelayouts.patch)
- [2021-07-27](https://github.com/djpohly/dwl/compare/main...vnepogodin:cyclelayouts.patch)
### Authors
- [Vladislav Nepogodin](https://github.com/vnepogodin)
+35
View File
@@ -0,0 +1,35 @@
### Description
[deck](https://dwm.suckless.org/patches/deck/) is a port of the dwm-layout with the same name. It applies the monocle-layout to the clients in the stack. The master-client is still visible. The stacked clients are like a deck of cards, hence the name.
### Scheme
```
Showcase
Tile :
+-----------------+--------+
| | |
| | S1 |
| | |
| M +--------+
| | |
| | S2 |
| | |
+-----------------+--------+
Deck :
+-----------------+--------+
| | |
| | |
| | |
| M | S1 |
| | |
| | |
| | |
+-----------------+--------+
```
### Download
- [2023-07-09](https://github.com/djpohly/dwl/compare/main...PalanixYT:deck.patch)
### Authors
- [Palanix](https://github.com/PalanixYT)
+27
View File
@@ -0,0 +1,27 @@
### Description
Arranges windows in a Fibonacci spiral or dwindle.
### Scheme
```
+-----------+-----------+ +-----------+-----------+
| | | | | |
| | 2 | | | 2 |
| | | | | |
| 1 +--+--+-----+ | 1 +-----+-----+
| | 5|-.| | | | | 4 |
| +--+--+ 3 | | | 3 +--+--+
| | 4 | | | | | 5|-.|
+-----------+-----+-----+ +-----------+-----+-----+
spiral dwindle
```
### Download
- [2023-06-21](https://github.com/djpohly/dwl/compare/main...Abanoub8:fibonacci.patch)
- [2022-09-22](http://0x0.st/oVlu.patch)
- [2021-05-06](https://github.com/djpohly/dwl/compare/main...917Wolf:fib.patch)
### Authors
- [Abanoub8](https://github.com/Abanoub8)
- [medanisjbara](https://github.com/medanisjbara)
- [917Wolf](https://github.com/917Wolf)
- Niki Yoshiuchi
+8
View File
@@ -0,0 +1,8 @@
### Description
Floating clients have their own border color.
### Download
- [2022-03-26](https://github.com/djpohly/dwl/compare/main...PalanixYT:float_border_color.patch)
### Authors
- [Palanix](https://github.com/PalanixYT)
+7
View File
@@ -0,0 +1,7 @@
### Description
Implements `focusmon()` function that moves the cursor to the focused monitor.
### Download
- [2020-10-15](https://github.com/djpohly/dwl/compare/main...Stivvo:focusMonPointer.patch)
### Authors
- [Stivvo](https://github.com/Stivvo)
+8
View File
@@ -0,0 +1,8 @@
### Description
Focus the window left, right, above or below the current focused window
### Download
- [2023-19-15](https://github.com/djpohly/dwl/compare/main...XGames123:focusdir.patch)
### Authors
- [ldev](https://github.com/Xgames123)
+9
View File
@@ -0,0 +1,9 @@
### Description
Focus the master regardless of the current focus.
### Download
- [2022-09-02](https://github.com/djpohly/dwl/compare/main...dm1tz:fmaster.patch)
- [2022-08-18](https://github.com/djpohly/dwl/compare/main...PalanixYT:focusmaster.patch)
### Authors
- [Palanix](https://github.com/PalanixYT)
+25
View File
@@ -0,0 +1,25 @@
### Description
This patch is a modified version of [vanitygaps][vanitygaps] that adds gaps around clients regardless of a layout.
It means you can apply any layout patch and the gaps will be shown properly as long as the layout does not add any gaps on its own.
This works by allowing a layout to place clients normally without gaps,
and then correcting positions and dimensions of clients afterwards to add gaps around them.
To make it work, I had to modify `resize()` function,
and, as a side effect, this change fixed some flickering I experienced when using [snail][snail] layout.
[snail]: https://github.com/djpohly/dwl/wiki/snail
[vanitygaps]: https://github.com/djpohly/dwl/wiki/vanitygaps
### Changelog
2023-11-24:
- Refactor, it does exactly the same, just using less code.
- Replace `gappih`, `gappiv`, `gappoh` and `gappov` with only `gappx`. They don't do anything anyways.
### Download
- [2023-11-24](https://github.com/djpohly/dwl/compare/main...wochap:genericgaps.patch)
- [2023-05-20](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:genericgaps.patch) generic gaps
- [2023-05-20](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:genericgaps-rule.patch) generic gaps + monitor rule to enable gaps on certain monitors by default
### Authors
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
+10
View File
@@ -0,0 +1,10 @@
### Description
Arranges windows in a grid of equal sizes.
### Download
- [2023-06-21](https://github.com/djpohly/dwl/compare/main...Abanoub8:gridmode.patch)
- [2021-07-24](https://github.com/djpohly/dwl/compare/main...vnepogodin:gridmode.patch)
### Authors
- [Vladislav Nepogodin](https://github.com/vnepogodin)
- [Abanoub8](https://github.com/Abanoub8)
+9
View File
@@ -0,0 +1,9 @@
### Description
Hide the cursor when typing
### Download
- [2023-10-25](https://github.com/djpohly/dwl/compare/main...apprehensions:hidecursor.patch)
- [2023-02-19](https://github.com/djpohly/dwl/compare/main...PalanixYT:type_hide.patch)
### Authors
- [Palanix](https://github.com/PalanixYT)
+15
View File
@@ -0,0 +1,15 @@
### Description
Allow for keyboard rules to be used; This allows for keyboard-specific options or layouts.
The keyboard's names can be retrieved from `libinput list-devices | grep Device`, example:
```c
static const KeyboardRule kbrules[] = {
{ "AT Translated Set 2 keyboard", { .options = "altwin:swap_alt_win,caps:swapescape" } },
};
```
### Download
- [2023-09-20](https://github.com/djpohly/dwl/compare/main...apprehensions:dwl:kbrules.patch)
### Authors
- [sewn](https://github.com/apprehensions)
@@ -2,10 +2,7 @@
Allows clients to use the keyboard-shortcuts-inhibit protocol to block the compositor from using keybinds. This is useful for virtualization software like looking-glass which requires this protocol to run.
### Download
- [git branch](https://codeberg.org/Rutherther/dwl/src/branch/patch/keyboard-shortcuts-inhibit)
- [2024-05-10](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/keyboardshortcutsinhibit/keyboardshortcutsinhibit.patch)
- [2023-05-01](https://github.com/djpohly/dwl/compare/main...madcowog:keyboard-shortcuts-inhibit.patch)
### Authors
- [Rutherther](https://codeberg.org/Rutherther)
- [MadcowOG](https://github.com/MadcowOG)
+44
View File
@@ -0,0 +1,44 @@
### Description
This patch implements sequences for chained keybindings (like the dwm [keychord](https://dwm.suckless.org/patches/keychord/) patch).
_Notes_:
- The maximum number of sequences is set to `5` in the `Keychord` struct for a given keybinding
- This original motivation was better support for [stumpwm](https://stumpwm.github.io/) style of keybindings, however this is not a limitation
### Example
The default values for `MODKEY` and `PREFIXKEY` can be changed in `config.def.h` and/or `config.h`.
#### emacs-like
In the example below, the `firefox` command is bound to the key sequence `alt-s alt-u f`.
```C
static const Keychord keychords[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* count key_sequences function argument */
{ 3, {{MODKEY, XKB_KEY_s}, {MODKEY, XKB_KEY_u}, {MOD_NONE, XKB_KEY_f}}, spawn, SHCMD("firefox") },
};
```
#### vim-like
In the example below, the `firefox` command is bound to the key sequence `alt-s u f`.
```C
static const Keychord keychords[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* count key_sequences function argument */
{ 3, {{MODKEY, XKB_KEY_s}, {MOD_NONE, XKB_KEY_u}, {MOD_NONE, XKB_KEY_f}}, spawn,SHCMD("firefox") },
};
```
### Download
- [2023-03-12](https://github.com/djpohly/dwl/compare/main...yveszoundi:dwl-customization:keychord-2023-03-12.patch)
- [2023-02-15](https://github.com/djpohly/dwl/compare/main...yveszoundi:dwl-customization:v0.4-keychord-2023-02-15.patch)
### Authors
- [Yves Zoundi](https://github.com/yveszoundi)
+8
View File
@@ -0,0 +1,8 @@
### Description
Print current keyboard layout to stdout
### Download
- [2022-09-10](https://github.com/djpohly/dwl/compare/main...GospodinHoroshiy:keymap.patch)
### Authors
- [Gospodin](https://github.com/GospodinHoroshiy)
+15
View File
@@ -0,0 +1,15 @@
### Description
This patch adds `menu` command, which allows dwl to interface with dmenu-like programs.
By default, two menus are available:
- focusing a window by its title by pressing `Alt+o`
- selecting a layout from a list by pressing `Alt+Shift+o`
Edit `menus` array and `MENU` macro in `config.h` to add/change menus and use a different dmenu program.
### Download
- [2023-07-15](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:menu.patch)
### Authors
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
+8
View File
@@ -0,0 +1,8 @@
### Description
This patch adds the option to let the cursor jump to the center of new clients, as well as move the cursor to the center of clients that gains focus.
### Download
- [2023-03-17](https://github.com/djpohly/dwl/compare/main...0undefined:mouse-follows-focus.patch)
### Authors
- [0undefined](https://github.com/0undefined)
+9
View File
@@ -0,0 +1,9 @@
### Description
Extend the [movestack](https://github.com/djpohly/dwl/wiki/movestack) patch to let you also focus, or move, a client to the top or bottom of the stack.
### Download
- [2023-03-12](https://github.com/djpohly/dwl/compare/main...0undefined:dwl:move-client-top.patch)
### Authors
- [0undefined](https://github.com/0undefined)
- Original movestack patch: [sam-barr](https://github.com/ss7m)
+8
View File
@@ -0,0 +1,8 @@
### Description
Prevent focus on mouseover.
### Download
- [2023-02-05](https://github.com/djpohly/dwl/compare/main...jjjt-git:nomousefocus.patch)
### Authors
- [JJJT](https://github.com/jjjt-git)
+8
View File
@@ -0,0 +1,8 @@
### Description
Only exit when no windows are open
### Download
- [2022-09-11](https://github.com/djpohly/dwl/compare/main...GospodinHoroshiy:onlyquitonempty.patch)
### Authors
- [Gospodin](https://github.com/GospodinHoroshiy)
+8
View File
@@ -0,0 +1,8 @@
### Description
Implement the output-power-management protocol. I don't know what this is used by, but here it is in case you need it.
### Download
- [2022-03-20](https://github.com/djpohly/dwl/compare/main...guidocella:output-power-management.patch)
### Authors
- [Guido Cella](https://github.com/guidocella)
+8
View File
@@ -0,0 +1,8 @@
### Description
Adds the -u option that allows users to pass a desired uid to drop to after becoming DRM master.
### Download
- [2021-09-06](https://github.com/djpohly/dwl/compare/main...DanielMowitz:privilege-drop.patch)
### Authors
- [Daniel Mowitz](https://github.com/DanielMowitz)
+8
View File
@@ -0,0 +1,8 @@
### Description
Adds functions `pushup` and `pushdown` to move windows within the tiling order.
### Download
- [2022-12-05](https://github.com/djpohly/dwl/compare/wlroots-next...djpohly:push.patch)
### Authors
- [Devin J. Pohly](https://github.com/djpohly)
+12
View File
@@ -0,0 +1,12 @@
### Description
When resizing windows, the mouse will no longer jump to the bottom
right corner and only resize from that corner. Instead, the mouse will
resize the window in the quadrant that the resize starts at. This is the
same resize behavior as Sway and is similar to the resizehere dwm patch.
### Download
- [v0.4](https://github.com/djpohly/dwl/compare/main...schance995:dwl:relative-mouse-resize.patch)
### Authors
- [schance995](https://github.com/schance995)
+23
View File
@@ -0,0 +1,23 @@
### Description
This patch allows you to restart dwl with a keybinding.
**NOTE:** that all of your applications are gonna get killed on dwl restart.
The function creates a file at **/tmp/restart_dwl** and exits dwl.
You have to modify your dwl launch script in order for this patch to work.
Example dwl launch script:
```sh
do=true
while $do || [ -f /tmp/restart_dwl ]; do
do=false
rm -rf /tmp/restart_dwl > /dev/null 2>&1
dwl
done
```
It's a do-while that checks if **/tmp/restart_dwl** exists after the first run of dwl.
If this file exists delete it and start dwl again.
### Download
- [2022-10-27](https://github.com/djpohly/dwl/compare/main...krypciak:patch-restartdwl.patch)
### Authors
- [krypciak](https://github.com/krypciak)
+8
View File
@@ -0,0 +1,8 @@
### Description
All floating windows become tiling when switching to a different layout.
### Download
- [2020-08-28](https://github.com/djpohly/dwl/compare/main...Stivvo:restoreTiling.patch)
### Authors
- [Stivvo](https://github.com/Stivvo)
+8
View File
@@ -0,0 +1,8 @@
### Description
Adds a toggleable function that makes a sticky client that is visible on all tags.
### Download
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-sticky.patch)
### Authors
- [Dmitry Zakharchenko](https://github.com/dm1tz)
+11
View File
@@ -0,0 +1,11 @@
### Description
Add a rule to clients to spawn them [sticky](sticky) on start up.
I personally use it to make [dragon](https://github.com/mwh/dragon) show up on all tags.
### Download
Apply on top of [sticky patch](sticky).
- [2023-05-27](https://github.com/dm1tz/dwl/compare/04-sticky...NikitaIvanovV:stickyrule.patch)
### Authors
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
+8
View File
@@ -0,0 +1,8 @@
### Description
Implements just enough of the `sway-ipc` protocol to facilitate status bars. Tested with `waybar` and `rootbar`.
### Download
- [2022-06-08](https://github.com/djpohly/dwl/compare/main...StratusFearMe21:main.patch)
### Authors
- [Isaac Mills](https://github.com/StratusFearMe21)
@@ -0,0 +1,8 @@
### Description
Configure a default "previous" layout for `setlayout({0})` to switch back to.
### Download
- [2020-07-28](https://github.com/djpohly/dwl/compare/main...guidocella:toggle-layout-immediately.patch)
### Authors
- [Guido Cella](https://github.com/guidocella)
+11
View File
@@ -0,0 +1,11 @@
### Description
Adds SIMPLE touchscreen functionality.<br>
Currently emulates mouse movement and button presses.<br>
### Download
- [2023-03-31](https://github.com/djpohly/dwl/compare/main...fauxmight:dwl:simple_touch_input.patch)
- [2022-10-16](https://github.com/djpohly/dwl/compare/main...Unprex:touch-screen.patch)
### Authors
- [fauxmight](https://github.com/fauxmight)
- [Unprex](https://github.com/Unprex)
+25
View File
@@ -0,0 +1,25 @@
### Description
A tiled layout optimized for wide vertical monitors.
### Scheme
```
|---------------------------|
| |
| |
| M |
| |
| |
|---------------------------|
| t1 |
|---------------------------|
| t2 |
|---------------------------|
| t3 |
|---------------------------|
```
### Download
- [2023-06-21](https://github.com/djpohly/dwl/compare/main...Abanoub8:vertile.patch)
- [2021-08-15](https://github.com/djpohly/dwl/compare/main...ChausseBenjamin:vertile.patch)
### Authors
- [Benjamin Chausse](https://github.com/ChausseBenjamin)
- [Abanoub8](https://github.com/Abanoub8)
+9
View File
@@ -0,0 +1,9 @@
### Description
Set cursor theme and size via `XCURSOR_THEME` and `XCURSOR_SIZE` environmental variables.
### Download
- [2023-07-18](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:xcursor.patch)
### Authors
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
+25
View File
@@ -0,0 +1,25 @@
From 95ac2fd73af8cee3ce3e556c254e60a2ca985515 Mon Sep 17 00:00:00 2001
From: Guido Cella <guido@guidocella.xyz>
Date: Tue, 16 Jan 2024 18:14:50 +0100
Subject: [PATCH] center floating windows
---
dwl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dwl.c b/dwl.c
index 95ebee8..ac077e3 100644
--- a/dwl.c
+++ b/dwl.c
@@ -453,6 +453,8 @@ applyrules(Client *c)
}
}
}
+ c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x;
+ c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y;
setmon(c, mon, newtags);
}
--
2.43.0
@@ -1,4 +1,4 @@
From 29e6a4bef02c473cc5bd04804fe508bda265077d Mon Sep 17 00:00:00 2001
From 42a66d6e06c38e913766ce625f049fdbc3dd0d12 Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Sun, 7 Apr 2024 21:10:17 +0200
Subject: [PATCH] New client are attached on top of the stack
@@ -8,7 +8,7 @@ Subject: [PATCH] New client are attached on top of the stack
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index bf763df..02e3d07 100644
index bf763df..c0a3d74 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1605,7 +1605,18 @@ mapnotify(struct wl_listener *listener, void *data)
@@ -18,7 +18,7 @@ index bf763df..02e3d07 100644
- wl_list_insert(&clients, &c->link);
+ i = 0;
+ wl_list_for_each(w, &clients, link) {
+ if (!VISIBLEON(w, selmon) || w->isfloating)
+ if (!VISIBLEON(w, selmon) || c->isfloating)
+ continue;
+ p = w;
+ if (++i >= selmon->nmaster)
@@ -32,5 +32,5 @@ index bf763df..02e3d07 100644
/* Set initial monitor, tags, floating status, and focus:
--
2.49.0
2.44.0
@@ -1,18 +1,24 @@
From d2e2e61aeb25ad71c2c559994968ba64e0974503 Mon Sep 17 00:00:00 2001
From: A Frederick Christensen <dwl@ivories.org>
Date: Fri, 27 Feb 2026 12:23:04 -0600
Subject: [PATCH] Applied autostart patch
From 51d56a433f23e13ac711b283a03c7903068febf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Sat, 8 Jul 2023 17:11:36 -0600
Subject: [PATCH] port autostart patch from dwm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://dwm.suckless.org/patches/cool_autostart/
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 6 ++++++
dwl.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 61 insertions(+), 3 deletions(-)
config.def.h | 7 +++++++
dwl.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index 8a6eda0..6eb0db4 100644
index a8ed61d..3585711 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,6 +20,12 @@ static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You ca
@@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
/* logging */
static int log_level = WLR_ERROR;
@@ -21,15 +27,16 @@ index 8a6eda0..6eb0db4 100644
+ "wbg", "/path/to/your/image", NULL,
+ NULL /* terminate */
+};
+
+
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
{ "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
/* examples:
diff --git a/dwl.c b/dwl.c
index 44f3ad9..e7b6199 100644
index 10d5a5b..bbbef2b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -246,6 +246,7 @@ static void arrange(Monitor *m);
@@ -236,6 +236,7 @@ static void arrange(Monitor *m);
static void arrangelayer(Monitor *m, struct wl_list *list,
struct wlr_box *usable_area, int exclusive);
static void arrangelayers(Monitor *m);
@@ -37,17 +44,17 @@ index 44f3ad9..e7b6199 100644
static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data);
static void chvt(const Arg *arg);
@@ -449,6 +450,9 @@ static struct wl_listener xwayland_ready = {.notify = xwaylandready};
static struct wlr_xwayland *xwayland;
#endif
@@ -403,6 +404,9 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
+static pid_t *autostart_pids;
+static size_t autostart_len;
+
/* configuration, allows nested code to access above variables */
#include "config.h"
@@ -603,6 +607,27 @@ arrangelayers(Monitor *m)
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -533,6 +537,27 @@ arrangelayers(Monitor *m)
}
}
@@ -75,13 +82,11 @@ index 44f3ad9..e7b6199 100644
void
axisnotify(struct wl_listener *listener, void *data)
{
@@ -699,12 +724,23 @@ checkidleinhibitor(struct wlr_surface *exclude)
@@ -630,11 +655,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
void
cleanup(void)
{
+ size_t i;
+
cleanuplisteners();
#ifdef XWAYLAND
wlr_xwayland_destroy(xwayland);
xwayland = NULL;
@@ -97,38 +102,46 @@ index 44f3ad9..e7b6199 100644
+ }
+
if (child_pid > 0) {
kill(-child_pid, SIGTERM);
kill(child_pid, SIGTERM);
waitpid(child_pid, NULL, 0);
@@ -1560,10 +1596,25 @@ gpureset(struct wl_listener *listener, void *data)
void
@@ -1294,18 +1329,31 @@ void
handlesig(int signo)
{
- if (signo == SIGCHLD)
if (signo == SIGCHLD) {
-#ifdef XWAYLAND
siginfo_t in;
/* wlroots expects to reap the XWayland process itself, so we
* use WNOWAIT to keep the child waitable until we know it's not
* XWayland.
*/
while (!waitid(P_ALL, 0, &in, WEXITED|WNOHANG|WNOWAIT) && in.si_pid
- && (!xwayland || in.si_pid != xwayland->server->pid))
- waitpid(in.si_pid, NULL, 0);
-#else
- while (waitpid(-1, NULL, WNOHANG) > 0);
- else if (signo == SIGINT || signo == SIGTERM)
+ if (signo == SIGCHLD) {
+ pid_t pid, *p, *lim;
+ while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
+ if (pid == child_pid)
+#ifdef XWAYLAND
+ && (!xwayland || in.si_pid != xwayland->server->pid)
#endif
+ ) {
+ pid_t *p, *lim;
+ waitpid(in.si_pid, NULL, 0);
+ if (in.si_pid == child_pid)
+ child_pid = -1;
+ if (!(p = autostart_pids))
+ continue;
+ lim = &p[autostart_len];
+
+ for (; p < lim; p++) {
+ if (*p == pid) {
+ if (*p == in.si_pid) {
+ *p = -1;
+ break;
+ }
+ }
+ }
+ } else if (signo == SIGINT || signo == SIGTERM) {
} else if (signo == SIGINT || signo == SIGTERM) {
quit(NULL);
+ }
}
void
@@ -2250,6 +2301,7 @@ run(char *startup_cmd)
@@ -1965,6 +2013,7 @@ run(char *startup_cmd)
die("startup: backend_start");
/* Now that the socket exists and the backend is started, run the startup command */
@@ -137,5 +150,5 @@ index 44f3ad9..e7b6199 100644
int piperw[2];
if (pipe(piperw) < 0)
--
2.52.0
2.43.0
+1005
View File
File diff suppressed because it is too large Load Diff
+128
View File
@@ -0,0 +1,128 @@
From 38dd71e51784ab68261d9c0479a4579d419315f1 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Sun, 14 Apr 2024 08:47:04 +0300
Subject: [PATCH] add border to bar
---
config.def.h | 3 ++-
dwl.c | 27 ++++++++++++++++-----------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/config.def.h b/config.def.h
index 0be3ad0..e5e595a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -6,7 +6,7 @@
/* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
-static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int borderpx = 1; /* border pixel of windows & bar */
static const float rootcolor[] = COLOR(0x000000ff);
static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
@@ -19,6 +19,7 @@ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"monospace:size=10"};
static const char *fontattrs = "dpi=96";
+static pixman_color_t borderbar = { 0x5555, 0x7777, 0x0000, 0xffff };
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
static pixman_color_t normbarbg = { 0x2222, 0x2222, 0x2222, 0xffff };
static pixman_color_t selbarfg = { 0xeeee, 0xeeee, 0xeeee, 0xffff };
diff --git a/dwl.c b/dwl.c
index 54273ae..3153bfd 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1344,7 +1344,8 @@ dirtomon(enum wlr_direction dir)
void
drawbar(Monitor *mon)
{
- int x, w, tw = 0;
+ int x, y = borderpx, w, tw = 0;
+ int mh, mw;
int sel;
int boxs = font->height / 9;
int boxw = font->height / 6 + 2;
@@ -1357,6 +1358,8 @@ drawbar(Monitor *mon)
if (!mon || !mon->showbar)
return;
+ mh = mon->b.height - borderpx * 2;
+ mw = mon->b.width - borderpx * 2;
stride = mon->b.width * 4;
size = stride * mon->b.height;
@@ -1367,12 +1370,14 @@ drawbar(Monitor *mon)
pix = pixman_image_create_bits(
PIXMAN_a8r8g8b8, mon->b.width, mon->b.height, buf->data, stride);
+ drwl_rect(pix, 0, 0, mon->b.width, mon->b.height, 1, &borderbar);
+
/* draw status first so it can be overdrawn by tags later */
if (mon == selmon) {
if (stext[0] == '\0')
strncpy(stext, "dwl-"VERSION, sizeof(stext));
tw = TEXTW(stext) - lrpad;
- drwl_text(pix, font, mon->b.width - tw, 0, tw, mon->b.height, 0,
+ drwl_text(pix, font, borderpx + mw - tw, y, tw, mh, 0,
stext, &normbarfg, &normbarbg);
}
@@ -1384,37 +1389,37 @@ drawbar(Monitor *mon)
urg |= c->tags;
}
c = focustop(mon);
- x = 0;
+ x = borderpx;
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
sel = mon->tagset[mon->seltags] & 1 << i;
- drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2, tags[i],
+ drwl_text(pix, font, x, y, w, mh, lrpad / 2, tags[i],
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg),
urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
if (occ & 1 << i)
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, sel,
+ drwl_rect(pix, x + boxs, y + boxs, boxw, boxw, sel,
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg));
x += w;
}
w = TEXTW(mon->ltsymbol);
- x = drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
+ x = drwl_text(pix, font, x, y, w, mh, lrpad / 2,
mon->ltsymbol, &normbarfg, &normbarbg);
- if ((w = mon->b.width - tw - x) > mon->b.height) {
+ if ((w = mw - tw - x + borderpx) > mh) {
if (c != NULL) {
- drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
+ drwl_text(pix, font, x, y, w, mh, lrpad / 2,
c ? client_get_title(c) : NULL,
mon == selmon ? &selbarfg : &normbarfg,
(mon == selmon && c) ? &selbarbg : &normbarbg);
if (c && c->isfloating)
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, 0,
+ drwl_rect(pix, x + boxs, y + boxs, boxw, boxw, 0,
mon == selmon ? &selbarfg : &normbarfg);
} else {
- drwl_rect(pix, x, 0, w, mon->b.height, 1, &normbarbg);
+ drwl_rect(pix, x, y, w, mh, 1, &normbarbg);
}
}
@@ -2664,7 +2669,7 @@ setup(void)
die("Could not load font");
lrpad = font->height;
- bh = font->height + 2;
+ bh = font->height + 2 + borderpx * 2;
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
--
2.44.0
+35
View File
@@ -0,0 +1,35 @@
From 225ce9045d0d2f101a33a61d741b466a240f30b8 Mon Sep 17 00:00:00 2001
From: oak <oak@petrifiedoak.com>
Date: Fri, 5 Apr 2024 14:29:10 +0200
Subject: [PATCH] port barheight patch from dwm
---
config.def.h | 1 +
dwl.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 8fb2d68..2a90092 100644
--- a/config.def.h
+++ b/config.def.h
@@ -17,6 +17,7 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
/* bar */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
+static const int user_bh = 0; /* 0 means that dwl will calculate bar height, >= 1 means dwl will use user_bh as bar height */
static const char *fonts[] = {"monospace:size=10"};
static const char *fontattrs = "dpi=96";
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
diff --git a/dwl.c b/dwl.c
index 056718d..4247f4c 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2745,7 +2745,7 @@ setup(void)
die("Could not load font");
lrpad = font->height;
- bh = font->height + 2;
+ bh = user_bh ? user_bh : font->height + 2;
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
+78
View File
@@ -0,0 +1,78 @@
From 7fe1a19287e1f40d90efd0c3b314c178cb27a571 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Sun, 14 Apr 2024 08:02:56 +0300
Subject: [PATCH] port barpadding patch to bar for dwl
---
config.def.h | 2 ++
dwl.c | 13 ++++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index 0be3ad0..423330b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -17,6 +17,8 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
/* bar */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
+static const int vertpad = 10; /* vertical padding of bar */
+static const int sidepad = 10; /* horizontal padding of bar */
static const char *fonts[] = {"monospace:size=10"};
static const char *fontattrs = "dpi=96";
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
diff --git a/dwl.c b/dwl.c
index 54273ae..b19d1a3 100644
--- a/dwl.c
+++ b/dwl.c
@@ -431,6 +431,7 @@ static struct wl_list mons;
static Monitor *selmon;
static struct fcft_font *font;
+static int vp, sp;
static int bh;
static int lrpad;
static char stext[256];
@@ -569,8 +570,8 @@ arrangelayers(Monitor *m)
return;
if (m->showbar) {
- usable_area.height -= m->b.height;
- usable_area.y += topbar ? m->b.height : 0;
+ usable_area.height = usable_area.height - vertpad - m->b.height;
+ usable_area.y = topbar ? usable_area.y + m->b.height + vp : usable_area.y;
}
/* Arrange exclusive surfaces from top->bottom */
@@ -1419,8 +1420,8 @@ drawbar(Monitor *mon)
}
pixman_image_unref(pix);
- wlr_scene_node_set_position(&mon->scene_buffer->node, mon->m.x,
- mon->m.y + (topbar ? 0 : mon->m.height - mon->b.height));
+ wlr_scene_node_set_position(&mon->scene_buffer->node, mon->m.x + sp,
+ mon->m.y + vp + (topbar ? 0 : mon->m.height - mon->b.height));
wlr_scene_buffer_set_buffer(mon->scene_buffer, &buf->base);
wlr_buffer_drop(&buf->base);
}
@@ -2665,6 +2666,8 @@ setup(void)
lrpad = font->height;
bh = font->height + 2;
+ sp = sidepad;
+ vp = (topbar == 1) ? vertpad : - vertpad;
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
@@ -3004,7 +3007,7 @@ updatebardims(Monitor *m)
{
int rw, rh;
wlr_output_effective_resolution(m->wlr_output, &rw, &rh);
- m->b.width = rw;
+ m->b.width = rw - 2 * sp;
m->b.height = bh;
}
--
2.44.0
@@ -1,21 +1,19 @@
From b12cfff672f0705d8259cf26b3a574faa5ca43ae Mon Sep 17 00:00:00 2001
From 18abc170273690fd3fbbdcbe88b348a0b802ba91 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Tue, 4 Jun 2024 16:02:25 -0500
Subject: [PATCH] implement borders patch
Date: Wed, 6 Mar 2024 11:45:30 -0500
Subject: [PATCH] add 2 more borders for each side
this patch adds 2 extra borders relative to the client, they don't
change the size of the client
---
client.h | 16 +++++++++++++---
config.def.h | 8 ++++++++
dwl.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 70 insertions(+), 7 deletions(-)
config.def.h | 7 +++++++
dwl.c | 41 +++++++++++++++++++++++++++++++++++++----
3 files changed, 57 insertions(+), 7 deletions(-)
diff --git a/client.h b/client.h
index 800b867..33fd579 100644
index 71c7d76..c65f3ec 100644
--- a/client.h
+++ b/client.h
@@ -325,11 +325,21 @@ client_send_close(Client *c)
@@ -309,11 +309,21 @@ client_send_close(Client *c)
}
static inline void
@@ -41,10 +39,10 @@ index 800b867..33fd579 100644
static inline void
diff --git a/config.def.h b/config.def.h
index 8847e58..2d6bbe5 100644
index db0babc..bc03d24 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,8 +7,16 @@
@@ -7,7 +7,14 @@
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */
@@ -52,20 +50,18 @@ index 8847e58..2d6bbe5 100644
+static const unsigned int borderepx = 0; /* width of the border that start from inside the windows */
+static const unsigned int borderspx_offset = 0; /* offset of the border that start from outside the windows */
+static const unsigned int borderepx_negative_offset = 0; /* offset of the border that start from inside the windows */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
+static const float borderscolor[] = COLOR(0x444444ff); /* color of the border that start from outside the windows */
+static const float borderecolor[] = COLOR(0x444444ff); /* color of the border that start from inside the windows */
+static const int border_color_type = BrdOriginal; /* borders to be colored (focuscolor, urgentcolor) */
+static const int borders_only_floating = 0;
static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
diff --git a/dwl.c b/dwl.c
index bf763df..303832a 100644
index ef27a1d..e11b185 100644
--- a/dwl.c
+++ b/dwl.c
@@ -86,6 +86,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
@@ -80,6 +80,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrFS, LyrTop, LyrOverlay, LyrBlock,
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
#endif
@@ -73,7 +69,7 @@ index bf763df..303832a 100644
typedef union {
int i;
@@ -109,6 +110,8 @@ typedef struct {
@@ -103,6 +104,8 @@ typedef struct {
Monitor *mon;
struct wlr_scene_tree *scene;
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
@@ -82,7 +78,7 @@ index bf763df..303832a 100644
struct wlr_scene_tree *scene_surface;
struct wl_list link;
struct wl_list flink;
@@ -136,6 +139,8 @@ typedef struct {
@@ -127,6 +130,8 @@ typedef struct {
struct wl_listener set_hints;
#endif
unsigned int bw;
@@ -91,16 +87,16 @@ index bf763df..303832a 100644
uint32_t tags;
int isfloating, isurgent, isfullscreen;
uint32_t resize; /* configure serial of a pending resize */
@@ -973,6 +978,8 @@ createnotify(struct wl_listener *listener, void *data)
@@ -971,6 +976,8 @@ createnotify(struct wl_listener *listener, void *data)
c = xdg_surface->data = ecalloc(1, sizeof(*c));
c->surface.xdg = xdg_surface;
c->bw = borderpx;
+ c->bws = borders_only_floating ? 0 : borderspx;
+ c->bwe = borders_only_floating ? 0 : borderepx;
+ c->bws = borderspx;
+ c->bwe = borderepx;
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
@@ -1268,7 +1275,7 @@ focusclient(Client *c, int lift)
@@ -1205,7 +1212,7 @@ focusclient(Client *c, int lift)
/* Don't change border color if there is an exclusive focus or we are
* handling a drag operation */
if (!exclusive_focus && !seat->drag)
@@ -109,7 +105,7 @@ index bf763df..303832a 100644
}
/* Deactivate old client if focus is changing */
@@ -1285,7 +1292,7 @@ focusclient(Client *c, int lift)
@@ -1222,7 +1229,7 @@ focusclient(Client *c, int lift)
/* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
* and probably other clients */
} else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
@@ -118,9 +114,9 @@ index bf763df..303832a 100644
client_activate_surface(old, 0);
}
@@ -1597,6 +1604,12 @@ mapnotify(struct wl_listener *listener, void *data)
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
c->isurgent ? urgentcolor : bordercolor);
@@ -1535,6 +1542,12 @@ mapnotify(struct wl_listener *listener, void *data)
for (i = 0; i < 4; i++) {
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);
c->border[i]->node.data = c;
+
+ c->borders[i] = wlr_scene_rect_create(c->scene, 0, 0, borderscolor);
@@ -131,20 +127,7 @@ index bf763df..303832a 100644
}
/* Initialize client geometry with room for border */
@@ -1618,6 +1631,12 @@ mapnotify(struct wl_listener *listener, void *data)
} else {
applyrules(c);
}
+
+ if (borders_only_floating) {
+ c->bws = c->isfloating ? borderspx : 0;
+ c->bwe = c->isfloating ? borderepx : 0;
+ }
+
printstatus();
unset_fullscreen:
@@ -2051,6 +2070,24 @@ resize(Client *c, struct wlr_box geo, int interact)
@@ -1951,6 +1964,24 @@ resize(Client *c, struct wlr_box geo, int interact)
wlr_scene_node_set_position(&c->border[2]->node, 0, c->bw);
wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
@@ -169,20 +152,7 @@ index bf763df..303832a 100644
/* this is a no-op if size hasn't changed */
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
c->geom.height - 2 * c->bw);
@@ -2151,6 +2188,12 @@ setfloating(Client *c, int floating)
c->isfloating = floating;
if (!c->mon)
return;
+
+ if (borders_only_floating) {
+ c->bws = c->isfloating ? borderspx : 0;
+ c->bwe = c->isfloating ? borderepx : 0;
+ }
+
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
(p && p->isfullscreen) ? LyrFS
: c->isfloating ? LyrFloat : LyrTile]);
@@ -2165,6 +2208,8 @@ setfullscreen(Client *c, int fullscreen)
@@ -2063,6 +2094,8 @@ setfullscreen(Client *c, int fullscreen)
if (!c->mon)
return;
c->bw = fullscreen ? 0 : borderpx;
@@ -191,23 +161,24 @@ index bf763df..303832a 100644
client_set_fullscreen(c, fullscreen);
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
@@ -2819,7 +2864,7 @@ urgent(struct wl_listener *listener, void *data)
printstatus();
@@ -2651,7 +2684,7 @@ urgent(struct wl_listener *listener, void *data)
return;
if (client_surface(c)->mapped)
- client_set_border_color(c, urgentcolor);
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
}
void
@@ -3023,7 +3068,7 @@ sethints(struct wl_listener *listener, void *data)
c->isurgent = 1;
printstatus();
}
@@ -2835,7 +2868,7 @@ sethints(struct wl_listener *listener, void *data)
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
if (c->isurgent && surface && surface->mapped)
- client_set_border_color(c, urgentcolor);
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
}
void
printstatus();
}
--
2.44.1
2.42.0
@@ -1,7 +1,7 @@
From 86e379b187bcc9f8f5896a87309474fcf3736de9 Mon Sep 17 00:00:00 2001
From: nate zhou <gnuunixchad@outlook.com>
Date: Sat, 28 Feb 2026 21:29:53 +0800
Subject: [PATCH] Patch: bottomstack-0.8.patch
From 589c964e47965d84ffd3a2b036e75feddd619eed Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Thu, 11 Apr 2024 16:50:20 -0500
Subject: [PATCH] add bstack and bstackhoriz layouts
---
config.def.h | 4 +++
@@ -9,7 +9,7 @@ Subject: [PATCH] Patch: bottomstack-0.8.patch
2 files changed, 88 insertions(+)
diff --git a/config.def.h b/config.def.h
index 8a6eda0..ae87518 100644
index 8847e58..68b62db 100644
--- a/config.def.h
+++ b/config.def.h
@@ -33,6 +33,8 @@ static const Layout layouts[] = {
@@ -21,7 +21,7 @@ index 8a6eda0..ae87518 100644
};
/* monitors */
@@ -135,6 +137,8 @@ static const Key keys[] = {
@@ -134,6 +136,8 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@@ -31,10 +31,10 @@ index 8a6eda0..ae87518 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
diff --git a/dwl.c b/dwl.c
index 44f3ad9..68c25a5 100644
index bf763df..dc3d000 100644
--- a/dwl.c
+++ b/dwl.c
@@ -59,6 +59,7 @@
@@ -55,6 +55,7 @@
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
@@ -42,7 +42,7 @@ index 44f3ad9..68c25a5 100644
#include <wlr/util/log.h>
#include <wlr/util/region.h>
#include <xkbcommon/xkbcommon.h>
@@ -351,6 +352,8 @@ static Monitor *xytomon(double x, double y);
@@ -347,6 +348,8 @@ static Monitor *xytomon(double x, double y);
static void xytonode(double x, double y, struct wlr_surface **psurface,
Client **pc, LayerSurface **pl, double *nx, double *ny);
static void zoom(const Arg *arg);
@@ -50,8 +50,8 @@ index 44f3ad9..68c25a5 100644
+static void bstackhoriz(Monitor *m);
/* variables */
static pid_t child_pid = -1;
@@ -3213,3 +3216,84 @@ main(int argc, char *argv[])
static const char broken[] = "broken";
@@ -3088,3 +3091,84 @@ main(int argc, char *argv[])
usage:
die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
}
@@ -70,7 +70,7 @@ index 44f3ad9..68c25a5 100644
+ return;
+
+ if (n > m->nmaster) {
+ mh = (int)round(m->nmaster ? m->mfact * m->w.height : 0);
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ tw = m->w.width / (n - m->nmaster);
+ ty = m->w.y + mh;
+ } else {
@@ -111,7 +111,7 @@ index 44f3ad9..68c25a5 100644
+ return;
+
+ if (n > m->nmaster) {
+ mh = (int)round(m->nmaster ? m->mfact * m->w.height : 0);
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ th = (m->w.height - mh) / (n - m->nmaster);
+ ty = m->w.y + mh;
+ } else {
@@ -137,5 +137,5 @@ index 44f3ad9..68c25a5 100644
+ }
+}
--
2.53.0
2.43.2
@@ -1,6 +1,6 @@
From 897765216ac8567a40654b813379a4e074ca6298 Mon Sep 17 00:00:00 2001
From 5646d7e7d933a2e7a667767c3fde89c91697c4ea Mon Sep 17 00:00:00 2001
From: Guido Cella <guido@guidocella.xyz>
Date: Mon, 9 Feb 2026 10:21:33 +0100
Date: Tue, 6 Feb 2024 09:20:48 +0100
Subject: [PATCH] add a keybinding to center the terminal
Add a keybinding that toggles centering the terminally horizontally when
@@ -10,14 +10,14 @@ This limits the width of long text making it easier to read, and avoids
covering the wallpaper more than necessary.
---
config.def.h | 1 +
dwl.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
dwl.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/config.def.h b/config.def.h
index 8a6eda0..8c35c40 100644
index a85ca27..2055df9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -138,6 +138,7 @@ static const Key keys[] = {
@@ -139,6 +139,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
@@ -26,10 +26,10 @@ index 8a6eda0..8c35c40 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
diff --git a/dwl.c b/dwl.c
index 44f3ad9..9ee397a 100644
index 002349a..4582413 100644
--- a/dwl.c
+++ b/dwl.c
@@ -8,6 +8,7 @@
@@ -7,6 +7,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -37,7 +37,7 @@ index 44f3ad9..9ee397a 100644
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
@@ -138,6 +139,7 @@ typedef struct {
@@ -135,6 +136,7 @@ typedef struct {
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
@@ -45,7 +45,7 @@ index 44f3ad9..9ee397a 100644
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -334,6 +336,7 @@ static void startdrag(struct wl_listener *listener, void *data);
@@ -319,6 +321,7 @@ static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
@@ -53,26 +53,25 @@ index 44f3ad9..9ee397a 100644
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
@@ -436,6 +439,8 @@ static struct wl_listener request_start_drag = {.notify = requeststartdrag};
static struct wl_listener start_drag = {.notify = startdrag};
static struct wl_listener new_session_lock = {.notify = locksession};
@@ -392,6 +395,8 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
+static bool center;
+
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -499,6 +504,9 @@ applyrules(Client *c)
@@ -457,6 +462,8 @@ applyrules(Client *c)
}
}
}
+ if (!strcasecmp(appid, termcmd[0]))
+ c->centered = true;
+
c->isfloating |= client_is_float_type(c);
setmon(c, mon, newtags);
}
@@ -2731,6 +2739,11 @@ tile(Monitor *m)
@@ -2519,6 +2526,11 @@ tile(Monitor *m)
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue;
if (i < m->nmaster) {
@@ -84,7 +83,7 @@ index 44f3ad9..9ee397a 100644
resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
.height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0);
my += c->geom.height;
@@ -2743,6 +2756,13 @@ tile(Monitor *m)
@@ -2531,6 +2543,13 @@ tile(Monitor *m)
}
}
@@ -99,5 +98,5 @@ index 44f3ad9..9ee397a 100644
togglefloating(const Arg *arg)
{
--
2.52.0
2.43.0
@@ -1,39 +1,19 @@
From b1ca46930756b59c1ebba0b8c7871b85ff84f62f Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Sat, 8 Feb 2025 16:10:25 +0100
Subject: [PATCH] Add centeredmaster layout
From a9d47325283a55fd299de5bbbab5ab195840c7ca Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Thu, 11 Apr 2024 16:42:25 -0500
Subject: [PATCH] implement centeredmaster layout
This is a port of centeredmaster patch for dwm:
https://dwm.suckless.org/patches/centeredmaster
centeredmaster centers the nmaster area on screen, using mfact * monitor
width & height, with the stacked windows distributed to the left and
right. It can be selected with [Alt]+[c].
With one and two clients in master respectively this results in:
+------------------------------+ +------------------------------+
|+--------++--------++--------+| |+--------++--------++--------+|
|| || || || || || || ||
|| || || || || || M1 || ||
|| || || || || || || ||
|| S2 || M || S1 || || |+--------+| ||
|| || || || || |+--------+| ||
|| || || || || || || ||
|| || || || || || M2 || ||
|| || || || || || || ||
|+--------++--------++--------+| |+--------++--------++--------+|
+------------------------------+ +------------------------------+
inspiration: https://github.com/djpohly/dwl/wiki/centeredmaster
---
config.def.h | 2 ++
dwl.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+)
dwl.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/config.def.h b/config.def.h
index 22d2171..9a3b0c5 100644
index 8847e58..cfc6e62 100644
--- a/config.def.h
+++ b/config.def.h
@@ -34,6 +34,7 @@ static const Layout layouts[] = {
@@ -33,6 +33,7 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -41,7 +21,7 @@ index 22d2171..9a3b0c5 100644
};
/* monitors */
@@ -139,6 +140,7 @@ static const Key keys[] = {
@@ -134,6 +135,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@@ -50,10 +30,10 @@ index 22d2171..9a3b0c5 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
diff --git a/dwl.c b/dwl.c
index def2562..c2456dd 100644
index bf763df..0e84ccf 100644
--- a/dwl.c
+++ b/dwl.c
@@ -251,6 +251,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
@@ -248,6 +248,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
static void arrangelayers(Monitor *m);
static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data);
@@ -61,14 +41,15 @@ index def2562..c2456dd 100644
static void chvt(const Arg *arg);
static void checkidleinhibitor(struct wlr_surface *exclude);
static void cleanup(void);
@@ -649,6 +650,68 @@ buttonpress(struct wl_listener *listener, void *data)
@@ -628,6 +629,69 @@ buttonpress(struct wl_listener *listener, void *data)
event->time_msec, event->button, event->state);
}
+void
+centeredmaster(Monitor *m)
+{
+ int i, n, h, mw, mx, my, oty, ety, tw;
+ unsigned int h, mw, mx, my, oty, ety, tw;
+ int i, n;
+ Client *c;
+
+ n = 0;
@@ -86,7 +67,7 @@ index def2562..c2456dd 100644
+
+ if (n > m->nmaster) {
+ /* go mfact box in the center if more than nmaster clients */
+ mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+ mw = ROUND(m->nmaster ? m->w.width * m->mfact : 0);
+ tw = m->w.width - mw;
+
+ if (n - m->nmaster > 1) {
@@ -131,5 +112,5 @@ index def2562..c2456dd 100644
chvt(const Arg *arg)
{
--
2.48.1
2.43.2
@@ -1,15 +1,15 @@
From 226e204ec7fb6d6840a984ef8e8ec1d2514e985f Mon Sep 17 00:00:00 2001
From 8cad102fd59463e8a2238845399dcaa1f759508c Mon Sep 17 00:00:00 2001
From: Ben Collerson <benc@benc.cc>
Date: Tue, 2 Jan 2024 10:33:59 +1000
Subject: [PATCH] chainkeys
Subject: [PATCH 1/2] chainkeys
---
config.def.h | 62 ++++++++++++++++++++++++++--------------------------
dwl.c | 23 ++++++++++++++++++-
2 files changed, 53 insertions(+), 32 deletions(-)
dwl.c | 22 ++++++++++++++++++-
2 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/config.def.h b/config.def.h
index 8f498d2f..1c182547 100644
index 9009517..f4b7b2a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -105,10 +105,10 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
@@ -27,7 +27,7 @@ index 8f498d2f..1c182547 100644
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
@@ -119,30 +119,30 @@ static const char *menucmd[] = { "wmenu-run", NULL };
@@ -119,30 +119,30 @@ static const char *menucmd[] = { "bemenu-run", NULL };
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
@@ -62,8 +62,8 @@ index 8f498d2f..1c182547 100644
+ { MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
+ { MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
+ { MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05f} },
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05f} },
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05} },
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05} },
+ { MODKEY, -1, XKB_KEY_Return, zoom, {0} },
+ { MODKEY, -1, XKB_KEY_Tab, view, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
@@ -101,26 +101,26 @@ index 8f498d2f..1c182547 100644
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
};
diff --git a/dwl.c b/dwl.c
index bf763dfc..05e667f8 100644
index f25ac2f..8ffad73 100644
--- a/dwl.c
+++ b/dwl.c
@@ -143,6 +143,7 @@ typedef struct {
@@ -139,6 +139,7 @@ typedef struct {
typedef struct {
uint32_t mod;
+ int chain;
+ xkb_keysym_t chain;
xkb_keysym_t keysym;
void (*func)(const Arg *);
const Arg arg;
@@ -353,6 +354,7 @@ static const char broken[] = "broken";
@@ -338,6 +339,7 @@ static const char broken[] = "broken";
static pid_t child_pid = -1;
static int locked;
static void *exclusive_focus;
+static int chainkey = -1;
+static xkb_keysym_t chainkey = -1;
static struct wl_display *dpy;
static struct wlr_backend *backend;
static struct wlr_scene *scene;
@@ -1438,11 +1440,30 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
@@ -1363,10 +1365,28 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
const Key *k;
for (k = keys; k < END(keys); k++) {
if (CLEANMASK(mods) == CLEANMASK(k->mod)
@@ -141,17 +141,75 @@ index bf763dfc..05e667f8 100644
+ return 1;
+ }
+ else if (CLEANMASK(mods) == CLEANMASK(k->mod)
+ && k->chain == (int)sym
+ && k->chain == sym
+ && chainkey == -1
+ && k->func) {
+ chainkey = sym;
+ return 1;
+ }
}
+ chainkey = -1;
return 0;
}
--
2.43.0
From 0b11cce166dc0daabe305622d593532407a178ed Mon Sep 17 00:00:00 2001
From: Ben Collerson <benc@benc.cc>
Date: Tue, 2 Jan 2024 10:33:59 +1000
Subject: [PATCH 2/2] fix types - signed ints should be signed.
---
config.def.h | 4 ++--
dwl.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index f4b7b2a..ac70906 100644
--- a/config.def.h
+++ b/config.def.h
@@ -126,8 +126,8 @@ static const Key keys[] = {
{ MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
{ MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
- { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05} },
- { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05} },
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05f} },
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05f} },
{ MODKEY, -1, XKB_KEY_Return, zoom, {0} },
{ MODKEY, -1, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
diff --git a/dwl.c b/dwl.c
index 8ffad73..cbb9cbf 100644
--- a/dwl.c
+++ b/dwl.c
@@ -139,7 +139,7 @@ typedef struct {
typedef struct {
uint32_t mod;
- xkb_keysym_t chain;
+ int chain;
xkb_keysym_t keysym;
void (*func)(const Arg *);
const Arg arg;
@@ -339,7 +339,7 @@ static const char broken[] = "broken";
static pid_t child_pid = -1;
static int locked;
static void *exclusive_focus;
-static xkb_keysym_t chainkey = -1;
+static int chainkey = -1;
static struct wl_display *dpy;
static struct wlr_backend *backend;
static struct wlr_scene *scene;
@@ -1381,7 +1381,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
return 1;
}
else if (CLEANMASK(mods) == CLEANMASK(k->mod)
- && k->chain == sym
+ && k->chain == (int)sym
&& chainkey == -1
&& k->func) {
chainkey = sym;
--
2.43.0
@@ -1,4 +1,4 @@
From ba3172875d379ff4f2db69753f50067cecfc8293 Mon Sep 17 00:00:00 2001
From adbc47f25aadfa55d2e042c52f81ba4db08dd57f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Tue, 25 Jul 2023 12:48:22 -0600
@@ -7,54 +7,55 @@ Subject: [PATCH] add default transparency for windows and rules for override
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
Modified-by: Yuki <yukii.senp@gmail.com>
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 9 ++++++---
dwl.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 3 deletions(-)
config.def.h | 10 +++++++---
dwl.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/config.def.h b/config.def.h
index 95c2afa..808242a 100644
index a8ed61d..3c79817 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.0f, 0.0f, 0.0f, 1.0f}; /* You can also use glsl colors */
/* 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}; /* You can also use glsl colors */
+static const float default_opacity = 0.75;
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -22,10 +23,10 @@ static int log_level = WLR_ERROR;
@@ -21,11 +22,12 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
static int log_level = WLR_ERROR;
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating alpha monitor */
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity, -1 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.0, -1 }, /* Start on ONLY tag "9" */
/* examples:
- { "Gimp", NULL, 0, 1, -1 },
+ { "Gimp", NULL, 0, 1, default_alpha, -1 },
+ { "Alacritty",NULL, 1 << 2, 0, 1.0, -1 },
*/
- { "firefox", NULL, 1 << 8, 0, -1 },
+ { "firefox", NULL, 1 << 8, 0, default_opacity, -1 },
};
/* layout(s) */
@@ -133,6 +134,8 @@ static const Key keys[] = {
@@ -128,6 +130,8 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
+ { MODKEY, XKB_KEY_o, setopacity, {.f = +0.1f} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, setopacity, {.f = -0.1f} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
+ { MODKEY, XKB_KEY_o, setopacity, {.f = +0.1} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, setopacity, {.f = -0.1} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
diff --git a/dwl.c b/dwl.c
index 12f441e..f547148 100644
index 4d19357..1b905ed 100644
--- a/dwl.c
+++ b/dwl.c
@@ -138,6 +138,7 @@ typedef struct {
@@ -133,6 +133,7 @@ typedef struct {
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
@@ -62,7 +63,7 @@ index 12f441e..f547148 100644
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -227,6 +228,7 @@ typedef struct {
@@ -217,6 +218,7 @@ typedef struct {
const char *title;
uint32_t tags;
int isfloating;
@@ -70,7 +71,7 @@ index 12f441e..f547148 100644
int monitor;
} Rule;
@@ -319,6 +321,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data);
@@ -299,6 +301,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data);
static void requestmonstate(struct wl_listener *listener, void *data);
static void resize(Client *c, struct wlr_box geo, int interact);
static void run(char *startup_cmd);
@@ -78,7 +79,7 @@ index 12f441e..f547148 100644
static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating);
@@ -326,6 +329,7 @@ static void setfullscreen(Client *c, int fullscreen);
@@ -307,6 +310,7 @@ static void setgamma(struct wl_listener *listener, void *data);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
static void setmon(Client *c, Monitor *m, uint32_t newtags);
@@ -86,7 +87,7 @@ index 12f441e..f547148 100644
static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
@@ -490,6 +494,7 @@ applyrules(Client *c)
@@ -440,6 +444,7 @@ applyrules(Client *c)
if ((!r->title || strstr(title, r->title))
&& (!r->id || strstr(appid, r->id))) {
c->isfloating = r->isfloating;
@@ -94,24 +95,33 @@ index 12f441e..f547148 100644
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link) {
@@ -1127,6 +1132,7 @@ createnotify(struct wl_listener *listener, void *data)
c = toplevel->base->data = ecalloc(1, sizeof(*c));
c->surface.xdg = toplevel->base;
@@ -448,6 +453,7 @@ applyrules(Client *c)
}
}
}
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, scenebuffersetopacity, c);
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
setmon(c, mon, newtags);
}
@@ -734,6 +740,9 @@ commitnotify(struct wl_listener *listener, void *data)
if (client_surface(c)->mapped && c->mon)
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
+ if (c->scene_surface)
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, scenebuffersetopacity, c);
+
/* mark a pending resize as completed */
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
c->resize = 0;
@@ -947,6 +956,7 @@ createnotify(struct wl_listener *listener, void *data)
c = xdg_surface->data = ecalloc(1, sizeof(*c));
c->surface.xdg = xdg_surface;
c->bw = borderpx;
+ c->opacity = default_opacity;
LISTEN(&toplevel->base->surface->events.commit, &c->commit, commitnotify);
LISTEN(&toplevel->base->surface->events.map, &c->map, mapnotify);
@@ -2159,6 +2165,8 @@ rendermon(struct wl_listener *listener, void *data)
/* Render if no XDG clients have an outstanding resize and are visible on
* this monitor. */
wl_list_for_each(c, &clients, link) {
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, scenebuffersetopacity, c);
+
if (c->resize && !c->isfloating && client_is_rendered_on_mon(c, m) && !client_is_stopped(c))
goto skip;
}
@@ -2295,6 +2303,15 @@ run(char *startup_cmd)
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
@@ -2002,6 +2012,15 @@ run(char *startup_cmd)
wl_display_run(dpy);
}
@@ -127,7 +137,7 @@ index 12f441e..f547148 100644
void
setcursor(struct wl_listener *listener, void *data)
{
@@ -2363,6 +2380,7 @@ setfullscreen(Client *c, int fullscreen)
@@ -2067,6 +2086,7 @@ setfullscreen(Client *c, int fullscreen)
* client positions are set by the user and cannot be recalculated */
resize(c, c->prev, 0);
}
@@ -135,7 +145,7 @@ index 12f441e..f547148 100644
arrange(c->mon);
printstatus();
}
@@ -2419,6 +2437,23 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
@@ -2132,6 +2152,23 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
focusclient(focustop(selmon), 1);
}
@@ -148,10 +158,10 @@ index 12f441e..f547148 100644
+
+ sel->opacity += arg->f;
+ if (sel->opacity > 1.0)
+ sel->opacity = 1.0f;
+ sel->opacity = 1.0;
+
+ if (sel->opacity < 0.1)
+ sel->opacity = 0.1f;
+ sel->opacity = 0.1;
+
+ wlr_scene_node_for_each_buffer(&sel->scene_surface->node, scenebuffersetopacity, sel);
+}
@@ -159,14 +169,14 @@ index 12f441e..f547148 100644
void
setpsel(struct wl_listener *listener, void *data)
{
@@ -3130,6 +3165,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
@@ -2842,6 +2879,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
c->surface.xwayland = xsurface;
c->type = X11;
c->bw = client_is_unmanaged(c) ? 0 : borderpx;
c->bw = borderpx;
+ c->opacity = default_opacity;
/* Listen to the various events it can emit */
LISTEN(&xsurface->events.associate, &c->associate, associatex11);
--
2.51.0
2.43.0
@@ -1,6 +1,6 @@
From 6d5017888891957615160fe7c015adf7a6f0fd45 Mon Sep 17 00:00:00 2001
From 38bf34759e5eb3aed9fd14429eee8a1e509c014e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
<leohdz172@protonmail.com>
Date: Wed, 5 Oct 2022 23:07:13 -0500
Subject: [PATCH] increase RLIMIT_CORE (generate a coredump)
MIME-Version: 1.0
@@ -13,10 +13,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
1 file changed, 9 insertions(+)
diff --git a/dwl.c b/dwl.c
index ad21e1ba..940fbeff 100644
index 10d5a5b..62cdb5a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -8,6 +8,7 @@
@@ -7,6 +7,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -24,24 +24,24 @@ index ad21e1ba..940fbeff 100644
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
@@ -353,6 +354,8 @@ static void xytonode(double x, double y, struct wlr_surface **psurface,
static void zoom(const Arg *arg);
@@ -334,6 +335,8 @@ static void zoom(const Arg *arg);
/* variables */
static const char broken[] = "broken";
+static struct rlimit oldrlimit;
+static struct rlimit newrlimit;
static pid_t child_pid = -1;
static int locked;
static void *exclusive_focus;
@@ -2248,6 +2251,7 @@ run(char *startup_cmd)
@@ -1972,6 +1975,7 @@ run(char *startup_cmd)
if ((child_pid = fork()) < 0)
die("startup: fork:");
if (child_pid == 0) {
+ setrlimit(RLIMIT_CORE, &oldrlimit);
setsid();
dup2(piperw[0], STDIN_FILENO);
close(piperw[0]);
@@ -2659,6 +2663,7 @@ void
close(piperw[1]);
@@ -2410,6 +2414,7 @@ void
spawn(const Arg *arg)
{
if (fork() == 0) {
@@ -49,7 +49,7 @@ index ad21e1ba..940fbeff 100644
dup2(STDERR_FILENO, STDOUT_FILENO);
setsid();
execvp(((char **)arg->v)[0], (char **)arg->v);
@@ -3178,6 +3183,10 @@ main(int argc, char *argv[])
@@ -2928,6 +2933,10 @@ main(int argc, char *argv[])
char *startup_cmd = NULL;
int c;
@@ -61,5 +61,5 @@ index ad21e1ba..940fbeff 100644
if (c == 's')
startup_cmd = optarg;
--
2.48.0
2.43.0
@@ -1,46 +1,51 @@
From f08376a2a04929a3907612e6c1f980ad3cdf939f Mon Sep 17 00:00:00 2001
From 55c22683c88c9816ceba6351a716fbe005555abd Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Fri, 5 Jul 2024 11:10:39 -0500
Subject: [PATCH] implement cursortheme
Date: Thu, 11 Apr 2024 12:43:29 -0500
Subject: [PATCH] add ability to change cursor's theme and size
---
config.def.h | 2 ++
dwl.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
dwl.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..1f9ff56 100644
index 8847e58..3189d48 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+static const char *cursor_theme = NULL;
+static const char cursor_size[] = "24"; /* Make sure it's a valid integer, otherwise things will break */
+static const char cursortheme[] = ""; /* theme from /usr/share/cursors/xorg-x11 */
+static const unsigned int cursorsize = 24;
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
diff --git a/dwl.c b/dwl.c
index dc0437e..a91d42b 100644
index bf763df..961e2f1 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2522,8 +2522,12 @@ setup(void)
@@ -2274,7 +2274,9 @@ setup(void)
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
+ char cursorsize_str[3];
sigemptyset(&sa.sa_mask);
+ sprintf(cursorsize_str, "%d", cursorsize);
for (i = 0; i < (int)LENGTH(sig); i++)
sigaction(sig[i], &sa, NULL);
@@ -2412,8 +2414,8 @@ setup(void)
* Xcursor themes to source cursor images from and makes sure that cursor
* images are available at all scale factors on the screen (necessary for
* HiDPI support). Scaled cursors will be loaded with each output. */
- cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
- setenv("XCURSOR_SIZE", "24", 1);
+ cursor_mgr = wlr_xcursor_manager_create(cursor_theme, atoi(cursor_size));
+ setenv("XCURSOR_SIZE", cursor_size, 1);
+ if (cursor_theme)
+ setenv("XCURSOR_THEME", cursor_theme, 1);
+ else
+ unsetenv("XCURSOR_THEME");
+ cursor_mgr = wlr_xcursor_manager_create(cursortheme, cursorsize);
+ setenv("XCURSOR_SIZE", cursorsize_str, 1);
/*
* wlr_cursor *only* displays an image on screen. It does not move around
--
2.45.1
2.43.2
+77
View File
@@ -0,0 +1,77 @@
From ff29aba2f45d5acdee66efaf7cf94ab66145c0ed Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Thu, 11 Apr 2024 14:19:24 -0500
Subject: [PATCH] rules for floating windows support default x, y, width,
height If the width or height is less than or equal to 1, then the value will
be interpreted as a percentage. For example, 0.5 represents 50%, 0.25
represents 25%, and 1 represents 100%. NOTE: Some clients, like Thunar, have
minimum width/height
`floating_relative_to_monitor` allows the user to choose whether to position relative to the monitor or relative to the window area.
---
config.def.h | 7 ++++---
dwl.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/config.def.h b/config.def.h
index 8847e58..ebaf1ab 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+static const int floating_relative_to_monitor = 0; /* 0 means center floating relative to the window area */
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -21,10 +22,10 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
static int log_level = WLR_ERROR;
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating monitor x y width height */
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp_EXAMPLE", NULL, 0, 1, -1, 0, 0, 1000, 0.75 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1, 0, 0, 0, 0 },/* Start on ONLY tag "9" */
};
/* layout(s) */
diff --git a/dwl.c b/dwl.c
index bf763df..94e4d7d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -228,6 +228,10 @@ typedef struct {
uint32_t tags;
int isfloating;
int monitor;
+ int x;
+ int y;
+ float w;
+ float h;
} Rule;
typedef struct {
@@ -468,6 +472,18 @@ applyrules(Client *c)
if (r->monitor == i++)
mon = m;
}
+ if (c->isfloating) {
+ struct wlr_box b = floating_relative_to_monitor ? mon->m : mon->w;
+ int newwidth = ROUND(r->w ? (r->w <= 1 ? b.width * r->w : r->w) : c->geom.width);
+ int newheight = ROUND(r->h ? (r->h <= 1 ? b.height * r->h : r->h) : c->geom.height);
+
+ resize(c, (struct wlr_box){
+ .x = r->x ? r->x + b.x : (b.width - newwidth) / 2 + b.x,
+ .y = r->y ? r->y + b.y : (b.height - newheight) / 2 + b.y,
+ .width = newwidth,
+ .height = newheight,
+ }, 1);
+ }
}
}
setmon(c, mon, newtags);
--
2.43.2
@@ -0,0 +1,49 @@
From ec6a6a4fe56ef5bdf45633966345f0d0338776d5 Mon Sep 17 00:00:00 2001
From: Abanoub <abanoubsameh@protonmail.com>
Date: Fri, 19 Jan 2024 21:42:42 +0200
Subject: [PATCH] Add the ability to define a MODKEY as a make argument
---
Makefile | 6 +++++-
config.def.h | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 0822ddc..d169a97 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,10 @@ PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS)
DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
+ifneq ($(MODKEY),)
+MODKEYVAL = -DMODKEY=$(MODKEY)
+endif
+
all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
@@ -63,4 +67,4 @@ uninstall:
.SUFFIXES: .c .o
.c.o:
- $(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $<
+ $(CC) $(CPPFLAGS) $(DWLCFLAGS) $(MODKEYVAL) -c $<
diff --git a/config.def.h b/config.def.h
index 9009517..b1e53cd 100644
--- a/config.def.h
+++ b/config.def.h
@@ -102,7 +102,9 @@ 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
+#ifndef MODKEY
+# define MODKEY WLR_MODIFIER_ALT
+#endif
#define TAGKEYS(KEY,SKEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
--
2.43.0
@@ -1,75 +1,66 @@
From 556e47f7ce7f729ecc1b285ece0c82744741c81c Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Sun, 30 Nov 2025 23:16:53 +0100
From 19d52ef3f9814dd205e71c3ef31e41fd52cef515 Mon Sep 17 00:00:00 2001
From: ForzCross <forzcross@gmail.com>
Date: Wed, 10 Jan 2024 00:42:39 +0300
Subject: [PATCH] Always use the English keymap to get keycodes
---
dwl.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
dwl.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index def2562..31e98ca 100644
index 632dabf..858318a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -413,6 +413,11 @@ static struct wlr_box sgeom;
@@ -384,6 +384,12 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
+static struct xkb_rule_names en_rules;
+static const struct xkb_rule_names en_rules = {.layout = "us"};
+static struct xkb_context *en_context;
+static struct xkb_keymap *en_keymap;
+static struct xkb_state *en_state;
+static struct xkb_state *en_state, *en_state_shift;
+static xkb_mod_index_t en_shift;
+
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -694,6 +699,9 @@ cleanup(void)
wlr_backend_destroy(backend);
@@ -647,6 +653,10 @@ cleanup(void)
wl_event_source_remove(vkb_group.key_repeat_source);
wl_display_destroy(dpy);
+ xkb_state_unref(en_state);
+ xkb_state_unref(en_state_shift);
+ xkb_keymap_unref(en_keymap);
+ xkb_context_unref(en_context);
/* Destroy after the wayland display (when the monitors are already destroyed)
to avoid destroying them with an invalid scene output. */
wlr_scene_node_destroy(&scene->tree.node);
@@ -1582,16 +1590,19 @@ keypress(struct wl_listener *listener, void *data)
/* This event is raised when a key is pressed or released. */
KeyboardGroup *group = wl_container_of(listener, group, key);
struct wlr_keyboard_key_event *event = data;
+ int nsyms, handled;
/* Translate libinput keycode -> xkbcommon */
@@ -1381,8 +1391,10 @@ keypress(struct wl_listener *listener, void *data)
uint32_t keycode = event->keycode + 8;
/* Get a list of keysyms based on the keymap for this keyboard */
const xkb_keysym_t *syms;
- int nsyms = xkb_state_key_get_syms(
+ int shift = xkb_state_mod_index_is_active(
+ group->wlr_group->keyboard.xkb_state, en_shift, XKB_STATE_MODS_EFFECTIVE);
int nsyms = xkb_state_key_get_syms(
- group->wlr_group->keyboard.xkb_state, keycode, &syms);
-
- int handled = 0;
+ shift ? en_state_shift : en_state, keycode, &syms);
int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
+ xkb_state_update_key(en_state, keycode,
+ (event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
+ ? XKB_KEY_DOWN : XKB_KEY_UP);
+ nsyms = xkb_state_key_get_syms(en_state, keycode, &syms);
+
+ handled = 0;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -2607,6 +2618,12 @@ setup(void)
@@ -2323,6 +2335,13 @@ setup(void)
* pointer, touch, and drawing tablet device. We also rig up a listener to
* let us know when new input devices are available on the backend.
*/
+ en_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
+ en_rules = xkb_rules;
+ en_rules.layout = "us";
+ en_keymap = xkb_keymap_new_from_names(en_context, &en_rules,
+ XKB_KEYMAP_COMPILE_NO_FLAGS);
+ en_state = xkb_state_new(en_keymap);
+ en_state_shift = xkb_state_new(en_keymap);
+ en_shift = xkb_keymap_mod_get_index(en_keymap, XKB_MOD_NAME_SHIFT);
+ xkb_state_update_mask(en_state_shift, 1 << en_shift, 0, 0, 0, 0, 0);
LISTEN_STATIC(&backend->events.new_input, inputdevice);
virtual_keyboard_mgr = wlr_virtual_keyboard_manager_v1_create(dpy);
LISTEN_STATIC(&virtual_keyboard_mgr->events.new_virtual_keyboard, virtualkeyboard);
--
2.51.2
2.43.0
+12 -12
View File
@@ -1,4 +1,4 @@
From 3c3ea42cd50bfa5111be69b3c1f71afa0443bb53 Mon Sep 17 00:00:00 2001
From a822ac65306ca331b95b17ffe08147110c03c60d Mon Sep 17 00:00:00 2001
From: Dima Krasner <dima@dimakrasner.com>
Date: Sat, 30 Dec 2023 10:49:48 +0200
Subject: [PATCH] allow environment variables to override config.h
@@ -12,19 +12,19 @@ Subject: [PATCH] allow environment variables to override config.h
create mode 100644 env.c
diff --git a/Makefile b/Makefile
index 9308656..c66d376 100644
index 0822ddc..fbdfdca 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ dwl: dwl.o util.o
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
@@ -17,6 +17,7 @@ all: dwl
dwl: dwl.o util.o
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
+dwl.o: env.c
util.o: util.c util.h
# wayland-scanner is a tool which generates C headers and rigging for Wayland
diff --git a/config.def.h b/config.def.h
index a784eb4..e0f10de 100644
index 9009517..c6b9ae0 100644
--- a/config.def.h
+++ b/config.def.h
@@ -6,11 +6,11 @@
@@ -41,14 +41,14 @@ index a784eb4..e0f10de 100644
+static float bordercolor[] = COLOR(0x444444ff);
+static float focuscolor[] = COLOR(0x005577ff);
+static float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
diff --git a/dwl.c b/dwl.c
index d48bf40..de33dfe 100644
index fa76db2..6dd4524 100644
--- a/dwl.c
+++ b/dwl.c
@@ -429,6 +429,8 @@ static xcb_atom_t netatom[NetLast];
@@ -407,6 +407,8 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
@@ -57,7 +57,7 @@ index d48bf40..de33dfe 100644
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -1082,6 +1084,8 @@ createpointer(struct wlr_pointer *pointer)
@@ -1010,6 +1012,8 @@ createpointer(struct wlr_pointer *pointer)
libinput_device_config_accel_set_profile(device, accel_profile);
libinput_device_config_accel_set_speed(device, accel_speed);
}
@@ -66,7 +66,7 @@ index d48bf40..de33dfe 100644
}
wlr_cursor_attach_input_device(cursor, &pointer->base);
@@ -3141,6 +3145,7 @@ main(int argc, char *argv[])
@@ -2974,6 +2978,7 @@ main(int argc, char *argv[])
/* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
if (!getenv("XDG_RUNTIME_DIR"))
die("XDG_RUNTIME_DIR must be set");
@@ -1,4 +1,4 @@
From a94c52af879027e654f67c36621a8c9b2f338f56 Mon Sep 17 00:00:00 2001
From 830f6ed5352d32a66c62f49b28439b2bcd904417 Mon Sep 17 00:00:00 2001
From: Dima Krasner <dima@dimakrasner.com>
Date: Sat, 2 Dec 2023 10:36:35 +0200
Subject: [PATCH] fall back to a lower output mode if needed
@@ -9,10 +9,10 @@ Subject: [PATCH] fall back to a lower output mode if needed
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index d48bf40..7719f7e 100644
index fa76db2..88cabeb 100644
--- a/dwl.c
+++ b/dwl.c
@@ -920,6 +920,7 @@ createmon(struct wl_listener *listener, void *data)
@@ -848,6 +848,7 @@ createmon(struct wl_listener *listener, void *data)
/* This event is raised by the backend when a new output (aka a display or
* monitor) becomes available. */
struct wlr_output *wlr_output = data;
@@ -20,7 +20,7 @@ index d48bf40..7719f7e 100644
const MonitorRule *r;
size_t i;
struct wlr_output_state state;
@@ -956,7 +957,17 @@ createmon(struct wl_listener *listener, void *data)
@@ -884,7 +885,17 @@ createmon(struct wl_listener *listener, void *data)
* monitor supports only a specific set of modes. We just pick the
* monitor's preferred mode; a more sophisticated compositor would let
* the user configure it. */
+26 -25
View File
@@ -1,17 +1,16 @@
From 50e3dd4746b6cb719efb9f8213b94ac52a5320d9 Mon Sep 17 00:00:00 2001
From: peesock <kcormn@gmail.com>
Date: Mon, 24 Jun 2024 20:06:42 -0700
Subject: [PATCH] gaps!
From c814a3f16995a2fe8542c5bbdb28e38e7de5ef7e Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Sun, 15 Oct 2023 09:38:16 +0100
Subject: [PATCH] introduce gaps with functionality of useless gaps from dwm
Co-authored-by: sewn <sewn@disroot.org>
Co-authored-by: serenevoid <ajuph9224@gmail.com>
---
config.def.h | 4 ++++
dwl.c | 34 ++++++++++++++++++++++++++--------
2 files changed, 30 insertions(+), 8 deletions(-)
dwl.c | 38 ++++++++++++++++++++++++++++----------
2 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..b388b4e 100644
index 8847e58..dca0a46 100644
--- a/config.def.h
+++ b/config.def.h
@@ -6,6 +6,9 @@
@@ -24,7 +23,7 @@ index 22d2171..b388b4e 100644
static const unsigned int borderpx = 1; /* border pixel of windows */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
@@ -135,6 +138,7 @@ static const Key keys[] = {
@@ -130,6 +133,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
@@ -33,10 +32,10 @@ index 22d2171..b388b4e 100644
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
diff --git a/dwl.c b/dwl.c
index dc0437e..dc851df 100644
index 39ce68c..2d317c5 100644
--- a/dwl.c
+++ b/dwl.c
@@ -199,6 +199,7 @@ struct Monitor {
@@ -198,6 +198,7 @@ struct Monitor {
struct wlr_box w; /* window area, layout-relative */
struct wl_list layers[4]; /* LayerSurface.link */
const Layout *lt[2];
@@ -44,7 +43,7 @@ index dc0437e..dc851df 100644
unsigned int seltags;
unsigned int sellt;
uint32_t tagset[2];
@@ -336,6 +337,7 @@ static void tagmon(const Arg *arg);
@@ -332,6 +333,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
@@ -52,7 +51,7 @@ index dc0437e..dc851df 100644
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -949,6 +951,8 @@ createmon(struct wl_listener *listener, void *data)
@@ -881,6 +883,8 @@ createmon(struct wl_listener *listener, void *data)
wlr_output_state_init(&state);
/* Initialize monitor state using configured rules */
@@ -61,7 +60,7 @@ index dc0437e..dc851df 100644
m->tagset[0] = m->tagset[1] = 1;
for (r = monrules; r < END(monrules); r++) {
if (!r->name || strstr(wlr_output->name, r->name)) {
@@ -2638,7 +2642,7 @@ tagmon(const Arg *arg)
@@ -2572,7 +2576,7 @@ tagmon(const Arg *arg)
void
tile(Monitor *m)
{
@@ -70,7 +69,7 @@ index dc0437e..dc851df 100644
int i, n = 0;
Client *c;
@@ -2647,23 +2651,30 @@ tile(Monitor *m)
@@ -2581,23 +2585,30 @@ tile(Monitor *m)
n++;
if (n == 0)
return;
@@ -78,11 +77,12 @@ index dc0437e..dc851df 100644
+ e = 0;
if (n > m->nmaster)
- mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+ mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0;
- mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0;
+ mw = m->nmaster ? ROUND((m->w.width + gappx*e) * m->mfact) : 0;
else
mw = m->w.width;
- mw = m->w.width;
- i = my = ty = 0;
+ mw = m->w.width - 2*gappx*e + gappx*e;
+ i = 0;
+ my = ty = gappx*e;
wl_list_for_each(c, &clients, link) {
@@ -95,20 +95,21 @@ index dc0437e..dc851df 100644
+ r = MIN(n, m->nmaster) - i;
+ h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
+ resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
+ .width = mw - 2*gappx*e, .height = h}, 0);
+ .width = mw - gappx*e, .height = h}, 0);
+ my += c->geom.height + gappx*e;
} else {
+ r = n - i;
+ h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
- resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
- ty += c->geom.height;
+ .width = m->w.width - mw - gappx*e, .height = h}, 0);
+ r = n - i;
+ h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
+ resize(c, (struct wlr_box){.x = m->w.x + mw + gappx*e, .y = m->w.y + ty,
+ .width = m->w.width - mw - 2*gappx*e, .height = h}, 0);
+ ty += c->geom.height + gappx*e;
}
i++;
}
@@ -2686,6 +2697,13 @@ togglefullscreen(const Arg *arg)
@@ -2620,6 +2631,13 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
@@ -123,5 +124,5 @@ index dc0437e..dc851df 100644
toggletag(const Arg *arg)
{
--
2.45.2
2.44.0
@@ -1,15 +1,16 @@
From 42f97e88bd901d81b81da61c44a790b583706308 Mon Sep 17 00:00:00 2001
From 6b9c8f96a2f1ed3c36d260df1e1dcba24cb98550 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Fri, 5 Jul 2024 11:18:49 -0500
Subject: [PATCH] implement gestures
Date: Thu, 11 Apr 2024 14:46:48 -0500
Subject: [PATCH] add swipe gestures to trigger functions
like libinput-gestures, it supports the following gestures: SWIPE_UP, SWIPE_DOWN, SWIPE_LEFT and SWIPE_RIGHTsupport multiple fingers count in gestures[]support mods in gestures[]
---
config.def.h | 9 +++++++
dwl.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/config.def.h b/config.def.h
index 22d2171..8b75564 100644
index 8847e58..53a8437 100644
--- a/config.def.h
+++ b/config.def.h
@@ -14,6 +14,8 @@ static const float urgentcolor[] = COLOR(0xff0000ff);
@@ -21,7 +22,7 @@ index 22d2171..8b75564 100644
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -174,3 +176,10 @@ static const Button buttons[] = {
@@ -169,3 +171,10 @@ static const Button buttons[] = {
{ MODKEY, BTN_MIDDLE, togglefloating, {0} },
{ MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
};
@@ -33,10 +34,10 @@ index 22d2171..8b75564 100644
+ { MODKEY, SWIPE_DOWN, 3, focusstack, {.i = -1} },
+};
diff --git a/dwl.c b/dwl.c
index ded83e2..5d861e8 100644
index e96ea09..7e8a684 100644
--- a/dwl.c
+++ b/dwl.c
@@ -88,6 +88,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
@@ -87,6 +87,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
#endif
@@ -44,7 +45,7 @@ index ded83e2..5d861e8 100644
typedef union {
int i;
@@ -103,6 +104,14 @@ typedef struct {
@@ -102,6 +103,14 @@ typedef struct {
const Arg arg;
} Button;
@@ -59,7 +60,7 @@ index ded83e2..5d861e8 100644
typedef struct Monitor Monitor;
typedef struct {
/* Must keep these three elements in this order */
@@ -251,6 +260,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
@@ -249,6 +258,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
static void arrangelayers(Monitor *m);
static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data);
@@ -67,7 +68,7 @@ index ded83e2..5d861e8 100644
static void swipe_begin(struct wl_listener *listener, void *data);
static void swipe_update(struct wl_listener *listener, void *data);
static void swipe_end(struct wl_listener *listener, void *data);
@@ -416,6 +426,10 @@ static struct wlr_box sgeom;
@@ -413,6 +423,10 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
@@ -78,7 +79,7 @@ index ded83e2..5d861e8 100644
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -435,6 +449,8 @@ static xcb_atom_t netatom[NetLast];
@@ -432,6 +446,8 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
@@ -87,7 +88,7 @@ index ded83e2..5d861e8 100644
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -657,6 +673,11 @@ swipe_begin(struct wl_listener *listener, void *data)
@@ -641,6 +657,11 @@ swipe_begin(struct wl_listener *listener, void *data)
{
struct wlr_pointer_swipe_begin_event *event = data;
@@ -99,7 +100,7 @@ index ded83e2..5d861e8 100644
// Forward swipe begin event to client
wlr_pointer_gestures_v1_send_swipe_begin(
pointer_gestures,
@@ -671,6 +692,11 @@ swipe_update(struct wl_listener *listener, void *data)
@@ -655,6 +676,11 @@ swipe_update(struct wl_listener *listener, void *data)
{
struct wlr_pointer_swipe_update_event *event = data;
@@ -111,7 +112,7 @@ index ded83e2..5d861e8 100644
// Forward swipe update event to client
wlr_pointer_gestures_v1_send_swipe_update(
pointer_gestures,
@@ -681,11 +707,53 @@ swipe_update(struct wl_listener *listener, void *data)
@@ -665,11 +691,53 @@ swipe_update(struct wl_listener *listener, void *data)
);
}
@@ -122,8 +123,8 @@ index ded83e2..5d861e8 100644
+ uint32_t mods;
+ const Gesture *g;
+ unsigned int motion;
+ unsigned int adx = (int)round(fabs(swipe_dx));
+ unsigned int ady = (int)round(fabs(swipe_dy));
+ unsigned int adx = ROUND(fabs(swipe_dx));
+ unsigned int ady = ROUND(fabs(swipe_dy));
+ int handled = 0;
+
+ if (event->cancelled) {
@@ -166,4 +167,4 @@ index ded83e2..5d861e8 100644
wlr_pointer_gestures_v1_send_swipe_end(
pointer_gestures,
--
2.45.1
2.43.2
@@ -1,6 +1,6 @@
From ac1537f068ea626f1984803ed8db08faf7943b18 Mon Sep 17 00:00:00 2001
From da92f84aa261051b410a0ffcfc80b4d6c8c7dfae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
<leohdz172@protonmail.com>
Date: Sun, 10 Apr 2022 22:38:53 -0500
Subject: [PATCH] hide-behind-fullscreen
MIME-Version: 1.0
@@ -10,64 +10,58 @@ Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 2 +-
dwl.c | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
dwl.c | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171d..1d5a4c84 100644
index a8ed61d..b219c0d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,7 +12,7 @@ static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
-static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
/* 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}; /* You can also use glsl colors */
+static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0}; /* You can also use glsl colors */
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
diff --git a/dwl.c b/dwl.c
index ad21e1ba..f5395fe6 100644
index 10d5a5b..0b8d03a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -505,7 +505,9 @@ applyrules(Client *c)
@@ -455,7 +455,9 @@ applyrules(Client *c)
void
arrange(Monitor *m)
{
- Client *c;
+ LayerSurface *l;
+ Client *c, *sel = focustop(m);
+ Client *c, *sel = focustop(selmon);
+ int i;
wl_list_for_each(c, &clients, link) {
if (c->mon == m) {
wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m));
@@ -468,6 +470,20 @@ arrange(Monitor *m)
if (!m->wlr_output->enabled)
return;
@@ -536,6 +538,26 @@ arrange(Monitor *m)
: c->scene->node.parent);
}
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
+ if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
+ for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--)
+ wl_list_for_each(l, &sel->mon->layers[i], link)
+ wlr_scene_node_set_enabled(&l->scene->node, 0);
+ }
+
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon != m)
+ continue;
+ wl_list_for_each(c, &clients, link)
+ wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
+ || !sel->isfullscreen);
+ }
+ }
+ if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
+ if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m)))
+ for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--)
+ wl_list_for_each(l, &m->layers[i], link)
+ wlr_scene_node_set_enabled(&l->scene->node, 1);
+ }
+ }
+
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
motionnotify(0, NULL, 0, 0, 0, 0);
motionnotify(0);
--
2.48.0
2.43.0
@@ -1,4 +1,4 @@
From 8022376ee59d616831271dbc9f289a8bfd4fedda Mon Sep 17 00:00:00 2001
From 1ba8580b2596c14b9305f1e7cb8d88f54367af59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Sat, 8 Jul 2023 17:25:16 -0600
@@ -9,27 +9,26 @@ Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
dwl.c | 87 +++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 55 insertions(+), 32 deletions(-)
dwl.c | 84 ++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 52 insertions(+), 32 deletions(-)
diff --git a/dwl.c b/dwl.c
index ad21e1ba..cad3b0b2 100644
index 10d5a5b..07659ea 100644
--- a/dwl.c
+++ b/dwl.c
@@ -285,10 +285,11 @@ static Monitor *dirtomon(enum wlr_direction dir);
@@ -267,9 +267,10 @@ static Monitor *dirtomon(enum wlr_direction dir);
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
-static Client *focustop(Monitor *m);
+static Client *focustop(Monitor *m, int onlytiled);
static void fullscreennotify(struct wl_listener *listener, void *data);
static void gpureset(struct wl_listener *listener, void *data);
static void handlesig(int signo);
+static void hidebehindmonocle(Monitor *m);
static void incnmaster(const Arg *arg);
static void inputdevice(struct wl_listener *listener, void *data);
static int keybinding(uint32_t mods, xkb_keysym_t sym);
@@ -518,7 +519,7 @@ arrange(Monitor *m)
@@ -464,7 +465,7 @@ arrange(Monitor *m)
}
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
@@ -38,7 +37,7 @@ index ad21e1ba..cad3b0b2 100644
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
@@ -807,7 +808,7 @@ closemon(Monitor *m)
@@ -700,7 +701,7 @@ closemon(Monitor *m)
if (c->mon == m)
setmon(c, selmon, c->tags);
}
@@ -47,25 +46,25 @@ index ad21e1ba..cad3b0b2 100644
printstatus();
}
@@ -1243,7 +1244,7 @@ void
@@ -1030,7 +1031,7 @@ void
destroydragicon(struct wl_listener *listener, void *data)
{
/* Focus enter isn't sent during drag, so refocus the focused node. */
- focusclient(focustop(selmon), 1);
+ focusclient(focustop(selmon, 0), 1);
motionnotify(0, NULL, 0, 0, 0, 0);
wl_list_remove(&listener->link);
motionnotify(0);
}
@@ -1280,7 +1281,7 @@ destroylock(SessionLock *lock, int unlock)
@@ -1066,7 +1067,7 @@ destroylock(SessionLock *lock, int unlock)
wlr_scene_node_set_enabled(&locked_bg->node, 0);
- focusclient(focustop(selmon), 0);
+ focusclient(focustop(selmon, 0), 0);
motionnotify(0, NULL, 0, 0, 0, 0);
motionnotify(0);
destroy:
@@ -1309,7 +1310,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
@@ -1095,7 +1096,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
surface = wl_container_of(cur_lock->surfaces.next, surface, link);
client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
} else if (!locked) {
@@ -74,15 +73,15 @@ index ad21e1ba..cad3b0b2 100644
} else {
wlr_seat_keyboard_clear_focus(seat);
}
@@ -1420,6 +1421,7 @@ focusclient(Client *c, int lift)
@@ -1186,6 +1187,7 @@ focusclient(Client *c, int lift)
wl_list_insert(&fstack, &c->flink);
selmon = c->mon;
c->isurgent = 0;
+ hidebehindmonocle(c->mon);
client_restack_surface(c);
/* Don't change border color if there is an exclusive focus or we are
* handling a drag operation */
@@ -1473,14 +1475,14 @@ focusmon(const Arg *arg)
@@ -1240,14 +1242,14 @@ focusmon(const Arg *arg)
selmon = dirtomon(arg->i);
while (!selmon->wlr_output->enabled && i++ < nmons);
}
@@ -96,10 +95,10 @@ index ad21e1ba..cad3b0b2 100644
/* Focus the next or previous client (in tiling order) on selmon */
- Client *c, *sel = focustop(selmon);
+ Client *c, *sel = focustop(selmon, 0);
if (!sel || (sel->isfullscreen && !client_has_children(sel)))
if (!sel || sel->isfullscreen)
return;
if (arg->i > 0) {
@@ -1506,12 +1508,15 @@ focusstack(const Arg *arg)
@@ -1273,12 +1275,15 @@ focusstack(const Arg *arg)
* will focus the topmost client of this mon, when actually will
* only return that client */
Client *
@@ -117,8 +116,8 @@ index ad21e1ba..cad3b0b2 100644
}
return NULL;
}
@@ -1557,6 +1562,25 @@ handlesig(int signo)
quit(NULL);
@@ -1311,6 +1316,22 @@ handlesig(int signo)
}
}
+void
@@ -126,11 +125,8 @@ index ad21e1ba..cad3b0b2 100644
+{
+ Client *c;
+ if (m && m->lt[m->sellt]->arrange == monocle) {
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon != m)
+ continue;
+ wl_list_for_each(c, &clients, link)
+ wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
+ }
+
+ c = NULL;
+
@@ -143,7 +139,7 @@ index ad21e1ba..cad3b0b2 100644
void
incnmaster(const Arg *arg)
{
@@ -1695,7 +1719,7 @@ keyrepeat(void *data)
@@ -1449,7 +1470,7 @@ keyrepeat(void *data)
void
killclient(const Arg *arg)
{
@@ -152,7 +148,7 @@ index ad21e1ba..cad3b0b2 100644
if (sel)
client_send_close(sel);
}
@@ -1824,8 +1848,7 @@ monocle(Monitor *m)
@@ -1584,8 +1605,7 @@ monocle(Monitor *m)
}
if (n)
snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
@@ -162,16 +158,16 @@ index ad21e1ba..cad3b0b2 100644
}
void
@@ -2092,7 +2115,7 @@ printstatus(void)
@@ -1813,7 +1833,7 @@ printstatus(void)
if (c->isurgent)
urg |= c->tags;
}
- if ((c = focustop(m))) {
+ if ((c = focustop(m, 0))) {
printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
@@ -2406,7 +2429,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
title = client_get_title(c);
appid = client_get_appid(c);
printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
@@ -2129,7 +2149,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
setfloating(c, c->isfloating);
}
@@ -180,7 +176,7 @@ index ad21e1ba..cad3b0b2 100644
}
void
@@ -2680,12 +2703,12 @@ startdrag(struct wl_listener *listener, void *data)
@@ -2431,12 +2451,12 @@ startdrag(struct wl_listener *listener, void *data)
void
tag(const Arg *arg)
{
@@ -195,7 +191,7 @@ index ad21e1ba..cad3b0b2 100644
arrange(selmon);
printstatus();
}
@@ -2693,7 +2716,7 @@ tag(const Arg *arg)
@@ -2444,7 +2464,7 @@ tag(const Arg *arg)
void
tagmon(const Arg *arg)
{
@@ -204,7 +200,7 @@ index ad21e1ba..cad3b0b2 100644
if (sel)
setmon(sel, dirtomon(arg->i), 0);
}
@@ -2735,7 +2758,7 @@ tile(Monitor *m)
@@ -2485,7 +2505,7 @@ tile(Monitor *m)
void
togglefloating(const Arg *arg)
{
@@ -213,7 +209,7 @@ index ad21e1ba..cad3b0b2 100644
/* return if fullscreen */
if (sel && !sel->isfullscreen)
setfloating(sel, !sel->isfloating);
@@ -2744,7 +2767,7 @@ togglefloating(const Arg *arg)
@@ -2494,7 +2514,7 @@ togglefloating(const Arg *arg)
void
togglefullscreen(const Arg *arg)
{
@@ -222,7 +218,7 @@ index ad21e1ba..cad3b0b2 100644
if (sel)
setfullscreen(sel, !sel->isfullscreen);
}
@@ -2753,12 +2776,12 @@ void
@@ -2503,12 +2523,12 @@ void
toggletag(const Arg *arg)
{
uint32_t newtags;
@@ -237,7 +233,7 @@ index ad21e1ba..cad3b0b2 100644
arrange(selmon);
printstatus();
}
@@ -2771,7 +2794,7 @@ toggleview(const Arg *arg)
@@ -2521,7 +2541,7 @@ toggleview(const Arg *arg)
return;
selmon->tagset[selmon->seltags] = newtagset;
@@ -246,16 +242,16 @@ index ad21e1ba..cad3b0b2 100644
arrange(selmon);
printstatus();
}
@@ -2795,7 +2818,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
@@ -2545,7 +2565,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
arrangelayers(l->mon);
if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
- focusclient(focustop(selmon), 1);
+ focusclient(focustop(selmon, 0), 1);
motionnotify(0, NULL, 0, 0, 0, 0);
motionnotify(0);
}
@@ -2812,7 +2835,7 @@ unmapnotify(struct wl_listener *listener, void *data)
@@ -2562,7 +2582,7 @@ unmapnotify(struct wl_listener *listener, void *data)
if (client_is_unmanaged(c)) {
if (c == exclusive_focus) {
exclusive_focus = NULL;
@@ -264,7 +260,7 @@ index ad21e1ba..cad3b0b2 100644
}
} else {
wl_list_remove(&c->link);
@@ -2893,7 +2916,7 @@ updatemons(struct wl_listener *listener, void *data)
@@ -2643,7 +2663,7 @@ updatemons(struct wl_listener *listener, void *data)
/* Don't move clients to the left output when plugging monitors */
arrange(m);
/* make sure fullscreen clients have the right size */
@@ -273,7 +269,7 @@ index ad21e1ba..cad3b0b2 100644
resize(c, m->m, 0);
/* Try to re-set the gamma LUT when updating monitors,
@@ -2913,7 +2936,7 @@ updatemons(struct wl_listener *listener, void *data)
@@ -2659,7 +2679,7 @@ updatemons(struct wl_listener *listener, void *data)
if (!c->mon && client_surface(c)->mapped)
setmon(c, selmon, c->tags);
}
@@ -282,7 +278,7 @@ index ad21e1ba..cad3b0b2 100644
if (selmon->lock_surface) {
client_notify_enter(selmon->lock_surface->surface,
wlr_seat_get_keyboard(seat));
@@ -2935,7 +2958,7 @@ void
@@ -2681,7 +2701,7 @@ void
updatetitle(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, set_title);
@@ -291,7 +287,7 @@ index ad21e1ba..cad3b0b2 100644
printstatus();
}
@@ -2945,7 +2968,7 @@ urgent(struct wl_listener *listener, void *data)
@@ -2691,7 +2711,7 @@ urgent(struct wl_listener *listener, void *data)
struct wlr_xdg_activation_v1_request_activate_event *event = data;
Client *c = NULL;
toplevel_from_wlr_surface(event->surface, &c, NULL);
@@ -300,7 +296,7 @@ index ad21e1ba..cad3b0b2 100644
return;
c->isurgent = 1;
@@ -2963,7 +2986,7 @@ view(const Arg *arg)
@@ -2709,7 +2729,7 @@ view(const Arg *arg)
selmon->seltags ^= 1; /* toggle sel tagset */
if (arg->ui & TAGMASK)
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
@@ -309,7 +305,7 @@ index ad21e1ba..cad3b0b2 100644
arrange(selmon);
printstatus();
}
@@ -3034,7 +3057,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
@@ -2767,7 +2787,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
void
zoom(const Arg *arg)
{
@@ -318,7 +314,7 @@ index ad21e1ba..cad3b0b2 100644
if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
return;
@@ -3145,7 +3168,7 @@ sethints(struct wl_listener *listener, void *data)
@@ -2880,7 +2900,7 @@ sethints(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, set_hints);
struct wlr_surface *surface = client_surface(c);
@@ -328,5 +324,5 @@ index ad21e1ba..cad3b0b2 100644
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
--
2.48.0
2.43.0
+75
View File
@@ -0,0 +1,75 @@
From 6337cf36554eda98f3d160ef4fdd12eb042f4120 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Sun, 14 Apr 2024 07:58:53 +0300
Subject: [PATCH] port hide vacant tags patch
---
dwl.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/dwl.c b/dwl.c
index 54273ae..7db6273 100644
--- a/dwl.c
+++ b/dwl.c
@@ -651,7 +651,7 @@ void buffer_end_data_ptr_access(struct wlr_buffer *buffer) {
void
buttonpress(struct wl_listener *listener, void *data)
{
- unsigned int i = 0, x = 0;
+ unsigned int i = 0, x = 0, occ = 0;
unsigned int click;
struct wlr_pointer_button_event *event = data;
struct wlr_keyboard *keyboard;
@@ -672,9 +672,17 @@ buttonpress(struct wl_listener *listener, void *data)
if ((node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
(buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
x = selmon->m.x;
- do
- x += TEXTW(tags[i]);
- while (cursor->x >= x && ++i < LENGTH(tags));
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon != selmon)
+ continue;
+ occ |= c->tags == TAGMASK ? 0 : c->tags;
+ }
+ do {
+ /* Do not reserve space for vacant tags */
+ if (!(occ & 1 << i || selmon->tagset[selmon->seltags] & 1 << i))
+ continue;
+ x += TEXTW(tags[i]);
+ } while (cursor->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
arg.ui = 1 << i;
@@ -1379,13 +1387,16 @@ drawbar(Monitor *mon)
wl_list_for_each(c, &clients, link) {
if (c->mon != mon)
continue;
- occ |= c->tags;
+ occ |= c->tags == TAGMASK ? 0 : c->tags;
if (c->isurgent)
urg |= c->tags;
}
c = focustop(mon);
x = 0;
for (i = 0; i < LENGTH(tags); i++) {
+ /* Do not draw vacant tags */
+ if(!(occ & 1 << i || mon->tagset[mon->seltags] & 1 << i))
+ continue;
w = TEXTW(tags[i]);
sel = mon->tagset[mon->seltags] & 1 << i;
@@ -1393,10 +1404,6 @@ drawbar(Monitor *mon)
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg),
urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
- if (occ & 1 << i)
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, sel,
- urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg));
-
x += w;
}
--
2.44.0
+48 -51
View File
@@ -1,40 +1,37 @@
From 6c6d655b68770ce82a24fde9b58c4d97b672553a Mon Sep 17 00:00:00 2001
From 5bbb9d70ab0a8322d1556ac0983eb3140b1c5dcd Mon Sep 17 00:00:00 2001
From: choc <notchoc@proton.me>
Date: Mon, 23 Oct 2023 10:35:17 +0800
Subject: [PATCH] implement dwl-ipc-unstable-v2
https://codeberg.org/dwl/dwl-patches/wiki/ipc
---
Makefile | 14 +-
Makefile | 13 +-
config.def.h | 1 +
dwl.c | 257 ++++++++++++++++++++++++++----
protocols/dwl-ipc-unstable-v2.xml | 181 +++++++++++++++++++++
4 files changed, 419 insertions(+), 34 deletions(-)
4 files changed, 415 insertions(+), 37 deletions(-)
create mode 100644 protocols/dwl-ipc-unstable-v2.xml
diff --git a/Makefile b/Makefile
index 8db7409..a79a080 100644
index a67fdd3..2b45b2c 100644
--- a/Makefile
+++ b/Makefile
@@ -17,12 +17,14 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEV
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
@@ -14,10 +14,11 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
all: dwl
-dwl: dwl.o util.o
- $(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
- $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
-dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h
+dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
+ $(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
- wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
+ wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
+ dwl-ipc-unstable-v2-protocol.h
+ $(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
+dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h dwl-ipc-unstable-v2-protocol.h
util.o: util.c util.h
+dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.c dwl-ipc-unstable-v2-protocol.h
# 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
@@ -45,6 +47,12 @@ wlr-output-power-management-unstable-v1-protocol.h:
@@ -37,6 +38,12 @@ wlr-layer-shell-unstable-v1-protocol.h:
xdg-shell-protocol.h:
$(WAYLAND_SCANNER) server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
@@ -48,10 +45,10 @@ index 8db7409..a79a080 100644
config.h:
cp config.def.h $@
diff --git a/config.def.h b/config.def.h
index 22d2171..1593033 100644
index 9009517..3467fed 100644
--- a/config.def.h
+++ b/config.def.h
@@ -127,6 +127,7 @@ static const Key keys[] = {
@@ -122,6 +122,7 @@ static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
@@ -60,10 +57,10 @@ index 22d2171..1593033 100644
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
diff --git a/dwl.c b/dwl.c
index 8a587d1..7a4949b 100644
index d508d79..5f8af37 100644
--- a/dwl.c
+++ b/dwl.c
@@ -68,6 +68,7 @@
@@ -64,6 +64,7 @@
#include <xcb/xcb_icccm.h>
#endif
@@ -71,7 +68,7 @@ index 8a587d1..7a4949b 100644
#include "util.h"
/* macros */
@@ -144,6 +145,12 @@ typedef struct {
@@ -141,6 +142,12 @@ typedef struct {
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -84,7 +81,7 @@ index 8a587d1..7a4949b 100644
typedef struct {
uint32_t mod;
xkb_keysym_t keysym;
@@ -189,6 +196,7 @@ typedef struct {
@@ -186,6 +193,7 @@ typedef struct {
struct Monitor {
struct wl_list link;
@@ -92,9 +89,9 @@ index 8a587d1..7a4949b 100644
struct wlr_output *wlr_output;
struct wlr_scene_output *scene_output;
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
@@ -286,6 +294,17 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
@@ -278,6 +286,17 @@ static void destroypointerconstraint(struct wl_listener *listener, void *data);
static void destroysessionlock(struct wl_listener *listener, void *data);
static void destroysessionmgr(struct wl_listener *listener, void *data);
static void destroykeyboardgroup(struct wl_listener *listener, void *data);
static Monitor *dirtomon(enum wlr_direction dir);
+static void dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id);
+static void dwl_ipc_manager_destroy(struct wl_resource *resource);
@@ -110,7 +107,7 @@ index 8a587d1..7a4949b 100644
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
@@ -338,6 +357,7 @@ static void startdrag(struct wl_listener *listener, void *data);
@@ -330,6 +349,7 @@ static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
@@ -118,7 +115,7 @@ index 8a587d1..7a4949b 100644
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
@@ -411,6 +431,9 @@ static struct wlr_box sgeom;
@@ -405,6 +425,9 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
@@ -128,7 +125,7 @@ index 8a587d1..7a4949b 100644
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -703,6 +726,10 @@ cleanupmon(struct wl_listener *listener, void *data)
@@ -684,6 +707,10 @@ cleanupmon(struct wl_listener *listener, void *data)
LayerSurface *l, *tmp;
size_t i;
@@ -139,7 +136,7 @@ index 8a587d1..7a4949b 100644
/* m->layers[i] are intentionally not unlinked */
for (i = 0; i < LENGTH(m->layers); i++) {
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
@@ -983,6 +1010,8 @@ createmon(struct wl_listener *listener, void *data)
@@ -876,6 +903,8 @@ createmon(struct wl_listener *listener, void *data)
m = wlr_output->data = ecalloc(1, sizeof(*m));
m->wlr_output = wlr_output;
@@ -148,7 +145,7 @@ index 8a587d1..7a4949b 100644
for (i = 0; i < LENGTH(m->layers); i++)
wl_list_init(&m->layers[i]);
@@ -1334,6 +1363,192 @@ dirtomon(enum wlr_direction dir)
@@ -1233,6 +1262,190 @@ dirtomon(enum wlr_direction dir)
return selmon;
}
@@ -247,8 +244,8 @@ index 8a587d1..7a4949b 100644
+ appid = focused ? client_get_appid(focused) : "";
+
+ zdwl_ipc_output_v2_send_layout(ipc_output->resource, monitor->lt[monitor->sellt] - layouts);
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title);
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid);
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title ? title : broken);
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid ? appid : broken);
+ zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, monitor->ltsymbol);
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, focused ? focused->isfullscreen : 0);
@@ -281,8 +278,7 @@ index 8a587d1..7a4949b 100644
+ return;
+
+ selected_client->tags = newtags;
+ if (selmon == monitor)
+ focusclient(focustop(monitor), 1);
+ focusclient(focustop(selmon), 1);
+ arrange(selmon);
+ printstatus();
+}
@@ -326,7 +322,6 @@ index 8a587d1..7a4949b 100644
+ monitor->seltags ^= 1;
+
+ monitor->tagset[monitor->seltags] = newtags;
+ if (selmon == monitor)
+ focusclient(focustop(monitor), 1);
+ arrange(monitor);
+ printstatus();
@@ -341,12 +336,13 @@ index 8a587d1..7a4949b 100644
void
focusclient(Client *c, int lift)
{
@@ -2033,38 +2248,9 @@ void
@@ -1905,41 +2118,9 @@ void
printstatus(void)
{
Monitor *m = NULL;
- Client *c;
- uint32_t occ, urg, sel;
- const char *appid, *title;
- wl_list_for_each(m, &mons, link) {
- occ = urg = 0;
@@ -358,8 +354,10 @@ index 8a587d1..7a4949b 100644
- urg |= c->tags;
- }
- if ((c = focustop(m))) {
- printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
- printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
- title = client_get_title(c);
- appid = client_get_appid(c);
- printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
- printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
- printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
- printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
- sel = c->tags;
@@ -382,16 +380,15 @@ index 8a587d1..7a4949b 100644
}
void
@@ -2584,6 +2770,8 @@ setup(void)
LISTEN_STATIC(&output_mgr->events.apply, outputmgrapply);
@@ -2502,6 +2683,7 @@ setup(void)
LISTEN_STATIC(&output_mgr->events.test, outputmgrtest);
wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
+ wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, dwl_ipc_manager_bind);
+
/* Make sure XWayland clients don't connect to the parent X server,
* e.g when running in the x11 backend or the wayland backend and the
* compositor has Xwayland support */
@@ -2681,6 +2869,13 @@ tile(Monitor *m)
@@ -2600,6 +2782,13 @@ tile(Monitor *m)
}
}
@@ -417,7 +414,7 @@ index 0000000..0a6e7e5
+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-process-communication about dwl's state">
+ <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
@@ -437,7 +434,7 @@ index 0000000..0a6e7e5
+ 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 receive the dwl_ipc_manager.tags and dwl_ipc_manager.layout events.
+ 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>
+
@@ -449,8 +446,8 @@ index 0000000..0a6e7e5
+ </request>
+
+ <request name="get_output">
+ <description summary="get a dwl_ipc_output for a wl_output">
+ Get a dwl_ipc_output for the specified wl_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"/>
@@ -459,7 +456,7 @@ index 0000000..0a6e7e5
+ <event name="tags">
+ <description summary="Announces tag amount">
+ This event is sent after binding.
+ A roundtrip after binding guarantees the client received all tags.
+ A roundtrip after binding guarantees the client recieved all tags.
+ </description>
+ <arg name="amount" type="uint"/>
+ </event>
@@ -467,7 +464,7 @@ index 0000000..0a6e7e5
+ <event name="layout">
+ <description summary="Announces a layout">
+ This event is sent after binding.
+ A roundtrip after binding guarantees the client received all layouts.
+ A roundtrip after binding guarantees the client recieved all layouts.
+ </description>
+ <arg name="name" type="string"/>
+ </event>
@@ -491,13 +488,13 @@ index 0000000..0a6e7e5
+ </enum>
+
+ <request name="release" type="destructor">
+ <description summary="release dwl_ipc_output">
+ <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 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>
@@ -544,7 +541,7 @@ index 0000000..0a6e7e5
+ <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 precedence when displaying.
+ 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"/>
@@ -573,7 +570,7 @@ index 0000000..0a6e7e5
+
+ <request name="set_layout">
+ <description summary="Set the layout of this output"/>
+ <arg name="index" type="uint" summary="index of a layout received by dwl_ipc_manager.layout"/>
+ <arg name="index" type="uint" summary="index of a layout recieved by dwl_ipc_manager.layout"/>
+ </request>
+
+ <!-- Version 2 -->
@@ -593,5 +590,5 @@ index 0000000..0a6e7e5
+ </interface>
+</protocol>
--
2.43.0
2.44.0
+187
View File
@@ -0,0 +1,187 @@
From a0c758953fe0cbb20ea74d0acfa3e44b8173d12d Mon Sep 17 00:00:00 2001
From: ForzCross <forzcross@gmail.com>
Date: Sun, 21 Jan 2024 15:52:31 +0300
Subject: [PATCH] Add per client keyboard layout and status bar info
---
config.def.h | 3 +++
dwl.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 9009517..81bb10d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,9 @@ static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+/* keyboard layout change notification for status bar */
+static const char kblayout_file[] = "/tmp/dwl-keymap";
+static const char *kblayout_cmd[] = {"pkill", "-RTMIN+3", "someblocks", NULL};
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
diff --git a/dwl.c b/dwl.c
index bf02a6d..17c8fa4 100644
--- a/dwl.c
+++ b/dwl.c
@@ -135,6 +135,7 @@ typedef struct {
uint32_t tags;
int isfloating, isurgent, isfullscreen;
uint32_t resize; /* configure serial of a pending resize */
+ xkb_layout_index_t layout_idx;
} Client;
typedef struct {
@@ -155,6 +156,7 @@ typedef struct {
struct wl_listener modifiers;
struct wl_listener key;
+ xkb_layout_index_t layout_idx;
} KeyboardGroup;
typedef struct {
@@ -273,6 +275,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
static void handlesig(int signo);
static void incnmaster(const Arg *arg);
static void inputdevice(struct wl_listener *listener, void *data);
+static void kblayoutnotify(KeyboardGroup *kb, int update);
static int keybinding(uint32_t mods, xkb_keysym_t sym);
static void keypress(struct wl_listener *listener, void *data);
static void keypressmod(struct wl_listener *listener, void *data);
@@ -385,6 +388,8 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
+xkb_layout_index_t status_layout_idx = -1;
+
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -772,6 +777,7 @@ createkeyboard(struct wlr_keyboard *keyboard)
/* Add the new keyboard to the group */
wlr_keyboard_group_add_keyboard(kb_group.wlr_group, keyboard);
+ kblayoutnotify(&kb_group, 1);
}
void
@@ -927,6 +933,7 @@ createnotify(struct wl_listener *listener, void *data)
struct wlr_xdg_surface *xdg_surface = data;
Client *c = NULL;
LayerSurface *l = NULL;
+ struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_xdg_popup *popup = xdg_surface->popup;
@@ -949,6 +956,9 @@ createnotify(struct wl_listener *listener, void *data)
c = xdg_surface->data = ecalloc(1, sizeof(*c));
c->surface.xdg = xdg_surface;
c->bw = borderpx;
+ c->layout_idx = kb
+ ? xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_EFFECTIVE)
+ : 0;
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
@@ -1165,6 +1175,9 @@ focusclient(Client *c, int lift)
int unused_lx, unused_ly, old_client_type;
Client *old_c = NULL;
LayerSurface *old_l = NULL;
+ xkb_mod_mask_t mdepr, mlatc, mlock;
+ xkb_layout_index_t ldepr, llatc, llock;
+ struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
if (locked)
return;
@@ -1217,6 +1230,17 @@ focusclient(Client *c, int lift)
}
printstatus();
+ /* Update keyboard layout */
+ if (kb) {
+ mdepr = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_DEPRESSED);
+ mlatc = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_LATCHED);
+ mlock = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_LOCKED);
+ ldepr = xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_DEPRESSED);
+ llatc = xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_LATCHED);
+ llock = c ? c->layout_idx : 0;
+ xkb_state_update_mask(kb->xkb_state, mdepr, mlatc, mlock, ldepr, llatc, llock);
+ }
+
if (!c) {
/* With no client, all we have left is to clear focus */
wlr_seat_keyboard_notify_clear_focus(seat);
@@ -1227,7 +1251,7 @@ focusclient(Client *c, int lift)
motionnotify(0);
/* Have a client, so focus its top-level wlr_surface */
- client_notify_enter(client_surface(c), wlr_seat_get_keyboard(seat));
+ client_notify_enter(client_surface(c), kb);
/* Activate the new client */
client_activate_surface(client_surface(c), 1);
@@ -1352,6 +1376,41 @@ inputdevice(struct wl_listener *listener, void *data)
wlr_seat_set_capabilities(seat, caps);
}
+void
+kblayoutnotify(KeyboardGroup *kb, int update)
+{
+ FILE *f;
+ Client *c;
+ xkb_layout_index_t old = kb->layout_idx;
+
+ if (update) {
+ kb->layout_idx = xkb_state_serialize_layout(kb->wlr_group->keyboard.xkb_state,
+ XKB_STATE_LAYOUT_EFFECTIVE);
+
+ // Update client layout
+ if (kb->layout_idx != old && (c = focustop(selmon)))
+ c->layout_idx = kb->layout_idx;
+ }
+
+ // If layout did not change, do nothing
+ if (status_layout_idx == kb->layout_idx)
+ return;
+ status_layout_idx = kb->layout_idx;
+
+ // Save current layout to kblayout_file
+ if (*kblayout_file && (f = fopen(kblayout_file, "w"))) {
+ fputs(xkb_keymap_layout_get_name(kb->wlr_group->keyboard.keymap,
+ kb->layout_idx), f);
+ fclose(f);
+ }
+
+ // Run kblayout_cmd
+ if (kblayout_cmd[0] && fork() == 0) {
+ execvp(kblayout_cmd[0], (char *const *)kblayout_cmd);
+ die("dwl: execvp %s failed:", kblayout_cmd[0]);
+ }
+}
+
int
keybinding(uint32_t mods, xkb_keysym_t sym)
{
@@ -1391,6 +1450,8 @@ keypress(struct wl_listener *listener, void *data)
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
+ kblayoutnotify(group, 0);
+
/* On _press_ if there is no active screen locker,
* attempt to process a compositor keybinding. */
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
@@ -1429,6 +1490,8 @@ keypressmod(struct wl_listener *listener, void *data)
/* Send modifiers to the client. */
wlr_seat_keyboard_notify_modifiers(seat,
&group->wlr_group->keyboard.modifiers);
+
+ kblayoutnotify(group, 1);
}
int
--
2.43.0
+598
View File
@@ -0,0 +1,598 @@
From 8e58ce22afe6a7cca34ff69d8862c89497156f40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Fri, 4 Jun 2021 16:51:01 -0500
Subject: [PATCH 1/2] allow use keycodes instead keysyms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 85 +++++++++---------
dwl.c | 35 +++-----
keys.h | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 297 insertions(+), 65 deletions(-)
create mode 100644 keys.h
diff --git a/config.def.h b/config.def.h
index a8ed61d..40e13af 100644
--- a/config.def.h
+++ b/config.def.h
@@ -104,11 +104,11 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT
-#define TAGKEYS(KEY,SKEY,TAG) \
+#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
- { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
+ { MODKEY|WLR_MODIFIER_SHIFT, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,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 } }
@@ -117,51 +117,52 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
static const char *termcmd[] = { "foot", NULL };
static const char *menucmd[] = { "bemenu-run", NULL };
+#include "keys.h"
static const Key keys[] = {
- /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
- /* modifier key function argument */
- { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
- { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
- { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
- { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
- { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
- { MODKEY, XKB_KEY_Return, zoom, {0} },
- { MODKEY, XKB_KEY_Tab, view, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
- { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
- { MODKEY, XKB_KEY_space, setlayout, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
- { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
- { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
- { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
- TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
- TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
- TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
- TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
- TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
- TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
- TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
- TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
- TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
+ /* modifier key function argument */
+ { MODKEY, Key_p, spawn, {.v = menucmd} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_Return, spawn, {.v = termcmd} },
+ { MODKEY, Key_j, focusstack, {.i = +1} },
+ { MODKEY, Key_k, focusstack, {.i = -1} },
+ { MODKEY, Key_i, incnmaster, {.i = +1} },
+ { MODKEY, Key_d, incnmaster, {.i = -1} },
+ { MODKEY, Key_h, setmfact, {.f = -0.05} },
+ { MODKEY, Key_l, setmfact, {.f = +0.05} },
+ { MODKEY, Key_Return, zoom, {0} },
+ { MODKEY, Key_Tab, view, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_c, killclient, {0} },
+ { MODKEY, Key_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, Key_f, setlayout, {.v = &layouts[1]} },
+ { MODKEY, Key_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, Key_space, setlayout, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_space, togglefloating, {0} },
+ { MODKEY, Key_e, togglefullscreen, {0} },
+ { MODKEY, Key_0, view, {.ui = ~0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_0, tag, {.ui = ~0} },
+ { MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
+ TAGKEYS( Key_1, 0),
+ TAGKEYS( Key_2, 1),
+ TAGKEYS( Key_3, 2),
+ TAGKEYS( Key_4, 3),
+ TAGKEYS( Key_5, 4),
+ TAGKEYS( Key_6, 5),
+ TAGKEYS( Key_7, 6),
+ TAGKEYS( Key_8, 7),
+ TAGKEYS( Key_9, 8),
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_q, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
- { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
+ { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,Key_BackSpace, quit, {0} },
+#define CHVT(KEY,n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT, KEY, chvt, {.ui = (n)} }
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
* do not remove them.
*/
-#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),
+ CHVT(Key_F1, 1), CHVT(Key_F2, 2), CHVT(Key_F3, 3), CHVT(Key_F4, 4),
+ CHVT(Key_F5, 5), CHVT(Key_F6, 6), CHVT(Key_F7, 7), CHVT(Key_F8, 8),
+ CHVT(Key_F9, 9), CHVT(Key_F10, 10), CHVT(Key_F11, 11), CHVT(Key_F12, 12),
};
static const Button buttons[] = {
diff --git a/dwl.c b/dwl.c
index 10d5a5b..33fb251 100644
--- a/dwl.c
+++ b/dwl.c
@@ -138,7 +138,7 @@ typedef struct {
typedef struct {
uint32_t mod;
- xkb_keysym_t keysym;
+ xkb_keycode_t keycode;
void (*func)(const Arg *);
const Arg arg;
} Key;
@@ -147,9 +147,8 @@ typedef struct {
struct wl_list link;
struct wlr_keyboard_group *wlr_group;
- int nsyms;
- const xkb_keysym_t *keysyms; /* invalid if nsyms == 0 */
- uint32_t mods; /* invalid if nsyms == 0 */
+ xkb_keycode_t keycode;
+ uint32_t mods; /* invalid if keycode == 0 */
struct wl_event_source *key_repeat_source;
struct wl_listener modifiers;
@@ -272,7 +271,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
static void handlesig(int signo);
static void incnmaster(const Arg *arg);
static void inputdevice(struct wl_listener *listener, void *data);
-static int keybinding(uint32_t mods, xkb_keysym_t sym);
+static int keybinding(uint32_t mods, xkb_keycode_t keycode);
static void keypress(struct wl_listener *listener, void *data);
static void keypressmod(struct wl_listener *listener, void *data);
static int keyrepeat(void *data);
@@ -1351,7 +1350,7 @@ inputdevice(struct wl_listener *listener, void *data)
}
int
-keybinding(uint32_t mods, xkb_keysym_t sym)
+keybinding(uint32_t mods, xkb_keycode_t keycode)
{
/*
* Here we handle compositor keybindings. This is when the compositor is
@@ -1361,7 +1360,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
const Key *k;
for (k = keys; k < END(keys); k++) {
if (CLEANMASK(mods) == CLEANMASK(k->mod)
- && sym == k->keysym && k->func) {
+ && keycode == k->keycode && k->func) {
k->func(&k->arg);
return 1;
}
@@ -1372,17 +1371,12 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
void
keypress(struct wl_listener *listener, void *data)
{
- int i;
/* This event is raised when a key is pressed or released. */
KeyboardGroup *group = wl_container_of(listener, group, key);
struct wlr_keyboard_key_event *event = data;
/* Translate libinput keycode -> xkbcommon */
uint32_t keycode = event->keycode + 8;
- /* Get a list of keysyms based on the keymap for this keyboard */
- const xkb_keysym_t *syms;
- int nsyms = xkb_state_key_get_syms(
- group->wlr_group->keyboard.xkb_state, keycode, &syms);
int handled = 0;
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
@@ -1391,19 +1385,16 @@ keypress(struct wl_listener *listener, void *data)
/* On _press_ if there is no active screen locker,
* attempt to process a compositor keybinding. */
- if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
- for (i = 0; i < nsyms; i++)
- handled = keybinding(mods, syms[i]) || handled;
- }
+ if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
+ handled = keybinding(mods, keycode);
if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
group->mods = mods;
- group->keysyms = syms;
- group->nsyms = nsyms;
+ group->keycode = keycode;
wl_event_source_timer_update(group->key_repeat_source,
group->wlr_group->keyboard.repeat_info.delay);
} else {
- group->nsyms = 0;
+ group->keycode = 0;
wl_event_source_timer_update(group->key_repeat_source, 0);
}
@@ -1433,15 +1424,13 @@ int
keyrepeat(void *data)
{
KeyboardGroup *group = data;
- int i;
- if (!group->nsyms || group->wlr_group->keyboard.repeat_info.rate <= 0)
+ if (!group->keycode || group->wlr_group->keyboard.repeat_info.rate <= 0)
return 0;
wl_event_source_timer_update(group->key_repeat_source,
1000 / group->wlr_group->keyboard.repeat_info.rate);
- for (i = 0; i < group->nsyms; i++)
- keybinding(group->mods, group->keysyms[i]);
+ keybinding(group->mods, group->keycode);
return 0;
}
diff --git a/keys.h b/keys.h
new file mode 100644
index 0000000..e732f80
--- /dev/null
+++ b/keys.h
@@ -0,0 +1,242 @@
+/* You can use the macros within this file
+ * instead of search the keycodes yourself
+ * with wev or something like that
+ * Also probably you search this:
+ * Key_XF86AudioMute
+ * Key_XF86AudioLowerVolume
+ * Key_XF86AudioRaiseVolume
+ * Key_XF86MonBrightnessDown
+ * Key_XF86MonBrightnessUp
+*/
+
+#define Key_Escape 9
+#define Key_1 10
+#define Key_2 11
+#define Key_3 12
+#define Key_4 13
+#define Key_5 14
+#define Key_6 15
+#define Key_7 16
+#define Key_8 17
+#define Key_9 18
+#define Key_0 19
+#define Key_minus 20
+#define Key_equal 21
+#define Key_BackSpace 22
+#define Key_Tab 23
+#define Key_q 24
+#define Key_w 25
+#define Key_e 26
+#define Key_r 27
+#define Key_t 28
+#define Key_y 29
+#define Key_u 30
+#define Key_i 31
+#define Key_o 32
+#define Key_p 33
+#define Key_bracketleft 34
+#define Key_bracketright 35
+#define Key_Return 36
+#define Key_Control_L 37
+#define Key_a 38
+#define Key_s 39
+#define Key_d 40
+#define Key_f 41
+#define Key_g 42
+#define Key_h 43
+#define Key_j 44
+#define Key_k 45
+#define Key_l 46
+#define Key_semicolon 47
+#define Key_apostrophe 48
+#define Key_grave 49
+#define Key_Shift_L 50
+#define Key_backslash 51
+#define Key_z 52
+#define Key_x 53
+#define Key_c 54
+#define Key_v 55
+#define Key_b 56
+#define Key_n 57
+#define Key_m 58
+#define Key_comma 59
+#define Key_period 60
+#define Key_slash 61
+#define Key_Shift_R 62
+#define Key_KP_Multiply 63
+#define Key_Alt_L 64
+#define Key_space 65
+#define Key_Caps_Lock 66
+#define Key_F1 67
+#define Key_F2 68
+#define Key_F3 69
+#define Key_F4 70
+#define Key_F5 71
+#define Key_F6 72
+#define Key_F7 73
+#define Key_F8 74
+#define Key_F9 75
+#define Key_F10 76
+#define Key_Num_Lock 77
+#define Key_Scroll_Lock 78
+#define Key_KP_Home 79
+#define Key_KP_7 Key_KP_Home
+#define Key_KP_Up 80
+#define Key_KP_8 Key_KP_Up
+#define Key_KP_Prior 81
+#define Key_KP_9 Key_KP_Prior
+#define Key_KP_Subtract 82
+#define Key_KP_Left 83
+#define Key_KP_4 Key_KP_Left
+#define Key_KP_Begin 84
+#define Key_KP_5 Key_KP_Begin
+#define Key_KP_Right 85
+#define Key_KP_6 Key_KP_Right
+#define Key_KP_Add 86
+#define Key_KP_End 87
+#define Key_KP_1 Key_KP_End
+#define Key_KP_Down 88
+#define Key_KP_2 Key_KP_Down
+#define Key_KP_Next 89
+#define Key_KP_3 Key_KP_Next
+#define Key_KP_Insert 90
+#define Key_KP_0 Key_KP_Insert
+#define Key_KP_Delete 91
+#define Key_KP_Period Key_KP_Insert
+#define Key_ISO_Level3_Shift 92
+#define Key_less 94
+#define Key_F11 95
+#define Key_F12 96
+#define Key_Katakana 98
+#define Key_Hiragana 99
+#define Key_Henkan_Mode 100
+#define Key_Hiragana_Katakana 101
+#define Key_Muhenkan 102
+#define Key_KP_Enter 104
+#define Key_Control_R 105
+#define Key_KP_Divide 106
+#define Key_Print 107
+#define Key_Alt_R 108
+#define Key_Linefeed 109
+#define Key_Home 110
+#define Key_Up 111
+#define Key_Prior 112
+#define Key_Left 113
+#define Key_Right 114
+#define Key_End 115
+#define Key_Down 116
+#define Key_Next 117
+#define Key_Insert 118
+#define Key_Delete 119
+#define Key_XF86AudioMute 121
+#define Key_XF86AudioLowerVolume 122
+#define Key_XF86AudioRaiseVolume 123
+#define Key_XF86PowerOff 124
+#define Key_KP_Equal 125
+#define Key_plusminus 126
+#define Key_Pause 127
+#define Key_XF86LaunchA 128
+#define Key_KP_Decimal 129
+#define Key_Hangul 130
+#define Key_Hangul_Hanja 131
+#define Key_Super_L 133
+#define Key_Super_R 134
+#define Key_Menu 135
+#define Key_Cancel 136
+#define Key_Redo 137
+#define Key_SunProps 138
+#define Key_Undo 139
+#define Key_SunFront 140
+#define Key_XF86Copy 141
+#define Key_XF86Open 142
+#define Key_XF86Paste 143
+#define Key_Find 144
+#define Key_XF86Cut 145
+#define Key_Help 146
+#define Key_XF86MenuKB 147
+#define Key_XF86Calculator 148
+#define Key_XF86Sleep 150
+#define Key_XF86WakeUp 151
+#define Key_XF86Explorer 152
+#define Key_XF86Send 153
+#define Key_XF86Xfer 155
+#define Key_XF86Launch1 156
+#define Key_XF86Launch2 157
+#define Key_XF86WWW 158
+#define Key_XF86DOS 159
+#define Key_XF86ScreenSaver 160
+#define Key_XF86RotateWindows 161
+#define Key_XF86TaskPane 162
+#define Key_XF86Mail 163
+#define Key_XF86Favorites 164
+#define Key_XF86MyComputer 165
+#define Key_XF86Back 166
+#define Key_XF86Forward 167
+#define Key_XF86Eject1 169
+#define Key_XF86Eject2 170
+#define Key_XF86AudioNext 171
+#define Key_XF86AudioPlay 172
+#define Key_XF86AudioPrev 173
+#define Key_XF86AudioStop 174
+#define Key_XF86AudioRecord 175
+#define Key_XF86AudioRewind 176
+#define Key_XF86Phone 177
+#define Key_XF86Tools 179
+#define Key_XF86HomePage 180
+#define Key_XF86Reload 181
+#define Key_XF86Close 182
+#define Key_XF86ScrollUp 185
+#define Key_XF86ScrollDown 186
+#define Key_parenleft 187
+#define Key_parenright 188
+#define Key_XF86New 189
+#define Key_Redo2 190
+#define Key_XF86Tools2 191
+#define Key_XF86Launch5 192
+#define Key_XF86Launch6 193
+#define Key_XF86Launch7 194
+#define Key_XF86Launch8 195
+#define Key_XF86Launch9 196
+#define Key_XF86AudioMicMute 198
+#define Key_XF86TouchpadToggle 199
+#define Key_XF86TouchpadOn 200
+#define Key_XF86TouchpadOff 201
+#define Key_Mode_switch 203
+#define Key_XF86AudioPlay2 208
+#define Key_XF86AudioPause 209
+#define Key_XF86Launch3 210
+#define Key_XF86Launch4 211
+#define Key_XF86LaunchB 212
+#define Key_XF86Suspend 213
+#define Key_XF86Close2 214
+#define Key_XF86AudioPlay3 215
+#define Key_XF86AudioForward 216
+#define Key_Print2 218
+#define Key_XF86WebCam 220
+#define Key_XF86AudioPreset 221
+#define Key_XF86Mail2 223
+#define Key_XF86Messenger 224
+#define Key_XF86Search 225
+#define Key_XF86Go 226
+#define Key_XF86Finance 227
+#define Key_XF86Game 228
+#define Key_XF86Shop 229
+#define Key_Cancel2 231
+#define Key_XF86MonBrightnessDown 232
+#define Key_XF86MonBrightnessUp 233
+#define Key_XF86AudioMedia 234
+#define Key_XF86Display 235
+#define Key_XF86KbdLightOnOff 236
+#define Key_XF86KbdBrightnessDown 237
+#define Key_XF86KbdBrightnessUp 238
+#define Key_XF86Send2 239
+#define Key_XF86Reply 240
+#define Key_XF86MailForward 241
+#define Key_XF86Save 242
+#define Key_XF86Documents 243
+#define Key_XF86Battery 244
+#define Key_XF86Bluetooth 245
+#define Key_XF86WLAN 246
+#define Key_XF86MonBrightnessCycle 251
+#define Key_XF86WWAN 254
+#define Key_XF86RFKill 255
--
2.43.0
From 9d24eaa9b2bd2c87c975882cd0b2adba978db564 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@proton.me>
Date: Sun, 19 Mar 2023 15:50:07 -0600
Subject: [PATCH 2/2] add program to generate keys.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
generate-keys.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 generate-keys.c
diff --git a/generate-keys.c b/generate-keys.c
new file mode 100644
index 0000000..83458fb
--- /dev/null
+++ b/generate-keys.c
@@ -0,0 +1,82 @@
+/******************************************************************
+ * Copyright 2023 Leonardo Hernández Hernández
+ *
+ * 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
+ * OPEN GROUP 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.
+ *
+ ******************************************************************/
+
+/* cc -lxkbcommon -o generate-keys generate-keys.c */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <xkbcommon/xkbcommon.h>
+
+int
+main(void)
+{
+ struct xkb_context *context;
+ /* Allow generate keys with a different layout and variant.
+ * You can also use XKB_DEFAULT_* environmental variables and let this as is */
+ struct xkb_rule_names rules = {
+ 0
+ };
+ struct xkb_keymap *keymap;
+ struct xkb_state *state;
+ xkb_keycode_t keycode, min_keycode, max_keycode;
+ int i, nsyms;
+ const xkb_keysym_t *syms;
+ char keyname[64];
+ FILE *f = fopen("keys.h", "w");
+ if (!f) {
+ perror("Couldn't open keys.h");
+ return EXIT_FAILURE;
+ }
+
+ if (!(context = xkb_context_new(XKB_CONTEXT_NO_FLAGS))) {
+ fputs("Couldn't create xkbcommon context\n", stderr);
+ return EXIT_FAILURE;
+ }
+
+ if (!(keymap = xkb_keymap_new_from_names(context, &rules,
+ XKB_KEYMAP_COMPILE_NO_FLAGS))) {
+ fputs("Couldn't create xkbcommon keymap\n", stderr);
+ return EXIT_FAILURE;
+ }
+
+ if (!(state = xkb_state_new(keymap))) {
+ fputs("Couldn't create xkbcommon state\n", stderr);
+ return EXIT_FAILURE;
+ }
+
+ min_keycode = xkb_keymap_min_keycode(keymap);
+ max_keycode = xkb_keymap_max_keycode(keymap);
+
+ for (keycode = min_keycode; keycode <= max_keycode; keycode++) {
+ nsyms = xkb_state_key_get_syms(state, keycode, &syms);
+ for (i = 0; i < nsyms; i++) {
+ xkb_keysym_get_name(syms[i], keyname, sizeof(keyname) / sizeof(keyname[0]));
+ fprintf(f, "#define Key_%-24s %d\n", keyname, keycode);
+ }
+ }
+
+ xkb_state_unref(state);
+ xkb_keymap_unref(keymap);
+ xkb_context_unref(context);
+}
--
2.43.0
@@ -1,17 +1,23 @@
From 44dfe863a00f4bdc646df3d761ac97711dd2107a Mon Sep 17 00:00:00 2001
From: A Frederick Christensen <dwl@ivories.org>
Date: Thu, 26 Feb 2026 22:12:53 -0600
Subject: [PATCH] Apply touch-input patch
From adc8734017644f44443db30e976cf03147c7c3c4 Mon Sep 17 00:00:00 2001
From: Micah N Gorrell <m@minego.net>
Date: Fri, 9 Feb 2024 17:08:20 -0700
Subject: [PATCH 1/2] Add support for touch screen input devices, and send the
appropriate events to clients
Send notification of touch motition events even if there is no client to focus. This is important for swiping on an OSK.
Add support for touch screen input devices, and send the appropriate events to clients
Removed #ifdef around code that needs pointer constraints now that that is merged to upstream
---
dwl.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 158 insertions(+)
dwl.c | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 145 insertions(+)
diff --git a/dwl.c b/dwl.c
index 44f3ad9..ccfe33c 100644
index 5867b0c..fe447fb 100644
--- a/dwl.c
+++ b/dwl.c
@@ -51,6 +51,7 @@
@@ -47,6 +47,7 @@
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/types/wlr_single_pixel_buffer_v1.h>
#include <wlr/types/wlr_subcompositor.h>
@@ -20,7 +26,7 @@ index 44f3ad9..ccfe33c 100644
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_virtual_pointer_v1.h>
@@ -161,6 +162,12 @@ typedef struct {
struct wl_listener destroy;
struct wl_listener key;
} KeyboardGroup;
+typedef struct TouchGroup {
@@ -30,19 +36,19 @@ index 44f3ad9..ccfe33c 100644
+} TouchGroup;
+
typedef struct {
/* Must keep this field first */
/* Must keep these three elements in this order */
unsigned int type; /* LayerShell */
@@ -268,7 +275,9 @@ static void createnotify(struct wl_listener *listener, void *data);
@@ -264,7 +271,9 @@ static void createmon(struct wl_listener *listener, void *data);
static void createnotify(struct wl_listener *listener, void *data);
static void createpointer(struct wlr_pointer *pointer);
static void createpointerconstraint(struct wl_listener *listener, void *data);
static void createpopup(struct wl_listener *listener, void *data);
+static void createtouch(struct wlr_touch *touch);
static void cursorconstrain(struct wlr_pointer_constraint_v1 *constraint);
+static void createtouch(struct wlr_touch *touch);
static void cursorframe(struct wl_listener *listener, void *data);
static void cursorwarptohint(void);
static void destroydecoration(struct wl_listener *listener, void *data);
@@ -338,6 +347,10 @@ static void togglefloating(const Arg *arg);
@@ -334,6 +343,10 @@ static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
@@ -53,38 +59,16 @@ index 44f3ad9..ccfe33c 100644
static void unlocksession(struct wl_listener *listener, void *data);
static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
static void unmapnotify(struct wl_listener *listener, void *data);
@@ -405,6 +418,7 @@ static struct wlr_output_layout *output_layout;
@@ -404,6 +417,7 @@ static struct wlr_output_layout *output_layout;
static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
+static struct wl_list touches;
/* global event handlers */
static struct wl_listener cursor_axis = {.notify = axisnotify};
@@ -434,6 +448,10 @@ static struct wl_listener request_set_sel = {.notify = setsel};
static struct wl_listener request_set_cursor_shape = {.notify = setcursorshape};
static struct wl_listener request_start_drag = {.notify = requeststartdrag};
static struct wl_listener start_drag = {.notify = startdrag};
+static struct wl_listener touch_down = {.notify = touchdown};
+static struct wl_listener touch_frame = {.notify = touchframe};
+static struct wl_listener touch_motion = {.notify = touchmotion};
+static struct wl_listener touch_up = {.notify = touchup};
static struct wl_listener new_session_lock = {.notify = locksession};
#ifdef XWAYLAND
@@ -781,6 +799,10 @@ cleanuplisteners(void)
wl_list_remove(&request_set_cursor_shape.link);
wl_list_remove(&request_start_drag.link);
wl_list_remove(&start_drag.link);
+ wl_list_remove(&touch_down.link);
+ wl_list_remove(&touch_frame.link);
+ wl_list_remove(&touch_motion.link);
+ wl_list_remove(&touch_up.link);
wl_list_remove(&new_session_lock.link);
#ifdef XWAYLAND
wl_list_remove(&new_xwayland_surface.link);
@@ -1199,6 +1221,16 @@ createpopup(struct wl_listener *listener, void *data)
LISTEN_STATIC(&popup->base->surface->events.commit, commitpopup);
static void activatex11(struct wl_listener *listener, void *data);
@@ -1041,6 +1055,16 @@ createpointerconstraint(struct wl_listener *listener, void *data)
&pointer_constraint->destroy, destroypointerconstraint);
}
+void
@@ -100,7 +84,7 @@ index 44f3ad9..ccfe33c 100644
void
cursorconstrain(struct wlr_pointer_constraint_v1 *constraint)
{
@@ -1590,6 +1622,9 @@ inputdevice(struct wl_listener *listener, void *data)
@@ -1412,6 +1436,9 @@ inputdevice(struct wl_listener *listener, void *data)
case WLR_INPUT_DEVICE_POINTER:
createpointer(wlr_pointer_from_input_device(device));
break;
@@ -110,30 +94,30 @@ index 44f3ad9..ccfe33c 100644
default:
/* TODO handle other input device types */
break;
@@ -1602,6 +1637,8 @@ inputdevice(struct wl_listener *listener, void *data)
@@ -1424,6 +1451,8 @@ inputdevice(struct wl_listener *listener, void *data)
caps = WL_SEAT_CAPABILITY_POINTER;
if (!wl_list_empty(&kb_group->wlr_group->devices))
if (!wl_list_empty(&kb_group.wlr_group->devices))
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
+ if (!wl_list_empty(&touches))
+ caps |= WL_SEAT_CAPABILITY_TOUCH;
wlr_seat_set_capabilities(seat, caps);
}
@@ -2615,6 +2652,13 @@ setup(void)
wl_signal_add(&cursor->events.axis, &cursor_axis);
wl_signal_add(&cursor->events.frame, &cursor_frame);
@@ -2431,6 +2460,13 @@ setup(void)
LISTEN_STATIC(&cursor->events.axis, axisnotify);
LISTEN_STATIC(&cursor->events.frame, cursorframe);
+ wl_list_init(&touches);
+
+ wl_signal_add(&cursor->events.touch_down, &touch_down);
+ wl_signal_add(&cursor->events.touch_frame, &touch_frame);
+ wl_signal_add(&cursor->events.touch_motion, &touch_motion);
+ wl_signal_add(&cursor->events.touch_up, &touch_up);
+ LISTEN_STATIC(&cursor->events.touch_down, touchdown);
+ LISTEN_STATIC(&cursor->events.touch_frame, touchframe);
+ LISTEN_STATIC(&cursor->events.touch_motion, touchmotion);
+ LISTEN_STATIC(&cursor->events.touch_up, touchup);
+
cursor_shape_mgr = wlr_cursor_shape_manager_v1_create(dpy, 1);
wl_signal_add(&cursor_shape_mgr->events.request_set_shape, &request_set_cursor_shape);
LISTEN_STATIC(&cursor_shape_mgr->events.request_set_shape, setcursorshape);
@@ -2787,6 +2831,120 @@ toggleview(const Arg *arg)
@@ -2647,6 +2683,115 @@ toggleview(const Arg *arg)
printstatus();
}
@@ -167,8 +151,7 @@ index 44f3ad9..ccfe33c 100644
+
+ /* Find the client under the pointer and send the event along. */
+ xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
+ if (sloppyfocus)
+ focusclient(c, 0);
+ // fprintf(stderr, "touch_down at %lf, %lf\n", lx, ly);
+
+ if (surface != NULL) {
+ serial = wlr_seat_touch_notify_down(seat, surface, event->time_msec, event->touch_id, sx, sy);
@@ -187,7 +170,7 @@ index 44f3ad9..ccfe33c 100644
+ motionnotify(motion_event->time_msec, &motion_event->pointer->base, dx, dy, dx, dy);
+
+ button_event->button = BTN_LEFT;
+ button_event->state = WL_POINTER_BUTTON_STATE_PRESSED;
+ button_event->state = WLR_BUTTON_PRESSED;
+ buttonpress(listener, button_event);
+ }
+}
@@ -205,7 +188,7 @@ index 44f3ad9..ccfe33c 100644
+ struct wlr_pointer_button_event *button_event = data;
+
+ button_event->button = BTN_LEFT;
+ button_event->state = WL_POINTER_BUTTON_STATE_RELEASED;
+ button_event->state = WLR_BUTTON_RELEASED;
+ buttonpress(listener, button_event);
+ }
+
@@ -236,13 +219,9 @@ index 44f3ad9..ccfe33c 100644
+ wlr_cursor_absolute_to_layout_coords(cursor, &event->touch->base, event->x, event->y, &lx, &ly);
+ xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
+
+ if (c != NULL && surface != NULL) {
+ if (sloppyfocus)
+ focusclient(c, 0);
+ if (c != NULL) {
+ wlr_seat_touch_point_focus(seat, surface, event->time_msec, event->touch_id, sx, sy);
+ } else {
+ if (sloppyfocus)
+ focusclient(NULL, 0);
+ wlr_seat_touch_point_clear_focus(seat, event->time_msec, event->touch_id);
+ }
+ wlr_seat_touch_notify_motion(seat, event->time_msec, event->touch_id, sx, sy);
@@ -255,5 +234,30 @@ index 44f3ad9..ccfe33c 100644
unlocksession(struct wl_listener *listener, void *data)
{
--
2.52.0
2.44.0
From c2e4ff7253f33c80552abe9126e3c57d0aa23560 Mon Sep 17 00:00:00 2001
From: Micah N Gorrell <m@minego.net>
Date: Thu, 28 Mar 2024 11:25:59 -0600
Subject: [PATCH 2/2] Removed debug
---
dwl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index fe447fb..c26c581 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2713,7 +2713,6 @@ touchdown(struct wl_listener *listener, void *data)
/* Find the client under the pointer and send the event along. */
xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
- // fprintf(stderr, "touch_down at %lf, %lf\n", lx, ly);
if (surface != NULL) {
serial = wlr_seat_touch_notify_down(seat, surface, event->time_msec, event->touch_id, sx, sy);
--
2.44.0
@@ -1,4 +1,4 @@
From 0afd0a98998dda20e4fe4f4d2b5fcdec49c448c3 Mon Sep 17 00:00:00 2001
From 4693a27d3c435883743f60dbe3c0c523bdc1a0cc Mon Sep 17 00:00:00 2001
From: Sevz17 <leohdz172@outlook.com>
Date: Fri, 25 Jun 2021 19:50:56 -0500
Subject: [PATCH] show master area to the right
@@ -12,10 +12,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dwl.c b/dwl.c
index 9021e442..2bd354a3 100644
index 10d5a5b..5ae2605 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2670,11 +2670,12 @@ tile(Monitor *m)
@@ -2470,11 +2470,12 @@ tile(Monitor *m)
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue;
if (i < m->nmaster) {
@@ -31,5 +31,5 @@ index 9021e442..2bd354a3 100644
ty += c->geom.height;
}
--
2.46.0
2.43.0
@@ -1,15 +1,16 @@
From ce0eb92fb100801f343fbe9b76639847a9e39160 Mon Sep 17 00:00:00 2001
From 225fcc26d1b0fd696a90817c996b670ced8964f2 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Fri, 5 Jul 2024 11:22:57 -0500
Subject: [PATCH] implement minimalborders
Date: Thu, 11 Apr 2024 14:34:45 -0500
Subject: [PATCH] apply minimal borders
dynamically adjusts the borders between adjacent clients to make them visually merge
---
config.def.h | 1 +
dwl.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 72 insertions(+), 6 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171..0322dbf 100644
index 8847e58..55d8796 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,6 +7,7 @@
@@ -21,10 +22,10 @@ index 22d2171..0322dbf 100644
static const float bordercolor[] = COLOR(0x444444ff);
static const float focuscolor[] = COLOR(0x005577ff);
diff --git a/dwl.c b/dwl.c
index dc0437e..198061b 100644
index bf763df..d581f31 100644
--- a/dwl.c
+++ b/dwl.c
@@ -106,6 +106,7 @@ typedef struct Monitor Monitor;
@@ -105,6 +105,7 @@ typedef struct Monitor Monitor;
typedef struct {
/* Must keep these three elements in this order */
unsigned int type; /* XDGShell or X11* */
@@ -32,7 +33,7 @@ index dc0437e..198061b 100644
struct wlr_box geom; /* layout-relative, includes border */
Monitor *mon;
struct wlr_scene_tree *scene;
@@ -316,7 +317,8 @@ static void rendermon(struct wl_listener *listener, void *data);
@@ -312,7 +313,8 @@ static void rendermon(struct wl_listener *listener, void *data);
static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
static void requestmonstate(struct wl_listener *listener, void *data);
@@ -42,7 +43,7 @@ index dc0437e..198061b 100644
static void run(char *startup_cmd);
static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data);
@@ -408,6 +410,8 @@ static struct wlr_box sgeom;
@@ -405,6 +407,8 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
@@ -51,7 +52,7 @@ index dc0437e..198061b 100644
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -476,6 +480,35 @@ applyrules(Client *c)
@@ -473,6 +477,35 @@ applyrules(Client *c)
setmon(c, mon, newtags);
}
@@ -87,9 +88,9 @@ index dc0437e..198061b 100644
void
arrange(Monitor *m)
{
@@ -510,8 +543,28 @@ arrange(Monitor *m)
: c->scene->node.parent);
}
@@ -493,8 +526,28 @@ arrange(Monitor *m)
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
- if (m->lt[m->sellt]->arrange)
- m->lt[m->sellt]->arrange(m);
@@ -118,10 +119,10 @@ index dc0437e..198061b 100644
motionnotify(0, NULL, 0, 0, 0, 0);
checkidleinhibitor(NULL);
}
@@ -1962,8 +2015,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
@@ -1883,8 +1936,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
struct timespec now;
if (surface != seat->pointer_state.focused_surface &&
if ((!active_constraint || active_constraint->surface != surface) &&
- sloppyfocus && time && c && !client_is_unmanaged(c))
- focusclient(c, 0);
+ sloppyfocus && time && c && !client_is_unmanaged(c)) {
@@ -134,16 +135,16 @@ index dc0437e..198061b 100644
/* If surface is NULL, clear pointer focus */
if (!surface) {
@@ -2128,7 +2186,7 @@ requestmonstate(struct wl_listener *listener, void *data)
@@ -2032,7 +2090,7 @@ requestmonstate(struct wl_listener *listener, void *data)
}
void
-resize(Client *c, struct wlr_box geo, int interact)
+resizeapply(Client *c, struct wlr_box geo, int interact)
{
struct wlr_box *bbox;
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;
struct wlr_box clip;
@@ -2160,6 +2218,13 @@ resize(Client *c, struct wlr_box geo, int interact)
@@ -2058,6 +2116,13 @@ resize(Client *c, struct wlr_box geo, int interact)
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
}
@@ -158,4 +159,4 @@ index dc0437e..198061b 100644
run(char *startup_cmd)
{
--
2.45.1
2.43.2
@@ -1,38 +1,43 @@
From 72137ab7f63e251f2e1c9557e236fd4e9c4efa38 Mon Sep 17 00:00:00 2001
From: A Frederick Christensen <dwl@ivories.org>
Date: Tue, 24 Feb 2026 23:12:17 -0600
Subject: [PATCH] monitorconfig: update for dwl 0.8
From e7a8ee402ba7f03c621eab9df839aabd8aa5eb4c Mon Sep 17 00:00:00 2001
From: Palanix <palanixyt@gmail.com>
Date: Mon, 4 Apr 2022 16:08:29 +0200
Subject: [PATCH] Updated patch now allowing setting x and y
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me
---
config.def.h | 12 ++++++++----
config.def.h | 11 +++++++----
dwl.c | 25 +++++++++++++++++++------
2 files changed, 27 insertions(+), 10 deletions(-)
2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/config.def.h b/config.def.h
index 8a6eda0..597e3bb 100644
index 8847e58..a8860c4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -40,10 +40,14 @@ static const Layout layouts[] = {
* WARNING: negative values other than (-1, -1) cause problems with Xwayland clients due to
* https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 */
@@ -38,12 +38,15 @@ static const Layout layouts[] = {
/* monitors */
/* NOTE: ALWAYS add a fallback rule, even if you are completely sure it won't be used */
static const MonitorRule monrules[] = {
- /* name mfact nmaster scale layout rotate/reflect x y
- * example of a HiDPI laptop monitor:
- { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 }, */
- /* name mfact nmaster scale layout rotate/reflect x y */
- /* example of a HiDPI laptop monitor:
- { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
+ /* name mfact nmaster scale layout rotate/reflect x y resx resy rate mode adaptive*/
+ /* example of a HiDPI laptop monitor at 120Hz:
+ { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000f, 1, 1},
*/
/* defaults */
- { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
+ /* name mfact nmaster scale layout rotate/reflect x y resx resy rate mode adaptive */
+ /*{"eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000f, 1, 1}, /* example of a HiDPI laptop monitor at 120Hz: */
+ /*
+ * mode lets the user decide how dwl should implement the modes:
+ * -1 sets a custom mode following the user's choice
+ * All other numbers set the mode at the index n; 0 is the standard mode; see wlr-randr
+ */
+ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1, 0, 0, 0.0f, 0, 1},
/* default monitor rule: can be changed but cannot be eliminated; at least one monitor rule must exist */
+ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0.0f, 0 ,1},
+ // mode let's the user decide on how dwl should implement the modes:
+ // -1 Sets a custom mode following the users choice
+ // All other number's set the mode at the index n, 0 is the standard mode; see wlr-randr
};
/* keyboard */
diff --git a/dwl.c b/dwl.c
index 44f3ad9..987b5a6 100644
index bf763df..fdd603b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -215,6 +215,11 @@ typedef struct {
@@ -47,7 +52,7 @@ index 44f3ad9..987b5a6 100644
} MonitorRule;
typedef struct {
@@ -1041,6 +1046,7 @@ createmon(struct wl_listener *listener, void *data)
@@ -865,6 +870,7 @@ createmon(struct wl_listener *listener, void *data)
/* This event is raised by the backend when a new output (aka a display or
* monitor) becomes available. */
struct wlr_output *wlr_output = data;
@@ -55,7 +60,7 @@ index 44f3ad9..987b5a6 100644
const MonitorRule *r;
size_t i;
struct wlr_output_state state;
@@ -1069,16 +1075,23 @@ createmon(struct wl_listener *listener, void *data)
@@ -893,16 +899,23 @@ createmon(struct wl_listener *listener, void *data)
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
wlr_output_state_set_scale(&state, r->scale);
wlr_output_state_set_transform(&state, r->rr);
@@ -86,5 +91,5 @@ index 44f3ad9..987b5a6 100644
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
--
2.52.0
2.45.0
@@ -1,26 +1,26 @@
From bc5206882c71b32198dae5f1c85601a863a7c0a9 Mon Sep 17 00:00:00 2001
From f0d50d609a04cbcc1ae4d3cf27b68024f256207c Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 31 Jul 2024 07:43:10 -0500
Subject: [PATCH] implement movecenter fn
Date: Tue, 5 Mar 2024 23:39:01 -0500
Subject: [PATCH] implement keybinding to center focused windows
---
config.def.h | 2 ++
dwl.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
dwl.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/config.def.h b/config.def.h
index 22d2171..f5225d9 100644
index db0babc..71b01ab 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
@@ -12,6 +12,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
+static const int respect_monitor_reserved_area = 0; /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
/* 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}; /* You can also use glsl colors */
+static const int center_relative_to_monitor = 0; /* 0 means center floating relative to the window area */
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -142,6 +143,7 @@ static const Key keys[] = {
@@ -135,6 +136,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_space, setlayout, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
@@ -29,54 +29,45 @@ index 22d2171..f5225d9 100644
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
diff --git a/dwl.c b/dwl.c
index 145fd01..791e598 100644
index ef27a1d..fb39d13 100644
--- a/dwl.c
+++ b/dwl.c
@@ -336,6 +336,8 @@ static void tagmon(const Arg *arg);
@@ -313,6 +313,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
+static void _movecenter(Client *c, int interact);
+static void movecenter(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -2683,6 +2685,35 @@ togglefullscreen(const Arg *arg)
@@ -2454,6 +2455,28 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
+void
+_movecenter(Client *c, int interact)
+movecenter(const Arg *arg)
+{
+ struct wlr_box b;
+ Client *c = focustop(selmon);
+ Monitor *m = selmon;
+
+ if (!c || !c->mon) {
+ if (!m) {
+ return;
+ }
+
+ if (!c->isfloating) {
+ return;
+ }
+
+ b = respect_monitor_reserved_area ? c->mon->w : c->mon->m;
+ if (c) {
+ // const int center_relative_to_monitor = arg->i;
+ struct wlr_box b = center_relative_to_monitor ? m->m : m->w;
+ resize(c, (struct wlr_box){
+ .x = (b.width - c->geom.width) / 2 + b.x,
+ .y = (b.height - c->geom.height) / 2 + b.y,
+ .width = c->geom.width,
+ .height = c->geom.height,
+ }, interact);
+}
+
+void
+movecenter(const Arg *arg)
+{
+ Client *c = focustop(selmon);
+ _movecenter(c, 1);
+ }, 1);
+ }
+}
+
void
toggletag(const Arg *arg)
{
--
2.45.2
2.42.0
+79
View File
@@ -0,0 +1,79 @@
From b051f50233033b399db324b29ab24227257ac141 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Tue, 5 Mar 2024 23:31:51 -0500
Subject: [PATCH] apply NikitaIvanovV movestack patch
source: https://github.com/djpohly/dwl/wiki/movestack
---
config.def.h | 2 ++
dwl.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/config.def.h b/config.def.h
index db0babc..778a0dc 100644
--- a/config.def.h
+++ b/config.def.h
@@ -122,6 +122,8 @@ static const Key keys[] = {
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_J, movestack, {.i = +1} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_K, movestack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
diff --git a/dwl.c b/dwl.c
index ef27a1d..69b9756 100644
--- a/dwl.c
+++ b/dwl.c
@@ -279,6 +279,7 @@ static void maplayersurfacenotify(struct wl_listener *listener, void *data);
static void mapnotify(struct wl_listener *listener, void *data);
static void maximizenotify(struct wl_listener *listener, void *data);
static void monocle(Monitor *m);
+static void movestack(const Arg *arg);
static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(uint32_t time);
static void motionrelative(struct wl_listener *listener, void *data);
@@ -1603,6 +1604,40 @@ monocle(Monitor *m)
wlr_scene_node_raise_to_top(&c->scene->node);
}
+void
+movestack(const Arg *arg)
+{
+ Client *c, *sel = focustop(selmon);
+
+ if (!sel) {
+ return;
+ }
+
+ if (wl_list_length(&clients) <= 1) {
+ return;
+ }
+
+ if (arg->i > 0) {
+ wl_list_for_each(c, &sel->link, link) {
+ if (VISIBLEON(c, selmon) || &c->link == &clients) {
+ break; /* found it */
+ }
+ }
+ } else {
+ wl_list_for_each_reverse(c, &sel->link, link) {
+ if (VISIBLEON(c, selmon) || &c->link == &clients) {
+ break; /* found it */
+ }
+ }
+ /* backup one client */
+ c = wl_container_of(c->link.prev, c, link);
+ }
+
+ wl_list_remove(&sel->link);
+ wl_list_insert(&c->link, &sel->link);
+ arrange(selmon);
+}
+
void
motionabsolute(struct wl_listener *listener, void *data)
{
--
2.42.0
+421
View File
@@ -0,0 +1,421 @@
From 0dc34efe899c9e6dca6eb8770f3dedd2afe5ee83 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 22 Nov 2023 18:55:15 -0500
Subject: [PATCH 1/6] apply main...loumray:namedscratchpads.patch
---
config.def.h | 9 +++++++--
dwl.c | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index db0babc..157aee4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,11 +20,12 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
static int log_level = WLR_ERROR;
static const Rule rules[] = {
- /* app_id title tags mask isfloating monitor */
+ /* app_id title tags mask isfloating monitor scratchkey */
/* examples:
{ "Gimp", NULL, 0, 1, -1 },
*/
- { "firefox", NULL, 1 << 8, 0, -1 },
+ { "firefox", NULL, 1 << 8, 0, -1, 0 },
+ { NULL, "scratchpad", 0, 1, -1, 's' },
};
/* layout(s) */
@@ -115,11 +116,15 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
static const char *termcmd[] = { "foot", NULL };
static const char *menucmd[] = { "bemenu-run", NULL };
+/* named scratchpads - First arg only serves to match against key in rules*/
+static const char *scratchpadcmd[] = { "s", "alacritty", "-t", "scratchpad", NULL };
+
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
diff --git a/dwl.c b/dwl.c
index ef27a1d..81e5db8 100644
--- a/dwl.c
+++ b/dwl.c
@@ -130,6 +130,7 @@ typedef struct {
uint32_t tags;
int isfloating, isurgent, isfullscreen;
uint32_t resize; /* configure serial of a pending resize */
+ char scratchkey;
} Client;
typedef struct {
@@ -215,6 +216,7 @@ typedef struct {
uint32_t tags;
int isfloating;
int monitor;
+ const char scratchkey;
} Rule;
typedef struct {
@@ -307,12 +309,14 @@ static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
static void spawn(const Arg *arg);
+static void spawnscratch(const Arg *arg);
static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
+static void togglescratch(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -424,6 +428,7 @@ applyrules(Client *c)
Monitor *mon = selmon, *m;
c->isfloating = client_is_float_type(c);
+ c->scratchkey = 0;
if (!(appid = client_get_appid(c)))
appid = broken;
if (!(title = client_get_title(c)))
@@ -433,6 +438,7 @@ applyrules(Client *c)
if ((!r->title || strstr(title, r->title))
&& (!r->id || strstr(appid, r->id))) {
c->isfloating = r->isfloating;
+ c->scratchkey = r->scratchkey;
newtags |= r->tags;
i = 0;
wl_list_for_each(m, &mons, link)
@@ -2372,6 +2378,16 @@ spawn(const Arg *arg)
}
}
+void spawnscratch(const Arg *arg)
+{
+ if (fork() == 0) {
+ dup2(STDERR_FILENO, STDOUT_FILENO);
+ setsid();
+ execvp(((char **)arg->v)[1], ((char **)arg->v)+1);
+ die("dwl: execvp %s failed:", ((char **)arg->v)[1]);
+ }
+}
+
void
startdrag(struct wl_listener *listener, void *data)
{
@@ -2454,6 +2470,29 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
+void
+togglescratch(const Arg *arg)
+{
+ Client *c;
+ unsigned int found = 0;
+
+ /* search for first window that matches the scratchkey */
+ wl_list_for_each(c, &clients, link)
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
+ found = 1;
+ break;
+ }
+
+ if (found) {
+ c->tags = VISIBLEON(c, selmon) ? 0 : selmon->tagset[selmon->seltags];
+
+ focusclient(c->tags == 0 ? focustop(selmon) : c, 1);
+ arrange(selmon);
+ } else{
+ spawnscratch(arg);
+ }
+}
+
void
toggletag(const Arg *arg)
{
--
2.42.0
From e750aa243a25ec78e611883b5e72314067326746 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 22 Nov 2023 18:58:57 -0500
Subject: [PATCH 2/6] add focusortogglescratch function
---
config.def.h | 1 +
dwl.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/config.def.h b/config.def.h
index 157aee4..0f672d4 100644
--- a/config.def.h
+++ b/config.def.h
@@ -125,6 +125,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
diff --git a/dwl.c b/dwl.c
index 81e5db8..83d771e 100644
--- a/dwl.c
+++ b/dwl.c
@@ -317,6 +317,7 @@ static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void togglescratch(const Arg *arg);
+static void focusortogglescratch(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -2493,6 +2494,42 @@ togglescratch(const Arg *arg)
}
}
+void
+focusortogglescratch(const Arg *arg)
+{
+ Client *c;
+ Client *cwithfocus;
+ unsigned int found = 0;
+
+ /* search for first window that matches the scratchkey */
+ wl_list_for_each(c, &clients, link)
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
+ found = 1;
+ break;
+ }
+
+ if (found) {
+ if (VISIBLEON(c, selmon)) {
+ cwithfocus = focustop(selmon);
+ if (cwithfocus == c) {
+ // hide
+ c->tags = 0;
+ focusclient(cwithfocus, 1);
+ } else {
+ // focus
+ focusclient(c, 1);
+ }
+ } else {
+ // show
+ c->tags = selmon->tagset[selmon->seltags];
+ focusclient(c, 1);
+ }
+ arrange(selmon);
+ } else{
+ spawnscratch(arg);
+ }
+}
+
void
toggletag(const Arg *arg)
{
--
2.42.0
From 5ee62daed7e4fb60d09ba72793bf872307697203 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 22 Nov 2023 20:42:20 -0500
Subject: [PATCH 3/6] fix focus after hiding
---
dwl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dwl.c b/dwl.c
index 83d771e..6b5d55d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2498,7 +2498,6 @@ void
focusortogglescratch(const Arg *arg)
{
Client *c;
- Client *cwithfocus;
unsigned int found = 0;
/* search for first window that matches the scratchkey */
@@ -2510,11 +2509,10 @@ focusortogglescratch(const Arg *arg)
if (found) {
if (VISIBLEON(c, selmon)) {
- cwithfocus = focustop(selmon);
- if (cwithfocus == c) {
+ if (focustop(selmon) == c) {
// hide
c->tags = 0;
- focusclient(cwithfocus, 1);
+ focusclient(focustop(selmon), 1);
} else {
// focus
focusclient(c, 1);
--
2.42.0
From 0b3d70706a0aca6d4414d20a3f2ac4928e70d04e Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 6 Mar 2024 14:36:48 -0500
Subject: [PATCH 4/6] add focusortogglematchingscratch
works like focusortoggle but it also hides all others scratchpads
---
dwl.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/dwl.c b/dwl.c
index 6b5d55d..e179940 100644
--- a/dwl.c
+++ b/dwl.c
@@ -318,6 +318,7 @@ static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void togglescratch(const Arg *arg);
static void focusortogglescratch(const Arg *arg);
+static void focusortogglematchingscratch(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -2528,6 +2529,48 @@ focusortogglescratch(const Arg *arg)
}
}
+void
+focusortogglematchingscratch(const Arg *arg)
+{
+ Client *c;
+ unsigned int found = 0;
+
+ wl_list_for_each(c, &clients, link) {
+ if (c->scratchkey == 0) {
+ continue;
+ }
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
+ found = 1;
+ if (VISIBLEON(c, selmon)) {
+ if (focustop(selmon) == c) {
+ // hide
+ c->tags = 0;
+ focusclient(focustop(selmon), 1);
+ } else {
+ // focus
+ focusclient(c, 1);
+ }
+ } else {
+ // show
+ c->tags = selmon->tagset[selmon->seltags];
+ // focus
+ focusclient(c, 1);
+ }
+ continue;
+ }
+ if (VISIBLEON(c, selmon)) {
+ // hide
+ c->tags = 0;
+ }
+ }
+
+ if (found) {
+ arrange(selmon);
+ } else {
+ spawnscratch(arg);
+ }
+}
+
void
toggletag(const Arg *arg)
{
--
2.42.0
From a14d6da36f1a77cd73daf751828224dd407e78f9 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 6 Mar 2024 15:20:45 -0500
Subject: [PATCH 5/6] fix: edge case where there are more than 1 window with
the same scratchkey
---
dwl.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index e179940..4c40f86 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2534,18 +2534,26 @@ focusortogglematchingscratch(const Arg *arg)
{
Client *c;
unsigned int found = 0;
+ unsigned int hide = 0;
wl_list_for_each(c, &clients, link) {
if (c->scratchkey == 0) {
continue;
}
if (c->scratchkey == ((char**)arg->v)[0][0]) {
- found = 1;
if (VISIBLEON(c, selmon)) {
+ if (found == 1) {
+ if (hide == 1) {
+ c->tags = 0;
+ focusclient(focustop(selmon), 1);
+ }
+ continue;
+ }
if (focustop(selmon) == c) {
// hide
c->tags = 0;
focusclient(focustop(selmon), 1);
+ hide = 1;
} else {
// focus
focusclient(c, 1);
@@ -2556,6 +2564,7 @@ focusortogglematchingscratch(const Arg *arg)
// focus
focusclient(c, 1);
}
+ found = 1;
continue;
}
if (VISIBLEON(c, selmon)) {
--
2.42.0
From 8d86b275615f4f6242828d2ce4606380ba309c58 Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 6 Mar 2024 15:22:24 -0500
Subject: [PATCH 6/6] add examples
---
config.def.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 0f672d4..3205165 100644
--- a/config.def.h
+++ b/config.def.h
@@ -125,7 +125,8 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
+ // { MODKEY, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
+ // { MODKEY, XKB_KEY_grave, focusortogglematchingscratch, {.v = scratchpadcmd } },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
--
2.42.0
@@ -0,0 +1,27 @@
From 8b523453aefdc9d2920c8f9a52de009da251fbb0 Mon Sep 17 00:00:00 2001
From: neuromagus <neuromagus@mail.ru>
Date: Sun, 7 Jan 2024 05:11:24 +0300
Subject: [PATCH] apply patch naturalscrolltrackpad
---
dwl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dwl.c b/dwl.c
index 4d19357..26f394b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -974,11 +974,10 @@ createpointer(struct wlr_pointer *pointer)
libinput_device_config_tap_set_drag_enabled(device, tap_and_drag);
libinput_device_config_tap_set_drag_lock_enabled(device, drag_lock);
libinput_device_config_tap_set_button_map(device, button_map);
+ if (libinput_device_config_scroll_has_natural_scroll(device))
+ libinput_device_config_scroll_set_natural_scroll_enabled(device, natural_scrolling);
}
- if (libinput_device_config_scroll_has_natural_scroll(device))
- libinput_device_config_scroll_set_natural_scroll_enabled(device, natural_scrolling);
-
if (libinput_device_config_dwt_is_available(device))
libinput_device_config_dwt_set_enabled(device, disable_while_typing);
+105
View File
@@ -0,0 +1,105 @@
From f8761928cc1eb5c9c694cf43cf6442579ea40150 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
<leohdz172@protonmail.com>
Date: Sun, 4 Apr 2021 19:56:09 -0500
Subject: [PATCH] add option to enable numlock/capslock
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
---
config.def.h | 4 ++++
dwl.c | 31 ++++++++++++++++++++++++++-----
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index a8ed61d..87f91d7 100644
--- a/config.def.h
+++ b/config.def.h
@@ -56,6 +56,10 @@ static const struct xkb_rule_names xkb_rules = {
.options = NULL,
};
+/* numlock and capslock */
+static const int numlock = 1;
+static const int capslock = 0;
+
static const int repeat_rate = 25;
static const int repeat_delay = 600;
diff --git a/dwl.c b/dwl.c
index 10d5a5b..962748b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -13,6 +13,7 @@
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/backend/libinput.h>
+#include <wlr/interfaces/wlr_keyboard.h>
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
@@ -336,6 +337,7 @@ static void zoom(const Arg *arg);
static const char broken[] = "broken";
static pid_t child_pid = -1;
static int locked;
+static uint32_t locked_mods = 0;
static void *exclusive_focus;
static struct wl_display *dpy;
static struct wlr_backend *backend;
@@ -768,6 +770,8 @@ createkeyboard(struct wlr_keyboard *keyboard)
wlr_keyboard_set_keymap(keyboard, kb_group.wlr_group->keyboard.keymap);
wlr_keyboard_set_repeat_info(keyboard, repeat_rate, repeat_delay);
+ wlr_keyboard_notify_modifiers(keyboard, 0, 0, locked_mods, 0);
+
/* Add the new keyboard to the group */
wlr_keyboard_group_add_keyboard(kb_group.wlr_group, keyboard);
}
@@ -2354,13 +2358,9 @@ setup(void)
XKB_KEYMAP_COMPILE_NO_FLAGS)))
die("failed to compile keymap");
+ wlr_seat_set_keyboard(seat, &kb_group.wlr_group->keyboard);
wlr_keyboard_set_keymap(&kb_group.wlr_group->keyboard, keymap);
wlr_keyboard_set_keymap(&vkb_group.wlr_group->keyboard, keymap);
- xkb_keymap_unref(keymap);
- xkb_context_unref(context);
-
- wlr_keyboard_set_repeat_info(&kb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
- wlr_keyboard_set_repeat_info(&vkb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
/* Set up listeners for keyboard events */
LISTEN(&kb_group.wlr_group->keyboard.events.key, &kb_group.key, keypress);
@@ -2368,6 +2368,27 @@ setup(void)
LISTEN(&vkb_group.wlr_group->keyboard.events.key, &vkb_group.key, keypress);
LISTEN(&vkb_group.wlr_group->keyboard.events.modifiers, &vkb_group.modifiers, keypressmod);
+ if (numlock) {
+ xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_NUM);
+ if (mod_index != XKB_MOD_INVALID)
+ locked_mods |= (uint32_t)1 << mod_index;
+ }
+
+ if (capslock) {
+ xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
+ if (mod_index != XKB_MOD_INVALID)
+ locked_mods |= (uint32_t)1 << mod_index;
+ }
+
+ if (locked_mods)
+ wlr_keyboard_notify_modifiers(&kb_group.wlr_group->keyboard, 0, 0, locked_mods, 0);
+
+ xkb_keymap_unref(keymap);
+ xkb_context_unref(context);
+
+ wlr_keyboard_set_repeat_info(&kb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
+ wlr_keyboard_set_repeat_info(&vkb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
+
kb_group.key_repeat_source = wl_event_loop_add_timer(
wl_display_get_event_loop(dpy), keyrepeat, &kb_group);
vkb_group.key_repeat_source = wl_event_loop_add_timer(
--
2.43.0

Some files were not shown because too many files have changed in this diff Show More