Compare commits

..

605 Commits

Author SHA1 Message Date
Shringe ec345a0c41 made 0.7 link relative 2025-07-13 17:36:02 -05:00
Shringe 01ac7fe533 added 0.7 raw link 2025-07-13 17:32:19 -05:00
Shringe 284a7a8fdf Add specifictation 2025-06-24 03:13:28 +02:00
Shringe 162d2d3aaf added disable-keybindings-on-fullscreen-toggle 2025-06-23 20:06:42 -05:00
Santiago Lo Coco 7dd8eef128 attachtop: fix floating window edge case
Issue: #533
2025-06-16 23:39:35 +02:00
Guido Cella 1d16e63d46 update alwayscenter 2025-06-14 23:15:32 +02:00
Guido Cella 927ed93711 update center-terminal 2025-06-14 23:14:48 +02:00
Guido Cella 938cd817a4 update unclutter 2025-06-09 11:13:52 +02:00
wochap eae3d7ec62 Update patches/scenefx/README.md 2025-06-08 22:34:20 +02:00
MayOrMayNotBeACat 739b1df535 Add comment documenting jank with launchtag. 2025-06-07 00:21:53 -04:00
MayOrMayNotBeACat a8e93dcc1b Fix initialization error 2025-06-07 00:09:26 -04:00
MayOrMayNotBeACat eccf2288de Try to make the compiler error out if tag_layout is incorrectly configured. 2025-06-07 00:01:02 -04:00
MayOrMayNotBeACat 3af96163a7 Clean up README 2025-06-06 23:38:00 -04:00
MayOrMayNotBeACat 5ba8f3ced8 Add launchtag patch. 2025-06-06 23:29:51 -04:00
kerberoge 609c4d63a7 Updated tmux-borders 2025-06-02 21:23:35 +02:00
kerberoge 585949952f Second version of tmux-borders patch 2025-06-01 17:07:15 +02:00
Sivecano cd083aa858 hot-reload: fix small regression and tiny memory leak 2025-05-30 12:57:29 +02:00
Sivecano 8f5f22eb4f hot-reload: embarassing type (this is why you should do thourough testing) 2025-05-30 12:42:50 +02:00
Sivecano 9be77b2925 hot-reload: markdown is hard 2025-05-30 02:55:21 +02:00
Sivecano 50c6a46c35 update hot-reload README with a more comprehensive explanation of how to integrate it with other patches. 2025-05-30 02:43:50 +02:00
Sivecano 83b68bee53 update and fix hot-reload patch
we now depend on config.mk better and apply to latest dwl main
2025-05-30 01:44:22 +02:00
kerberoge 61d5f3c503 Fixed tmux-borders readme 2025-05-23 16:08:29 +02:00
kerberoge 1c3bb1cae6 Added tmux-borders patch 2025-05-23 15:55:38 +02:00
A Frederick Christensen 94b8bb3666 tablet-input: Add temporary primitive debugging 2025-05-18 17:58:39 -05:00
A Frederick Christensen fd664f946d Update tablet-input patch 2025-05-18 00:32:14 -05:00
A Frederick Christensen 38d814e1b0 Update touch-input patch 2025-05-17 22:19:41 -05:00
MayOrMayNotBeACat 285921afe4 Add attachfocused patch.
This patch changes dwl to make new clients attach below the currently
focused one, like you can do on hyprland.

Finish readme

Add known issue to README
2025-05-17 16:11:30 +00:00
Florian Olk 3b4043eb14 feat: rotate clients on current monitor 2025-05-17 00:31:36 +00:00
wochap 7f227a0fac update git branch 2025-05-06 15:47:39 +00:00
korei999 2003c92c16 update tearing 2025-04-22 15:27:21 +03:00
korei999 daa3981969 update tearing 2025-04-22 15:26:10 +03:00
wochap 9f5193c17a fix https://codeberg.org/dwl/dwl-patches/issues/488#issuecomment-3512513 2025-04-04 15:33:10 +00:00
vetu104 8ba6ccd823 bar-systray: Fix bad postfix decrement usage 2025-04-01 16:49:47 +03:00
h3nc4 93523c00fb change keys into xkbcommon definitions 2025-03-29 19:56:30 +00:00
h3nc4 9137f21d74 port the tagshift patch from dwm 2025-03-29 19:56:30 +00:00
vetu104 7d54a01970 bar-systray: Support non-linux
- Remove unportable code: use self-pipe for waking up the wl_event_loop
  on dbus events instead of eventfd. Tested on FreeBSD.

- Don't die if another tray is already running. Previous version didn't
  allow nested dwls.
2025-03-29 19:26:20 +02:00
Ferdinand Bachmann 4df7dc7376 Add wayland-socket-handover patch 2025-03-26 17:30:53 +01:00
Nikita Ivanov ca28e6d2d8 menu: fix pointer reset on error 2025-03-26 01:11:20 +01:00
Nikita Ivanov 955e7dec32 Add cfact-snail patch 2025-03-25 02:41:30 +01:00
Nikita Ivanov 667c0fbdbe menu: use builtin fd_set_nonblock 2025-03-22 21:03:57 +01:00
Nikita Ivanov 4f98041841 Update swallow patch 2025-03-22 18:34:36 +01:00
Nikita Ivanov 77b45273bf Add menurule patch 2025-03-21 23:48:12 +01:00
Nikita Ivanov e0999c504b Update setrule patch 2025-03-21 22:29:58 +01:00
Nikita Ivanov b0de2fb715 Update menu patch 2025-03-21 22:12:45 +01:00
moonsabre 5cf233eb6f Bad indenting in bartruecenteredtitle. 2025-03-15 08:03:38 +00:00
moonsabre 6526ab79a4 Bad indenting in bartruecenteredtitle. 2025-03-15 00:59:58 -07:00
moonsabre e3476de87f Update bartruecenteredtitle with suggestions from sewn. 2025-03-14 16:11:27 -07:00
korei999 dd4dfcb71e update globalkey 2025-03-14 20:22:46 +02:00
moonsabre 9356baf802 Add follow patch. Add line break in bartruecenteredtitle README file. 2025-03-13 15:26:17 -07:00
moonsabre 06571a92bf bartruecenteredtitle patch file was missing. 2025-03-13 13:09:01 -07:00
moonsabre a90f5b63ad Update bartruecenteredtitle to fix floating window indicator position. Update README file to better address version compatibility. 2025-03-13 12:57:40 -07:00
LaKato 813b425117 Revive togglekblayoutandoptions
Changes:
- Updated for v0.7
- incxkbrules now uses its argument (value to increment by)
- A new setxkbrules function has been added
- Keyboard groups are no longer looped over because only one is created
2025-03-13 17:11:59 +00:00
moonsabre 8d27630729 Add centertitle patch, its accompanying README file and attached screenshot.
Fix README file not appearing as intended.

Fix README file not appearing as intended.

Update bartruecenteredtitle for compatibility with DWL patch guidelines.

Revert past 4 commits.

Squash everything.

Squash previous 4 commits into 1 commit.

Undo everything one more time.

Squash everything.

Merge with branch "moonpatch"

Squash everything.
2025-03-13 17:05:57 +00:00
wochap 2aa64763fb docs scenefx 2025-03-12 20:45:37 +00:00
wochap 7e3e98dd7a refactor scenefx patch and apply optimized_blur 2025-03-12 20:39:42 +00:00
vetu104 da47561153 Add better bar-systray patch 2025-03-08 15:28:34 +02:00
vetu104 2b67e1111d Move GTK based bar-systray to stale 2025-03-08 14:02:42 +02:00
graves501 d14cf82c6e docs(globalkey): Improve wording of README.md 2025-03-07 20:34:41 +01:00
Nikita Ivanov 2e5748edfe swallow: rewrite patch, update README.md 2025-03-03 21:50:39 +01:00
Sivecano 4d0bfa66b4 hot-reload: provide better Makefile 2025-02-21 21:26:31 +01:00
Sivecano 27b00008cb update notice and improve stability for hot-reload patch 2025-02-18 13:38:29 +01:00
wochap 7d0de9d9a8 scenefx 0.2.1 2025-02-17 12:15:17 +00:00
Sivecano 9397519870 add hot-reload patch 2025-02-17 04:37:31 +00:00
Nikita Ivanov f1ed83eaeb centeredmaster: update to 0.7 2025-02-15 23:08:46 +01:00
wochap 07fe3cf50e scenefx 0.2 2025-02-15 16:34:25 +00:00
wochap edf971c08c scenefx 0.2 2025-02-15 16:32:24 +00:00
wochap 0ccbc9b73b scenefx 0.2 2025-02-15 16:29:57 +00:00
Nikita Ivanov c01728c629 Add spawninfo patch 2025-02-14 23:10:09 +01:00
Nikita Ivanov 268bee3cee setrule: improve README.md 2025-02-14 20:21:27 +01:00
Nikita Ivanov 9cce9a2ca5 setrule: fix function formatting in the example 2025-02-14 00:07:05 +01:00
Nikita Ivanov 5e6df4bdb2 setrule: add a note + fix style 2025-02-14 00:05:15 +01:00
Nikita Ivanov 97be2a869d Add setrule patch 2025-02-14 00:01:07 +01:00
Nikita Ivanov 75ddb1b2c2 Fix author list links with my name 2025-02-13 23:45:14 +01:00
Nikita Ivanov e4b2e9112c Update naturalscrolltrackpad patch 2025-02-13 23:20:29 +01:00
julmajustus 2eda9f1f5f btrtile refactor: simplified codebase and added support for multi-tag view/toggle 2025-02-13 23:42:20 +02:00
Nikita Ivanov dfb7ae3bbd Update genericgaps 2025-02-11 01:25:43 +01:00
korei999 28e8282191 add 'disable-keybindings-on-fullscreen' patch 2025-02-09 16:57:49 +02:00
julmajustus 5f6ffb8161 btrtile: fixed bug in buttonpress tiled client insertion logic if only one client is present 2025-02-09 16:34:58 +02:00
Nikita Ivanov 2d590d0ecd kblayout: fix update signal in someblocks example 2025-02-09 13:00:16 +01:00
Nikita Ivanov 48c0f85947 scenefx: fix corrupted patch 2025-02-09 12:22:43 +01:00
julmajustus 32a21e2261 btrtile: Refactor client management and insertion logic
- **Mouse-based Client Selection:**
  - If no visible client is found under the cursor, fallback to selecting the closest client.

- **Client Insertion:**
  - Handle insertion of multiple new clients.
  - When moving multiple clients to another tag, ensure the splitting logic is consistently applied.
2025-02-08 06:27:25 +02:00
Nikita Ivanov 919741ee19 en-keycodes: fix Terminate_Server being ignored 2025-02-05 00:49:07 +01:00
Nikita Ivanov f24e98a304 Fix crash when moving beyond first/last clients 2025-02-04 23:28:02 +01:00
kerberoge be20c2de0e Made barcolors code a bit simpler 2025-02-02 21:49:58 +01:00
Guido Cella a727409aca center-terminal: rebase 2025-01-27 12:19:12 +01:00
A Frederick Christensen 4a869141fa touch-input: update README.md link 2025-01-20 06:15:22 -06:00
A Frederick Christensen 9d5c84d2b0 touch-input: rebase against d1c2f43 2025-01-20 06:14:48 -06:00
Leonardo Hernández Hernández ff8105d1d2 vanitygaps: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:04 -06:00
Leonardo Hernández Hernández e92e2ebbe0 smartborders: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:04 -06:00
Leonardo Hernández Hernández a87342897a push: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández 9d90b0ac9d numlock-capslock: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández 7d997b2b83 keycodes: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández 078d201431 hide-behind-monocle: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández e85e1a7af7 hide-behind-fullscreen: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández 9ac9bad1af coredump: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández fb94ea5fd4 client-opacity: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
Leonardo Hernández Hernández 481477cbe5 autostart: rebase against d1c2f434983562bd7d2ace15ab0c05155be603bc 2025-01-19 18:10:03 -06:00
wochap d4dc85dbe8 Update patches/scenefx/README.md 2025-01-18 23:16:47 +00:00
wochap bfdd644ffe fix(scenefx) shadow
chase scenefx changes
2025-01-18 23:15:32 +00:00
A Frederick Christensen 6b4729e357 touch-input: update 2025-01-11 17:09:24 -06:00
kerberoge 9963c556ef Updated barcolors patch 2025-01-11 12:55:35 +01:00
julmajustus 9e12e39f66 Removed local .gif images from btrtile and simple_scratchpad to reduce repo size 2025-01-10 14:07:20 +02:00
julmajustus d8c1f707cc Add fullscreenadaptivesync patch 2025-01-06 15:35:46 +02:00
julmajustus af8902cb15 Add simple_scratchpad patch 2025-01-06 15:26:34 +02:00
A Frederick Christensen 6bbc99d458 press_repeat_release: moved to stale-patches 2025-01-04 22:56:40 -06:00
A Frederick Christensen e930381da3 Remove old stale-patch description .md files 2025-01-04 21:42:22 -06:00
A Frederick Christensen 5a4093475b Main README.md: add specifics regarding former patchers 2025-01-04 21:33:27 -06:00
A Frederick Christensen 2c4ea1e4aa Main README.md minor edits 2025-01-04 20:47:51 -06:00
A Frederick Christensen da2f40c982 Renamed _STALE_PATCHES -> stale-patches
The odd name was necessary historically to keep the directory
visible at the top of a large list of patches.
This is no longer necessary.
2025-01-04 20:38:16 -06:00
julmajustus 6770813364 Fixed typos in btrtile readme 2025-01-04 01:07:54 +02:00
fauxmight 9824f0429a Cleanup/restructure the main dwl-patches README.md 2025-01-03 02:53:47 +00:00
wochap f87556707d update scenefx patch link for 0.8
new  patch includes fixes and new options
2025-01-03 00:44:42 +00:00
wochap 72c5d436ab scenefx fixes
- fix: Remove rounded borders and shadows when toggling fullscreen mode
- feat: Add two new options: `shadow_ignore_list` and `corner_radius_only_floating`
2025-01-03 00:40:58 +00:00
A Frederick Christensen 9477154cc2 remembertags: moved to _STALE_PATCHES
See https://codeberg.org/dwl/dwl-patches/pulls/102
2025-01-01 22:19:39 -06:00
fauxmight 5035fb9a35 Update README.md
Clarify _STALE_PATCHES revival matter
2025-01-02 04:16:06 +00:00
julmajustus 2cd54ba5fb Add btrtile
Patch refactor, updated readme.

Added link for with gapps patch to readme.
2025-01-01 23:36:19 +00:00
A Frederick Christensen b279ebde1c tablet-input: Update patch and squash commits 2025-01-01 16:51:07 -06:00
A Frederick Christensen af2391cb80 less-simple-touch-input: rename to touch-input
Former maintainer @fauxmight taking over patch maintenance. @minego notes
a lack of available time: https://codeberg.org/dwl/dwl-patches/pulls/102#issuecomment-2557944
Thank you for all your work, @minego!
2025-01-01 16:36:24 -06:00
fauxmight 3c43c107ca Update patches/tablet-input/README.md
Minor cleanups
2025-01-01 22:11:47 +00:00
A Frederick Christensen 5e744ae3ff tablet-input: README.md formatting 2025-01-01 16:06:37 -06:00
A Frederick Christensen 45dbbf1c54 tablet-input: clarify argument order of wlr_surface_accepts_tablet_v2 2025-01-01 15:53:19 -06:00
Palanix 4e476edc87 Rename monfig to monitorconfig. Closes #139 2025-01-01 21:37:41 +01:00
A Frederick Christensen 8fe8bd5d65 tablet-input: Add tablet-input-0.7.patch
Compiles against dwl 0.7 with wlroots release <=0.18.1

@fauxmight adopted the tablet-input patch.
Previous maintainer @notchoc and contributor @nyan6 both note
they are using another compositor and are not able to maintain
tablet-input. (https://codeberg.org/dwl/dwl-patches/issues/141)
2025-01-01 13:43:42 -06:00
45mg b8a5bf5142 snail: rebase onto 0.7 2025-01-01 07:06:25 +00:00
wochap e7752b138a move togglekblayout to _STALE_PATCHES folder 2024-12-25 12:16:36 -05:00
wochap abf142827c scenefx: rebase against v0.8 2024-12-25 16:44:04 +00:00
wochap 494baec5b1 scenefx: rebase against v0.8 2024-12-25 16:23:41 +00:00
sewn ae2ed4649a hide_vacant_tags: fix #131 2024-12-13 17:32:21 +03:00
Nikita Ivanov 3880dd0fe4 Rename genericgaps.md to README.md 2024-12-12 23:07:45 +01:00
Nikita Ivanov 038f3012a5 Add genericgaps patch 2024-12-12 23:04:59 +01:00
sewn 3a0b856848 meson: add drm by default 2024-12-07 09:59:43 +03:00
dev-gm 092fa93acd Removed git branch from _STALE_PATCHES/togglekblayoutandoptions, _STALE_PATCHES/tab-pango 2024-12-01 23:27:18 -05:00
dev-gm 7da37262f1 Added cfact-v0.7-gaps.patch to cfact; Removed git branch from tab, limitnmaster, _STALE_PATCHES/togglekblayoutandoptions, _STALE_PATCHES/tab-pango 2024-12-01 23:25:20 -05:00
korei999 620e0ca35a update globalkey 2024-11-21 02:31:14 +02:00
dev-gm 9dc4bb37da Fixed bug in tab patch where urgent tabs were transparent 2024-11-16 23:30:41 -05:00
Gavin M a8ea96a234 Removed repeat of drwl_init from tab-0.7-bar.patch 2024-11-16 09:55:03 -05:00
dev-gm 31f3786218 Fix links again in tab patch's README.md 2024-11-16 14:02:36 +00:00
dev-gm 4386e4295f Fix link and formatting errors in tab patch's README.md 2024-11-16 13:36:31 +00:00
Gavin M e39a7b2a5f Add new tab patch using drwl and deprecate old tab patch to _STALE_PATCHES/tab-pango 2024-11-16 08:29:52 -05:00
Gavin M 5ba7a22893 Move togglekblayoutandoptions to stale - doesn't work anymore 2024-11-16 06:33:01 -05:00
schance995 200ff6ee53 Add relative-mouse-resize patch v0.4 2024-10-13 16:39:18 +00:00
schance995 342db95db1 Add my authorship to relative-mouse-resize 2024-10-13 15:58:59 +00:00
schance995 a8d5ca4f94 Delete _STALE_PATCHES/relativemouseresize.md 2024-10-13 15:56:51 +00:00
Nikita Ivanov 8b1f9fbdb2 Update kblayout to 0.7 2024-10-13 10:32:53 +02:00
Ben Collerson d36c11db0c simpleborders: rebase against v0.7 2024-10-11 11:41:08 +10:00
Ben Collerson c9e48802a5 inputdevicerules: rebase against v0.7 2024-10-11 11:20:53 +10:00
Guido Cella 800647a85b update switchtotag 2024-09-30 08:41:34 +02:00
sewn a433930291 bar: remove excess chars in dl link 2024-09-22 18:16:58 +03:00
sewn c1ab03584e bar: note config.h regeneration & pertag 2024-09-22 18:16:05 +03:00
Dhruva Sambrani 6b39eef5b2 fix link 2024-09-22 11:59:24 +02:00
A Frederick Christensen 5e1ccc9ef3 Revert "fix link"
This reverts commit f4a18a4bcc.
2024-09-21 10:39:38 -05:00
korei999 33bf4e208e update tearing 2024-09-18 20:36:37 +03:00
Dhruva Sambrani f4a18a4bcc fix link 2024-09-18 19:00:50 +02:00
Dhruva Sambrani 0ed712244f rebase to upstream/main 2024-09-18 18:56:25 +02:00
sewn 2ac40d9676 nextlayout: fix config.h 2024-09-08 22:49:49 +03:00
sewn 084b90b98e nextlayout: new patch - 0.7 2024-09-08 22:48:34 +03:00
Ben Collerson b1a2620e28 namedscratchpads: currently only works on v0.6 2024-09-06 13:20:47 +10:00
Dhruva Sambrani 2f09c61d65 update dim-unfocused 2024-09-03 16:49:44 +02:00
Leonardo Hernández Hernández 2ce469b149 push: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-03 00:00:19 -06:00
Leonardo Hernández Hernández affb90be44 push: rebase against v0.7 2024-09-02 23:58:51 -06:00
Leonardo Hernández Hernández acf27c6c8b vanitygaps: update date
It was updated yesterday in 9f1dab082c
2024-09-02 23:54:53 -06:00
Leonardo Hernández Hernández 8c4bd97f6b vanitygaps: rebase against v0.7 2024-09-02 23:51:54 -06:00
Leonardo Hernández Hernández 7c0a9f154a smartborders: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-02 23:47:16 -06:00
Leonardo Hernández Hernández 4326f809d9 smartborders: rebase against v0.7 2024-09-02 23:44:35 -06:00
Leonardo Hernández Hernández 6b4dcf2071 numlock-capslock: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-02 23:31:00 -06:00
Leonardo Hernández Hernández fb56535660 numlock-capslock: rebase against v0.7 2024-09-02 23:29:12 -06:00
Leonardo Hernández Hernández 545a77a01f master-right: fix typo 2024-09-01 23:04:24 -06:00
Leonardo Hernández Hernández ee4f818f8a master-right: deprecate
I created this patch for a user on Discord and I have never used it.
2024-09-01 22:57:45 -06:00
Leonardo Hernández Hernández 7dbddf31e5 master-right: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-01 22:54:22 -06:00
Leonardo Hernández Hernández 055f98b37c master-right: rebase against v0.7 2024-09-01 22:53:01 -06:00
Leonardo Hernández Hernández c96d0ae452 keycodes: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-01 22:48:30 -06:00
Leonardo Hernández Hernández 690364346d keycodes: rebase against v0.7 2024-09-01 22:47:02 -06:00
Leonardo Hernández Hernández fc6aebb916 hide-behind-monocle: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-01 22:39:36 -06:00
Leonardo Hernández Hernández df29df46f2 hide-behind-monocle: rebase against v0.7 2024-09-01 22:39:36 -06:00
Leonardo Hernández Hernández f830cf38e8 hide-behind-fullscreen: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-01 22:39:36 -06:00
Leonardo Hernández Hernández 60442bb489 hide-behind-fullscreen: rebase against v0.7 2024-09-01 22:39:31 -06:00
Leonardo Hernández Hernández 78390e597f coredump: rebase against 9c05b9622c7aa3a0874c49231249cf1859e2d031 2024-09-01 22:38:27 -06:00
Leonardo Hernández Hernández 3b3a071bdd coredump: rebase against v0.7 2024-09-01 22:38:24 -06:00
snuk 9f1dab082c vanitygaps: on 0.8-dev
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2024-09-01 22:12:34 -06:00
Guido Cella a03db1d42b update switchtotag
Fix showing the original tags after unmap after ab5c554.
2024-08-28 17:24:49 +02:00
sewn e9d7e1bbe8 meson: fix wlroots features 2024-08-27 16:28:16 +03:00
sewn 11845450fb meson: document hwdata requirement for drm 2024-08-27 16:11:14 +03:00
sewn e5d935fd72 meson: 2024-08-27 2024-08-27 16:03:19 +03:00
Kerberoge 8ee19b4f1d updated barcolors 2024-08-26 00:10:10 +02:00
sewn 38f6c90637 rlimit_max: 0.7 2024-08-25 22:10:27 +03:00
choc d274bfed40 envcfg: fix link typo in README.md 2024-08-25 23:51:50 +08:00
Oak 2ca1b5805f Set the right version for barheight, targeted at 0.7 and not main 2024-08-25 17:47:34 +02:00
Oak 07565348c1 update barheight for bar 0.7 2024-08-25 17:45:25 +02:00
korei999 2c9f573600 tearing updates 2024-08-24 23:42:01 +03:00
Oak 40a59f70c8 Add a newline to the end of barheight's readme 2024-08-24 19:02:53 +02:00
moe dc159dfd50 mastercolumn: update branch links 2024-08-23 21:49:27 -04:00
Janne Veteläinen dea8c80374 bar-systray: rebase onto bar 2024-08-23 2024-08-23 20:04:19 +03:00
sewn b4eae7b556 hide_vacant_tags: 2024-08-23 2024-08-23 14:24:40 +03:00
sewn f5e0ef9eea barpadding: 2024-08-23 2024-08-23 14:24:32 +03:00
sewn 060612ea3a barborder: 2024-08-23 2024-08-23 14:24:24 +03:00
sewn bcaeb13ee9 bar: 2024-08-23 2024-08-23 14:24:18 +03:00
choc cddd367f3e ipc: 2024-08-16 r1
remove accidentally added focusmon patch
2024-08-16 10:49:24 +08:00
choc 158de28bc6 ipc: 2024-08-16 2024-08-16 09:29:49 +08:00
korei999 3c690cfb8b update tearing 2024-08-15 01:40:01 +03:00
Janne Veteläinen acf7519636 Add systray patch 2024-08-11 12:02:34 +00:00
moe 67cf08d27f update readme to new guidelines, rebase patches onto 0.7 2024-08-10 16:07:55 -04:00
A Frederick Christensen 942967d7a1 Remove deprecated patch-branch instruction 2024-08-10 12:09:02 -05:00
A Frederick Christensen 9fc674464c Clarifications to patch README.md example 2024-08-10 11:59:44 -05:00
JoaoCostaIFG 8588394282 Add snail-gaps patch
A patch built on top of the snail patch to add gaps support to the layout.
2024-08-08 14:48:16 +01:00
korei999 dcca4aeb7b fix link 2024-08-07 18:16:07 +00:00
korei999 1772adb7c4 Update patches/tearing/README.md 2024-08-07 15:48:13 +00:00
korei999 fba82babe5 Update patches/tearing/README.md 2024-08-07 15:34:38 +00:00
korei999 cd632cec2d add tearing patch 2024-08-07 18:32:55 +03:00
Guido Cella 5453b74075 update unclutter 2024-08-06 21:02:45 +02:00
Kerberoge 3b093c5daa Fixed a broken link in barcolors's README.md 2024-08-06 15:05:10 +02:00
Kerberoge 8a3694b588 Rebased barcolors patch onto 0.7 2024-08-06 14:52:09 +02:00
sewn b6c3f3dc75 add patch meson 2024-08-06 00:40:57 +03:00
sewn 2929e8ac46 barborder: 0.7 2024-08-05 01:45:40 +03:00
sewn 5716f26d02 barpadding: 0.7 2024-08-05 01:44:22 +03:00
sewn 12734cebea hide_vacant_tags: 0.7 2024-08-05 01:40:35 +03:00
sewn f07a53ba49 bar: add 0.7 and 0.6 2024-08-05 01:38:57 +03:00
estevao 336a30cdd2 add cfact-centeredmaster 2024-08-03 05:49:30 +00:00
A Frederick Christensen ed179461db Trim absolute URLs to relative URLs 2024-07-31 13:03:08 -05:00
choc 570cf3bc31 tablet-input: 2024-07-31 2024-07-31 22:02:47 +08:00
wochap ca3e6cbdac Update patches/movecenter/README.md 2024-07-31 13:43:57 +00:00
wochap 8d2a8219a0 Update patches/pertag/README.md 2024-07-31 13:33:25 +00:00
wochap 45c9a9eb02 Update patches/pertag/README.md 2024-07-31 13:32:58 +00:00
wochap 65ea99519b update to v0.6
fix https://codeberg.org/dwl/dwl-patches/issues/112
2024-07-31 13:32:12 +00:00
wochap 6133b325e4 Update patches/togglekblayout/README.md 2024-07-31 12:55:22 +00:00
wochap a6fa4ba320 Update patches/movecenter/README.md 2024-07-31 12:53:22 +00:00
wochap b1ca929ee6 update movecenter patch to v0.6
fix bug where not floating windows are being centered
2024-07-31 12:44:22 +00:00
45mg 187d7f5115 autostart: rebase onto 0.7 2024-07-31 01:51:21 -06:00
Denis Strizhkin 792e87d4e5 fix autostart.patch from failing 2024-07-31 01:46:30 -06:00
Kerberoge 12a8d4b7d5 Added barcolors patch 2024-07-31 01:51:59 +00:00
A Frederick Christensen 373c8dd630 Update patch policy AND remove obligatory dwl branch for each patch 2024-07-30 20:25:57 -05:00
Palanix 57025a8c35 Update cfact patch 2024-07-29 21:38:45 +02:00
Palanix 6d9e83596b Update zoomswap 2024-07-29 21:34:27 +02:00
Palanix 38fabc623d Update dragmfact 2024-07-29 21:28:41 +02:00
choc d235f0f88e ipc: 2024-07-29
add ipcpertag and focus-tagset-output mini-patches
2024-07-29 21:34:52 +08:00
Rutherther 43ee42aeef singletagset-pertag: remove copy artifact 2024-07-26 13:48:40 +02:00
Rutherther 4d10ef76d4 singletagset-pertag: init
Pertag for singletagset patch.
Makes one set of rules for the tags instead
of per output.
2024-07-26 13:45:52 +02:00
Rutherther 97c08710a7 singletagset-sticky: init
Patch sticky to work with singletagset
2024-07-26 13:41:14 +02:00
Rutherther c830f47254 sticky: revive 2024-07-26 13:41:02 +02:00
Rutherther e11139579e singletagset: add v0.7 variant of the patch
Resolves #104 by removing reparenting call
that was probably left by rebasing issues.

Resolves #70 by removing tags for an output
that is turned off.
2024-07-26 12:50:58 +02:00
Guido Cella 474e38a5f4 update unclutter
Fix error: a function declaration without a prototype is deprecated in
all versions of C [-Werror,-Wstrict-prototypes]
2024-07-25 17:59:44 +02:00
Ben Collerson acd2b3b60c New policy says latest author should be at top 2024-07-24 15:24:21 +10:00
A Frederick Christensen c77a42b16a README.md - specify latest author at top of list 2024-07-23 23:42:07 -05:00
Ben Collerson 2e74dc1caf singlemaster: rebase on v0.6 2024-07-18 11:18:54 +10:00
A Frederick Christensen 4661de23d2 Minor documentation cleanups 2024-07-16 23:45:12 -05:00
A Frederick Christensen 23b3d7bc2c Document: patches target latest release by default 2024-07-16 23:26:54 -05:00
moe efa963d24b add mastercolumn-gaps patch to mastercolumn directory 2024-07-16 14:03:43 -04:00
choc 642b2559d5 ipc: 2024-07-16
replaces 2024-07-15 which had a typo
2024-07-16 19:13:03 +08:00
Guido Cella 87047eac10 remove upstreamed stale patches 2024-07-16 12:21:48 +02:00
Guido Cella 7431893328 remove unclutter dead links 2024-07-16 12:21:45 +02:00
Guido Cella 4c5d1df47f update unclutter 2024-07-16 10:15:37 +02:00
Ben Collerson b7b144c0c5 warpcursor: centre on focused client 2024-07-16 11:13:20 +10:00
Ben Collerson 0303d84424 warpcursor: fix annoying menu bug, rebase on v0.6 2024-07-16 10:40:49 +10:00
SD Asif Hossein e5f9cce3f2 Added scroll-factor patch 2024-07-15 17:19:21 +00:00
choc 413f6251ad ipc: 2024-07-15 2024-07-15 23:56:49 +08:00
Dhruva Sambrani 5252fe728e [skipfocus] do not unset-fullscreen 2024-07-14 15:31:42 +02:00
Dhruva Sambrani 6a40173c5b [gaplessgrid] add widescreen fix 2024-07-14 15:19:16 +02:00
Dhruva Sambrani 658ec0c00f update dim-unfocused 2024-07-14 14:55:26 +02:00
moe dd05729971 fixed readme location for mastercol 2024-07-13 17:28:08 -04:00
moe ceb5a13b52 add mastercolumn 2024-07-13 14:02:39 -04:00
choc 0a545f7826 swallow: 2024-07-13 2024-07-13 20:45:57 +08:00
Ben Collerson b62bfda94b namedscratchpads: rebased and adopted by me 2024-07-13 15:31:40 +10:00
choc 42f83f3d3b dragresize: 2024-07-10 2024-07-13 08:59:29 +08:00
Nikita Ivanov eac4feb72a Update menu patch 2024-07-13 01:11:05 +02:00
peesock 6f873540e9 gaps: update 2024-07-12 15:48:02 -07:00
wochap 3f7d082ae6 Update patches/gestures/README.md 2024-07-12 16:41:57 +00:00
wochap 407855647a Update patches/pointer-gestures-unstable-v1/README.md 2024-07-12 16:33:34 +00:00
wochap 05dbce217b add hold events 2024-07-12 16:32:58 +00:00
fauxmight f19182bd0f Revert invalid correction 2024-07-10 02:04:01 +00:00
fauxmight 0fc716315c Minor typo correction 2024-07-10 02:02:58 +00:00
wochap 67db96eae5 update borders README 2024-07-09 11:10:50 -05:00
wochap 1a6825f2b8 update borders patch 2024-07-09 11:10:09 -05:00
wochap 1b782ea999 update wochap patches README.md 2024-07-09 11:08:12 -05:00
wochap 13d96b51b5 sync gestures patch with latest dwl 2024-07-09 10:57:29 -05:00
wochap 3a3efa39b0 sync scenefx patch with latest dwl and latest scenefx pkg 2024-07-09 10:57:04 -05:00
wochap ff57f0b2e7 sync wochap patches with latest dwl 2024-07-09 10:56:43 -05:00
wochap 14928cda03 Update patches/relative-mouse-resize/README.md 2024-07-09 15:35:26 +00:00
wochap 0bd725d078 sync patch with latest dwl 2024-07-09 15:34:37 +00:00
wochap 8eaf7d071e Update patches/pointer-gestures-unstable-v1/README.md 2024-07-09 15:32:26 +00:00
wochap 02178ef444 Update patches/pointer-gestures-unstable-v1/README.md 2024-07-09 15:31:29 +00:00
wochap 2322f3efea sync patch with latest dwl 2024-07-09 10:30:21 -05:00
wochap 4a3528407f Update patches/bottomstack/README.md 2024-07-09 15:17:12 +00:00
wochap 20de07dc87 sync with latest dwl 2024-07-09 15:14:11 +00:00
choc 6a71cf9806 startargv: new patch 2024-07-03 12:12:10 +08:00
choc 9a751e5020 ipc: 2024-06-30 2024-06-30 16:48:50 +08:00
oak b7b92cfb57 Update README.md for barheight, added (bar 2024-06-26) 2024-06-26 22:24:25 +02:00
oak 00094598b1 Update README.md for barheight 2024-06-26 22:22:26 +02:00
sewn 32825de7e4 bar: 2024-06-27 2024-06-26 23:14:32 +03:00
choc f7f596b489 passthrough: rename passthru to passthrough
README.md: explain default keybind
2024-06-26 16:50:26 +08:00
oak 59d5b28396 bar: 2024-06-26 2024-06-26 10:38:10 +02:00
sewn d59e8cca26 rlimit_max: 2024-06-26 2024-06-26 10:14:15 +03:00
sewn 5ce3fdc2ed bar: 2024-06-26 2024-06-26 10:06:11 +03:00
peesock f92c23c607 fix gaps 2024-06-26 01:35:09 +00:00
Ben Collerson ffe63546c2 typo in link 2024-06-26 10:19:49 +10:00
Ben Collerson f51b935639 warpcursor: rebase and fixes
- centre pointer on new windows
- don't centre pointer when pointer moves between windows
2024-06-26 09:46:29 +10:00
Leonardo Hernández Hernández b629632b7c update autostart
13925eb1da8af2c1d23ee9d01efd03c3626081b2

Closes: https://codeberg.org/dwl/dwl-patches/issues/86
2024-06-25 00:48:11 -06:00
choc 438bef0317 passthrough: add author link to readme 2024-06-22 22:42:23 +08:00
choc 3f44fb23d8 passthrough: new patch 2024-06-22 22:36:54 +08:00
choc 42e9738221 swallow: rename freebsd.patch, update README 2024-06-22 20:26:19 +08:00
choc 6ceb3e3e58 swallow: add support for freebsd in separate patch 2024-06-22 20:12:01 +08:00
Dima Krasner 6f898cdbdf rebase dimkr patches 2024-06-21 13:33:56 +00:00
Ben Collerson 51231b4688 inputdevicerules: new patch 2024-06-21 15:39:45 +10:00
choc 18d283d374 tablet-input: update patch 2024-06-21 11:37:23 +08:00
choc f96ee44cba ipc: update patch 2024-06-21 11:36:17 +08:00
A Frederick Christensen c2a51a2aa7 Document patch removal policy 2024-06-20 18:05:19 -06:00
A Frederick Christensen 4a0df63d10 simpleborders patch for the wlroots-next branch
(And fix line endings)
2024-06-19 11:59:43 -05:00
choc e69afc7263 ipc: update patch 2024-06-20 00:41:07 +08:00
choc fee4da5cb6 tablet-input: update patch 2024-06-20 00:40:40 +08:00
choc bddc4ea379 fix useless indentation in readme list items 2024-06-19 23:50:55 +08:00
choc 0902729bc7 dragresize: add readme 2024-06-19 21:14:45 +08:00
choc 8c75e6dbc1 dragresize: new patch 2024-06-19 21:11:34 +08:00
yuki-was-taken 13d0b9cdb0 Updated the original author's profile link. 2024-06-18 19:53:18 +00:00
fauxmight 3570f1c695 Update patches/float-unfocused-border-color/float-unfocused-border-color.patch
Minor whitespace corrections.
2024-06-18 19:53:18 +00:00
yuki-was-taken 8cca8e4490 Fixed the patch file
I'm not sure why, but the subject had PATCH[1038/1038].
I redid the git format-patch command and it's fixed now.
2024-06-18 19:53:18 +00:00
yuki-was-taken 776723564c Remove the link to the original patch. 2024-06-18 19:53:18 +00:00
yuki-was-taken 3112ca49c0 Add date to patch readme. 2024-06-18 19:53:18 +00:00
yuki 033b45cadc Added float-unfocused-border-color patch. 2024-06-18 19:53:18 +00:00
fauxmight ae7086dc04 Update README.md 2024-06-18 19:48:36 +00:00
Ben Collerson 6381929534 fix ungroup-keyboards patch 2024-06-16 14:38:36 +10:00
Ben Collerson 5492f432a9 fix ungroup-keyboards README 2024-06-16 14:04:04 +10:00
Ben Collerson d8cdb9f186 add ungroup-keyboards patch 2024-06-16 13:57:42 +10:00
korei999 6f806dc096 update globalkey 2024-06-14 18:29:31 +03:00
Palanix 970ae42e95 Remove test line 2024-06-14 14:37:42 +02:00
fauxmight 77586bba5f Test PR merge capabilities of 'patchers' members 2024-06-14 12:35:32 +00:00
Leonardo Hernández Hernández fa3688d1a2 revive push patch 2024-06-13 15:03:47 -06:00
Leonardo Hernández Hernández a54021e958 update hide-behind-fullscreen
Fixes a bug where layer surfaces in the overlay layer would be disabled

additionally CR+LF -> LF
2024-06-13 14:20:28 -06:00
Leonardo Hernández Hernández dceece64ad update hide-behind monocle
additionally CR+LF -> LF

Fixes: https://codeberg.org/dwl/dwl-patches/issues/50
2024-06-13 14:20:28 -06:00
Rutherther 9e98f302ea keyboardshortcutsinhibit: apply to latest upstream 2024-06-12 20:21:44 +02:00
oak b9be81905f Update barheight.patch for bar 2024-06-10 2024-06-10 21:30:54 +02:00
sewn fc9f470ef3 hide_vacant_tags: bar 2024-06-10 2024-06-10 16:38:25 +03:00
sewn 2c021f570f barpadding: bar 2024-06-10 2024-06-10 16:38:25 +03:00
sewn 6f1648cee8 barborder: bar 2024-06-10 2024-06-10 16:38:25 +03:00
sewn c70d13bb18 bar: 2024-06-10; solves #53 2024-06-10 16:38:25 +03:00
korei999 5bf8944850 update globalkey 2024-06-08 20:11:51 +03:00
nullsystem 12a6e0d90e Update perinputconfig patch 2024-06-08 16:52:33 +01:00
choc f8598a91b4 ipc: update patch 2024-06-08 17:57:14 +08:00
Leonardo Hernández Hernández 69dc463030 update client-opacity patch 2024-06-07 16:03:28 -06:00
Leonardo Hernández Hernández 2fa6be6006 update vanitygaps patch
d1c6fa3d
2024-06-07 16:01:02 -06:00
Leonardo Hernández Hernández bc3ffb239b update smartborders patch
d758d9e3
2024-06-07 16:01:01 -06:00
Leonardo Hernández Hernández 04ac286b05 update numlock-capslock patch
488c815b
2024-06-07 16:01:00 -06:00
Leonardo Hernández Hernández 17b7dc6494 update master-right patch
7df91a90
2024-06-07 16:00:59 -06:00
Leonardo Hernández Hernández 0e2955ea97 update keycodes patch
0498877c
2024-06-07 16:00:58 -06:00
Leonardo Hernández Hernández bec2575e44 update hide-behind-monocle patch
cd89b1f0
2024-06-07 16:00:57 -06:00
Leonardo Hernández Hernández 63975b950f update hide-behind-fullscreen patch
a194d37c
2024-06-07 16:00:56 -06:00
Leonardo Hernández Hernández 5c2c36c7cc update coredump patch
5ffa5ec3
2024-06-07 16:00:55 -06:00
Leonardo Hernández Hernández 6830a60d8a update autostart patch
1ea0c8b1
2024-06-07 16:00:55 -06:00
Leonardo Hernández Hernández 3a5782449b update client-opacity
dd00d994ce4c53829d0b871622dc05e90a6f58c3
2024-06-07 15:51:06 -06:00
Leonardo Hernández Hernández 3e0305156c update autostart
dd00d994ce4c53829d0b871622dc05e90a6f58c3
2024-06-07 15:51:05 -06:00
Leonardo Hernández Hernández 36b055f18e update smartborders
dd00d994ce4c53829d0b871622dc05e90a6f58c3
2024-06-07 15:51:05 -06:00
sewn 486c375d0d README: fetch dwl remote upon adding 2024-06-07 11:43:20 +03:00
Ben Collerson f807d2536d rebase viewnextocctag patch to main 2024-06-07 08:47:44 +10:00
Ben Collerson 1812d4926a rebase titleurgent patch to main 2024-06-07 08:47:24 +10:00
Ben Collerson 766e439ae8 rebase singlemaster patch to main 2024-06-07 08:46:48 +10:00
Dhruva Sambrani ee1c40584a rebase skipfocus to main 2024-06-06 16:31:42 +02:00
Dhruva Sambrani 8d9d0bdb94 rebase winview to main 2024-06-06 16:22:57 +02:00
sewn 5dd53a5977 rlimit_patch: update for dwl 2024-06-06 16:57:34 +03:00
Guido Cella 6af0e5e209 update alwayscenter 2024-06-05 12:05:52 +02:00
korei999 e8e969a564 fix globalkey patch 2024-06-03 20:47:28 +03:00
choc 748b4bc6a7 tablet-input: update patch 2024-06-04 00:59:33 +08:00
korei999 39f4447d5d globalkey readme: typo 2024-06-03 13:38:28 +03:00
korei999 b3df1e07cd make globalkey restore surface correctly 2024-06-03 13:30:54 +03:00
sewn 1fa069584a barborder: update for bar 2024-05-28 2024-06-03 10:28:22 +03:00
korei999 b1198bdbee update globalkey 2024-06-03 05:02:40 +03:00
korei999 28ae88d385 Update patches/globalkey/README.md 2024-06-03 01:14:06 +00:00
korei999 08d6467153 add globalkey patch 2024-06-03 01:10:59 +00:00
Guido Cella ebde3bd764 update alwayscenter
Fixes https://codeberg.org/dwl/dwl-patches/issues/75 and
https://codeberg.org/dwl/dwl-patches/issues/76
2024-06-01 23:49:34 +02:00
choc e32d843417 env: rename to envcfg 2024-06-01 18:07:28 +08:00
Palanix 70d2ea226d Fix monfig crash during nested usage, fix NULL rule 2024-06-01 06:50:11 +02:00
Nikita Ivanov 5c86e65aa0 Fix kblayout 2024-06-01 02:37:13 +02:00
sewn d400a432ad bar: update preview because ugly ig 2024-05-28 13:28:35 +03:00
sewn a86c3b9239 bar: 2024-05-28 2024-05-28 13:27:06 +03:00
Jérôme 3ebb0248f3 stacker: renaming patch to lowercase 2024-05-20 13:07:01 +02:00
Jérôme eea38f9674 stacker: git branch added to README 2024-05-20 13:05:24 +02:00
Ben Collerson 670f010ccc [chainkeys] cancel the chain - fix issue #69 2024-05-20 10:03:46 +10:00
sewn b4f093c9cb add rlimit_max 2024-05-19 20:07:11 +03:00
fauxmight c91d27905e Cleanups to main README.md 2024-05-19 14:20:46 +00:00
Jérôme 7db5321c54 adding stacker patch 2024-05-19 14:13:28 +00:00
Nikita Ivanov 611c9f5744 Revive menu patch 2024-05-18 23:29:42 +02:00
Nikita Ivanov c29d2464da kblayout: per tag layout does not work 2024-05-17 00:12:43 +02:00
oak 168d6bf045 Update barheight 2024-05-16 13:02:57 +02:00
Dhruva Sambrani 424808cd19 update dim-unfocused 2024-05-16 12:38:57 +02:00
Ben Collerson b014e0e41e warpcursor patch 2024-05-16 11:21:44 +10:00
Ben Collerson 4021b0d41c adopt attachbottom 2024-05-16 10:58:34 +10:00
Ben Collerson 75e17ef588 singletagset Rutherther's fixes for issue #57 2024-05-16 09:58:29 +10:00
Ben Collerson 34c6a26ed2 update singletagset patch description to be clearer 2024-05-16 09:51:47 +10:00
Micah N Gorrell 529dfa157c Updated the less simple input patch to include fixes from anabasis 2024-05-12 11:01:52 -06:00
Rutherther 7f93815e9c keyboard-shortcuts-inhibit: revive 2024-05-11 08:16:59 +02:00
fauxmight be5dc5b9ce Clarify stale patches procedure 2024-05-11 03:48:44 +00:00
anabasis 7da34dd6a7 revive deck patch 2024-05-11 02:59:40 +00:00
Rutherther 3275b4b909 accessnthmon: introduce 2024-05-10 19:20:59 +02:00
Guido Cella fd26269b04 update alwayscenter
Fixes https://codeberg.org/dwl/dwl-patches/issues/58.
2024-05-10 17:44:28 +02:00
A Frederick Christensen 9c5d5d85f3 dwl-patches overhaul
Eliminated wiki.
Individual patches have a README.md explanation in their own subdirectory.
Simplified submission of new patches and maintenance of existing patches.
Instructions page (README.md autodisplayed) is now at https://codeberg.org/dwl/dwl-patches/
2024-05-09 23:12:04 -05:00
Ben Collerson d6b051f5b8 fix singletagset patch issue #56 2024-05-08 13:15:51 +10:00
Palanix 0c4851e4a0 Fix monitorconfig patch 2024-05-03 23:37:08 +02:00
choc 51e07cb4b7 tablet-input: new patch 2024-05-04 01:23:26 +08:00
wochap e58c3ec41a remove unnecessary changes in client.h 2024-05-02 22:27:19 +00:00
choc eb37047870 swallow: update patch 2024-05-02 00:33:56 +08:00
wochap 29c871d5ea add foreign-toplevel-management.patch 2024-04-29 14:55:41 +00:00
sewn 3a4d8157f5 bar: 2024-04-25 2024-04-25 17:51:44 +03:00
sewn 9820162b9f bar: 2024-24-04 2024-04-24 15:45:30 +03:00
Eldar Yusupov 7b3d32fbc3 restoremon: switch to early return 2024-04-23 11:09:25 +03:00
sewn 8287f9b148 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 7d7df32f29 bar: remove utf8.h, included with drwl 2024-04-16 23:59:41 +03:00
Dhruva Sambrani 47258482e2 update dim-unfocused to allow temporary toggling 2024-04-16 14:25:52 +02:00
sewn bbb80f7a91 barborder: bar 2024-04-14 2024-04-14 08:47:19 +03:00
sewn 54edef5264 barpadding: bar 2024-04-14 2024-04-14 08:21:50 +03:00
sewn a20b75a9fd hide_vacant_tags: update for bar 2024-04-14 2024-04-14 07:59:38 +03:00
sewn 0c8cc199dc bar: update 2024-04-14 2024-04-14 07:46:05 +03:00
Eldar Yusupov ac48b764da Fix crash when there is no active client 2024-04-13 18:29:35 +03:00
wochap 6e3a57ffd1 update scenefx for HEAD 2024-04-11 18:26:36 -05:00
wochap 7a5c342082 update minimalborders for HEAD 2024-04-11 18:24:54 -05:00
wochap be3735bc6a update gestures for HEAD 2024-04-11 18:23:43 -05:00
wochap 655fd2916c update relative-mouse-resize for HEAD 2024-04-11 18:20:49 -05:00
wochap b828e21717 update cursortheme for HEAD 2024-04-11 18:18:52 -05:00
wochap c676de59d5 update pointer-gestures-unstable-v1 for HEAD 2024-04-11 18:12:30 -05:00
wochap fc4146f306 update lockedkeys for HEAD 2024-04-11 18:10:58 -05:00
wochap 2a6560c167 update regexrules patch 2024-04-11 18:09:11 -05:00
wochap 98cba933c9 update customfloat for HEAD 2024-04-11 18:06:35 -05:00
wochap bf09845921 update pertag for HEAD 2024-04-11 18:04:04 -05:00
wochap b104a580a8 update centeredmaster for HEAD 2024-04-11 17:58:47 -05:00
wochap 0f4e40fee4 update bottomstack for HEAD 2024-04-11 17:56:11 -05:00
wochap 5368aa392c add options for blur and opacity 2024-04-10 16:01:50 +00:00
Nikita Ivanov ad9c35ea0d Add attachtop patch 2024-04-10 00:00:00 +00:00
sewn 887ad535ab update bar patch 2024-04-09 11:07:03 +03:00
wochap 0096e49402 add headless patch 2024-04-09 02:51:11 +00:00
wochap 5b226519b8 add virtual-pointer patch 2024-04-09 02:50:12 +00:00
Eldar Yusupov 6ac7aa1ed8 Add restore-monitor patch
Moves clients to their old output when it is reattached.
2024-04-07 15:41:44 +03:00
nullsystem cece11390f 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 7e367bbfd1 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 052cda672a port barheight patch from dwm 2024-04-06 13:49:34 +00:00
Oak d7ca084f1b port barheight patch from dwm 2024-04-06 13:49:34 +00:00
Guido Cella 185967aa4f 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 45d849cab5 Update scenefx/scenefx.patch 2024-04-05 14:49:25 +00:00
sewn b8a97a1295 bar: split sub-patches 2024-04-05 14:19:08 +03:00
choc 3c9a8e3232 swallow: update config.def.h 2024-04-03 11:31:20 +08:00
nullsystem ebba19380c 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 fece32c65f remove stale uselessgaps 2024-04-01 17:24:19 +03:00
sewn 56f5f5e3fa gaps: introduce 2024-04-01 17:16:51 +03:00
korei999 d76b3e5a4f update xwayland-handle-minimize 2024-04-01 15:19:06 +03:00
Guido Cella c0c1b7fac9 update switchtotag 2024-04-01 08:51:32 +02:00
nullsystem b76cefd279 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 b917e4936e add fakefullscreenclient patch
enable fake fullscreen per client
2024-03-29 22:57:26 +08:00
wochap 9147f25eca Update scenefx/scenefx.patch 2024-03-29 13:52:35 +00:00
A Frederick Christensen db9f58c0ff Remove simple-touch-input in favor of less-simple-touch-input 2024-03-28 20:19:35 +00:00
Micah N Gorrell bb24660607 Updated the less-simple-touch-input patch 2024-03-28 11:27:42 -06:00
Guido Cella 9a37e365ad 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 d5f6fbd853 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 c567df584f Add press_repeat_release patch 2024-03-27 16:01:42 -06:00
Micah N Gorrell 63de53fa35 Add remembertags patch 2024-03-27 13:06:24 -06:00
Micah N Gorrell 5a2ac3b42d Add hiderule patch 2024-03-27 12:55:06 -06:00
Micah N Gorrell 4745504170 Add varcol layout patch 2024-03-27 12:36:36 -06:00
David Donahue c981ea8bd9 Added toggle_constraints patch 2024-03-26 17:52:34 -06:00
Micah N Gorrell 2a6e98d532 Update less-simple-touch-input patch based on pointer contstraints being added upstream 2024-03-26 10:35:19 -06:00
choc 67f16db3df add setupenv patch
allow configuring environment variables in config.h
2024-03-26 22:16:17 +08:00
sewn deee415bb4 bar: fix bug (updatebardims) 2024-03-25 00:16:26 +03:00
sewn cfac8fab2a bar: add hide_vacant_tags 2024-03-24 23:07:40 +03:00
wochap 924b14e6f6 add scenefx patch 2024-03-24 00:19:22 +00:00
A Frederick Christensen 5130d0fe27 Cleanup after image hosting testing 2024-03-23 13:49:01 -05:00
A Frederick Christensen b6e2665050 Testing image inclusion 2024-03-23 12:42:45 -05:00
sewn 060751cf0d bar: update patches 2024-03-23 19:21:10 +03:00
sewn d48f9af544 bar: add border patch 2024-03-23 14:10:37 +03:00
korei999 2a2bb658f9 add xwayland-handle-minimize patch 2024-03-21 23:30:08 +02:00
wochap 1c2a00f057 fix https://discord.com/channels/792077480227110922/792077928728494131/1219337522073702490 2024-03-18 22:51:06 +00:00
sewn 8c1016d049 bar: add barpadding 2024-03-19 00:20:10 +03:00
sewn 51ca832d5c bar: update 2024-03-18 2024-03-18 20:19:25 +03:00
Gavin M 921574f4c2 Updated tab/tab.patch, fixed floating window labels 2024-03-18 01:36:46 +00:00
Gavin M b6031b0c38 Add limitnmaster patch 2024-03-16 12:11:44 +00:00
Gavin M fc1e77b549 Added togglekblayoutandoptions patch 2024-03-16 12:11:10 +00:00
Gavin M 81ab31a108 added tab patch 2024-03-15 16:43:41 -05:00
choc 0150cfebbc update ipc 2024-03-13 21:48:59 +08:00
Marcin Pachur 83b80ddd6d Remove screenshots
Signed-off-by: Marcin Pachur <pm4rcin@noreply.codeberg.org>
2024-03-13 04:22:16 +00:00
Marcin Pachur 5a314f3259 Remove pointerconstraints patches
Signed-off-by: Marcin Pachur <pm4rcin@noreply.codeberg.org>
2024-03-13 04:22:16 +00:00
A Frederick Christensen 2723afe575 Update simple-touch-input.patch since pointer constraints merge 2024-03-12 23:07:44 -05:00
wochap cab910fd1a add relative-mouse-resize patch
allow you to resize from each corner
2024-03-11 22:26:51 +00:00
wochap 6379c9af6c add minimalborders patch
it merge adjacent borders
2024-03-11 22:26:51 +00:00
wochap 7793c3facc add borders patch
this patch adds 2 borders to each side (top,bottom,left,right)
2024-03-11 22:26:51 +00:00
wochap 95a3729334 reintroduce togglekblayout 2024-03-11 22:26:51 +00:00
wochap 35f1519770 remove swapandfocusdir from stale folder
export swapandfocusdir with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap a10e7f4aef remvoe regexrules from stale folder
export regexrules patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 42002d1d1e 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 3f9a58cde9 reintroduce pertag 2024-03-11 22:26:51 +00:00
wochap cc3cc88ce0 reintroduce namedscratchpads 2024-03-11 22:26:51 +00:00
wochap b4156fc8c2 reintroduce movestack 2024-03-11 22:26:51 +00:00
wochap 4a53aaedf2 remove moveresizekb from stale folder
export moveresize patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 14d7455154 reintroduce movecenter 2024-03-11 22:26:51 +00:00
wochap 76d412227c remove modes patch from stale folder
re export modes patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap 635835d17d remove lockedkeys from stale folder
re export lockedkeys with `git format-path`
2024-03-11 22:26:51 +00:00
wochap 0c45f82fd2 remove gesture from stale folder
re export patch with `git format-patch`
2024-03-11 22:26:51 +00:00
wochap af311629bc reintroduce customfloat 2024-03-11 22:26:51 +00:00
wochap 684fb8b3f4 reintroduce cursortheme 2024-03-11 22:26:51 +00:00
wochap b53fc4699d reintroduce centeredmaster 2024-03-11 22:26:51 +00:00
wochap 12b0902ef2 reintroduce bottomstack 2024-03-11 22:26:51 +00:00
wochap aa514bf28e reintroduce lockedkeys 2024-03-11 22:26:51 +00:00
wochap 3523e24d53 reintroduce modes patch 2024-03-11 22:26:51 +00:00
wochap 9edefb219a reintroduce moveresizekb patch 2024-03-11 22:26:51 +00:00
wochap 416dc1c5c7 reintroduce swapandfocusdir patch 2024-03-11 22:26:51 +00:00
wochap 6a8af18b61 reintroduce regexrules patch 2024-03-11 22:26:51 +00:00
wochap 772abc86d0 reintroduce gestures patch 2024-03-11 22:26:51 +00:00
wochap 3506c50d0f reintroduce pointer-gestures-unstable-v1 patch 2024-03-11 22:26:51 +00:00
Guido Cella c7ee39fb2c update unclutter 2024-03-11 18:55:39 +01:00
Guido Cella 7ee501eaea update unclutter 2024-03-11 18:48:08 +01:00
Guido Cella 8f6a71e1e9 update switchtotag 2024-03-11 18:45:48 +01:00
sewn 4ac941e1f1 update bar patch 2024-03-01 18:47:45 +03:00
Palanix 2555207b57 Update monfig 2024-02-26 19:27:43 +01:00
sewn eb063627dc introduce bar patch 2024-02-20 21:27:30 +03:00
choc 0c5ae06e4b ipc: integer comparison expression fixed
Co-authored-by: @snuk <slackernetuk@gmail.com>
2024-02-20 22:36:04 +08:00
Palanix 3e1e9fb294 Update monfig 2024-02-19 17:33:14 +01:00
choc ca13e27743 remove virtualpointer patch
already implemented in base dwl since commit ac6074f
2024-02-19 22:36:23 +08:00
choc 7d17bbf3ea Reintroduce ipc patch 2024-02-19 22:36:13 +08:00
Palanix 802a2d1af1 Reintroduce monfig patch 2024-02-16 23:43:55 +01:00
Palanix b2581e4465 Update dragmfact 2024-02-16 23:29:23 +01:00
Palanix 713c27856b Reintroduce dragmfact 2024-02-16 23:24:31 +01:00
Palanix 70107495f3 Reintroduce zoomswap 2024-02-15 19:06:19 +01:00
Palanix bde90ec194 Update cfact patch 2024-02-15 18:19:24 +01:00
sewn dc57f8e43f re-introduce regions patch 2024-02-14 22:09:35 +03:00
Abanoub 1d119cc85c Add define-modkey-with-make-argument patch 2024-02-13 23:07:42 +00:00
ldev ad5c210619 focusdir fix whitespace was edited above the focusdir function 2024-02-12 21:54:23 +01:00
Dima Krasner 59e4dd61f3 update dimkr patches 2024-02-11 09:10:28 +02:00
Micah N Gorrell 1bbf778597 Add less-simple-touch-input 2024-02-10 19:40:59 +00:00
korei999 e071166664 Delete _STALE_PATCHES/rotatetags.md 2024-02-10 15:05:25 +00:00
Guido Cella 6981befe48 update unclutter 2024-02-09 14:58:59 +01:00
Guido Cella 7e5e4adacc remove upstreamed toggle-layout-immediately 2024-02-07 07:17:23 +01:00
Guido Cella d9fe9d0fe2 update alwayscenter and center-terminal 2024-02-06 09:21:22 +01:00
Guido Cella e2b487ee47 update unclutter 2024-02-05 13:28:05 +01:00
Palanix 8a3709bf3a Reintroduce cfacts patch 2024-01-27 23:03:51 +00:00
Guido Cella 9bbae57be5 update shiftview 2024-01-27 22:45:46 +01:00
A Frederick Christensen 3a71377bb0 Update simple-touch-input patch 2024-01-25 19:21:21 -06:00
Guido Cella ff1c7e351e update unclutter
Make it compatible with the newly merged virtual pointer protocol.
2024-01-25 19:19:51 +01:00
ldev 4a339aa239 update patch 2024-01-23 11:44:06 +00:00
ldev f9390726e8 fixed: patch file wasn't in the right directory 2024-01-23 11:44:06 +00:00
ldev 37c6222c2a added focusdir patch 2024-01-23 11:44:06 +00:00
korei999 71f6e6d904 add rotatetags patch 2024-01-23 11:37:11 +00:00
korei999 aa2c5b40cf add rotatetags 2024-01-23 11:37:11 +00:00
ForzCross 11bf412a25 revive kblayout 2024-01-21 16:32:41 +03:00
Guido Cella 09bd313f9a update shiftview
Fix a warning.
2024-01-17 21:18:22 +01:00
Ben Collerson bdd3213b4b update chainkeys patch 2024-01-17 11:33:58 +10:00
Guido Cella b34818c2b4 update my patches 2024-01-16 19:11:34 +01:00
A Frederick Christensen 2d1d755897 Add simple-touch-input 2024-01-14 11:18:58 -06:00
A Frederick Christensen 9df5c866e1 naturalscrolltrackpad updated, removed from _STALE_PATCHES 2024-01-14 09:50:49 -06:00
ForzCross 499d582fdc Add en-keycodes 2024-01-11 20:32:41 +03:00
A Frederick Christensen f8a98de76a remove old en-keycodes patch 2024-01-10 14:04:53 -06:00
Dhruva Sambrani 4cf16ae5c5 revive gaplessgrid 2024-01-08 16:17:38 +01:00
Dhruva Sambrani c80dcb9a2d update skipfocus 2024-01-08 15:41:58 +01:00
Dhruva Sambrani 425132696f update dhruva_sambrani patches 2024-01-08 15:18:22 +01:00
neuromagus ab65f23d4b added naturalscrolltrackpad patch 2024-01-07 06:08:56 +03:00
Ben Collerson 84579f0e61 add simpleborders 2024-01-07 11:26:39 +10:00
Dhruva Sambrani 375178be4f rename skipfocus name 2024-01-06 15:50:59 +01:00
Dhruva Sambrani 79c4b8673e Merge branch 'main' of https://codeberg.org/dwl/dwl-patches 2024-01-06 15:48:24 +01:00
Dhruva Sambrani a367d4315e fix skipfocus patch Rule order 2024-01-06 15:48:17 +01:00
Ben Collerson b03f6f13a6 add viewnextocctag patch 2024-01-06 22:47:04 +10:00
Ben Collerson fd8cec8608 add singlemaster patch 2024-01-06 22:26:46 +10:00
Dhruva Sambrani 2e5f249820 add skipfocus 2024-01-06 00:44:24 +01:00
Ben Collerson 8bc1939e2f singletagset was missing VISIBLEON fix 2024-01-05 11:01:46 +10:00
A Frederick Christensen 86a43bcd97 Update README.md 2024-01-02 17:00:26 +00:00
A Frederick Christensen e47b369054 "Reporting Issues" segment added 2024-01-02 16:08:51 +00:00
A Frederick Christensen f5c9735c35 Update README.md 2024-01-02 15:41:02 +00:00
Ben Collerson efd577ff89 layout fix for titleurgent patch 2024-01-03 00:23:13 +10:00
Ben Collerson 68cd02b384 add unclutter patch 2024-01-02 23:39:59 +10:00
Ben Collerson f78cc828e1 add titleurgent patch 2024-01-02 22:36:52 +10:00
Ben Collerson a9a4b4e019 remove updated stale patches 2024-01-02 22:19:09 +10:00
Ben Collerson 523666914d add column patch 2024-01-02 21:59:06 +10:00
Ben Collerson bdf407a942 add singletagset patch 2024-01-02 21:38:53 +10:00
Ben Collerson 591a36a5d9 add chainkeys patch 2024-01-02 21:21:19 +10:00
A Frederick Christensen 9732a28a31 Patches.md page erroneously copied from dwl/dwl 2024-01-02 01:17:04 -06:00
A Frederick Christensen 18f8ee08d8 Move stale patches in from dwl/dwl 2024-01-02 00:59:59 -06:00
A Frederick Christensen f86aeeede4 Move en-keycodes.patch from dwl/dwl.wiki 2024-01-02 00:35:38 -06:00
A Frederick Christensen 6fc039c151 Move dimkr patches from dwl/dwl.wiki 2024-01-01 23:40:54 -06:00
A Frederick Christensen 979ea455f1 Move dhruva_sambrani patches in from dwl/dwl wiki 2024-01-01 22:58:13 -06:00
Leonardo Hernández Hernández 8e966fc380 add client-opacity (adbc47f) 2024-01-01 15:09:24 -06:00
A Frederick Christensen 0c5626a2f8 Update README.md 2024-01-01 07:30:01 +00:00
A Frederick Christensen 692d5066d6 Update README.md 2024-01-01 07:24:43 +00:00
A Frederick Christensen dcb8e6ff14 Update README.md 2024-01-01 05:34:19 +00:00
choc 8a352a1b27 add swallow patch 2024-01-01 09:13:47 +08:00
A Frederick Christensen 182158c899 Update README.md 2023-12-31 23:39:34 +00:00
A Frederick Christensen 1fa5075272 Update README.md 2023-12-31 23:25:39 +00:00
Leonardo Hernández Hernández ac59f12b12 separate author and branch 2023-12-31 15:46:00 -06:00
Leonardo Hernández Hernández 41b108ce69 suggest upstream instead of codeberg-dwl 2023-12-31 15:37:10 -06:00
Leonardo Hernández Hernández b5c159c65e simplify links 2023-12-31 15:37:10 -06:00
A Frederick Christensen dc80ef57b5 Update README.md 2023-12-31 20:54:21 +00:00
A Frederick Christensen bd3fa2ffcc Update README.md 2023-12-31 20:29:19 +00:00
A Frederick Christensen 03fd4cdb54 Update README.md 2023-12-31 20:13:54 +00:00
Leonardo Hernández Hernández 17e475a5df update numlock/capslock
f876192

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

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

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

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

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

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

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

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

no one noticed, right?
2023-12-29 02:23:18 +00:00
A Frederick Christensen cca216249a Update README.md 2023-12-27 12:35:00 +00:00
A Frederick Christensen afe7c61ce6 Update README.md 2023-12-27 04:49:33 +00:00
A Frederick Christensen 9bbeec1453 Update README.md 2023-12-27 04:33:06 +00:00
A Frederick Christensen d7e1ef2631 Update README.md 2023-12-27 04:24:30 +00:00
A Frederick Christensen f4bd84fb13 Update README.md 2023-12-27 03:45:32 +00:00
A Frederick Christensen 7fe5dd82bb Update README.md 2023-12-27 03:43:57 +00:00
Leonardo Hernández Hernández 73dcba2ea2 add vanitygaps patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 7707611555 add smartborders patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 24cf2edece add numlock-capslock patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 0ea1704374 add master-right patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 19b80e5d63 add keycodes patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 1d78bcad82 add hide-behind-monocle patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández c0b5f9a697 add hide-behind-fullscreen patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández aa1b6c92cc add coredump patch
c2e6583
2023-12-26 16:14:45 -06:00
Leonardo Hernández Hernández 24b46819be add autostart patch
c2e6583
2023-12-26 16:09:27 -06:00
Leonardo Hernández Hernández 98a381ac56 first commit 2023-12-15 23:40:47 -06:00
387 changed files with 31598 additions and 5614 deletions
+86 -4
View File
@@ -1,5 +1,87 @@
## 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.
# 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.
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.
*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 [Codeberg nick is mandatory; other contact methods optional]
- [YOUR_NICK](https://codeberg.org/USERNAME)
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/upates to your patches instead of pull requests.
Individuals who have made known that they no longer intend to maintain their patches will have commit access to the [dwl-pathces] 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
##
-8
View File
@@ -1,8 +0,0 @@
### 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
@@ -1,10 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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)
-40
View File
@@ -1,40 +0,0 @@
### 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
@@ -1,10 +0,0 @@
### 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
@@ -1,27 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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)
-27
View File
@@ -1,27 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,7 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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
@@ -1,25 +0,0 @@
### 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
@@ -1,10 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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
@@ -1,15 +0,0 @@
### 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)
-44
View File
@@ -1,44 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,15 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,12 +0,0 @@
### 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
@@ -1,23 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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
@@ -1,11 +0,0 @@
### 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
@@ -1,8 +0,0 @@
### 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)
@@ -1,8 +0,0 @@
### 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
@@ -1,11 +0,0 @@
### 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
@@ -1,25 +0,0 @@
### 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
@@ -1,9 +0,0 @@
### 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
@@ -1,25 +0,0 @@
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
-1005
View File
File diff suppressed because it is too large Load Diff
-128
View File
@@ -1,128 +0,0 @@
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
@@ -1,35 +0,0 @@
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
@@ -1,78 +0,0 @@
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
-77
View File
@@ -1,77 +0,0 @@
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
-75
View File
@@ -1,75 +0,0 @@
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
-187
View File
@@ -1,187 +0,0 @@
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
@@ -1,598 +0,0 @@
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
-79
View File
@@ -1,79 +0,0 @@
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
@@ -1,421 +0,0 @@
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
-105
View File
@@ -1,105 +0,0 @@
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
+9
View File
@@ -0,0 +1,9 @@
### Description
Port of dwm's accessnthmon. Adds functions to tag and focus monitor by index.
### Download
- [git branch](https://codeberg.org/Rutherther/dwl/src/branch/patch/accessnthmonitor)
- [2024-05-10](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/accessnthmon/accessnthmon.patch)
### Authors
- [Rutherther](https://codeberg.org/Rutherther)
- [Palanix](https://codeberg.org/Palanix)
+122
View File
@@ -0,0 +1,122 @@
From 5f531bfb1387ded7b8817faf7df760d3b998742b Mon Sep 17 00:00:00 2001
From: Rutherther <rutherther@proton.me>
Date: Sat, 27 Apr 2024 21:25:16 +0200
Subject: [PATCH] feat: access nth monitor
---
config.def.h | 4 +++-
dwl.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 8847e58..4709c5d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -108,7 +108,9 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
{ 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_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }, \
+ { WLR_MODIFIER_ALT, KEY, focusnthmon, {.ui = TAG} }, \
+ { WLR_MODIFIER_ALT|WLR_MODIFIER_SHIFT, SKEY, tagnthmon, {.ui = TAG} }
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
diff --git a/dwl.c b/dwl.c
index bf763df..1d42caf 100644
--- a/dwl.c
+++ b/dwl.c
@@ -11,6 +11,7 @@
#include <time.h>
#include <unistd.h>
#include <wayland-server-core.h>
+#include <wayland-util.h>
#include <wlr/backend.h>
#include <wlr/backend/libinput.h>
#include <wlr/render/allocator.h>
@@ -278,8 +279,10 @@ 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 Monitor *dirtomon(enum wlr_direction dir);
+static Monitor *numtomon(int num);
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
+static void focusnthmon(const Arg *arg);
static void focusstack(const Arg *arg);
static Client *focustop(Monitor *m);
static void fullscreennotify(struct wl_listener *listener, void *data);
@@ -329,6 +332,7 @@ static void spawn(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 tagnthmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
@@ -1233,6 +1237,25 @@ dirtomon(enum wlr_direction dir)
return selmon;
}
+Monitor *
+numtomon(int num)
+{
+ Monitor *m = NULL;
+ int found = 0;
+ int i = 0;
+
+ wl_list_for_each(m, &mons, link) {
+ if (!m->wlr_output->enabled)
+ i--;
+ else if (i == num) {
+ found = true;
+ break;
+ }
+ i++;
+ }
+ return found ? m : NULL;
+}
+
void
focusclient(Client *c, int lift)
{
@@ -1320,6 +1343,16 @@ focusmon(const Arg *arg)
focusclient(focustop(selmon), 1);
}
+void
+focusnthmon(const Arg *arg)
+{
+ Monitor *m = numtomon(arg->i);
+ if (!m || m == selmon)
+ return;
+ selmon = m;
+ focusclient(focustop(selmon), 1);
+}
+
void
focusstack(const Arg *arg)
{
@@ -2569,6 +2602,19 @@ tagmon(const Arg *arg)
setmon(sel, dirtomon(arg->i), 0);
}
+void
+tagnthmon(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ Monitor *m = numtomon(arg->i);
+ if (!m || !sel)
+ return;
+ setmon(sel, m, 0);
+
+ arrange(selmon);
+ arrange(m);
+}
+
void
tile(Monitor *m)
{
--
2.44.0
+9
View File
@@ -0,0 +1,9 @@
### Description
Automatically center floating windows.
### Download
- [git branch](https://codeberg.org/guidocella/dwl/src/branch/alwayscenter)
- [2024-06-05](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/alwayscenter/alwayscenter.patch)
### Authors
- [Guido Cella](https://codeberg.org/guidocella)
+39
View File
@@ -0,0 +1,39 @@
From f43a49324c2ddd21100d6308d1adde9d894746e2 Mon Sep 17 00:00:00 2001
From: Guido Cella <guido@guidocella.xyz>
Date: Wed, 5 Jun 2024 12:05:16 +0200
Subject: [PATCH] center floating windows
---
dwl.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dwl.c b/dwl.c
index 12f441e..c377c67 100644
--- a/dwl.c
+++ b/dwl.c
@@ -499,6 +499,11 @@ applyrules(Client *c)
}
}
+ if (mon) {
+ 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;
+ }
+
c->isfloating |= client_is_float_type(c);
setmon(c, mon, newtags);
}
@@ -1787,6 +1792,10 @@ mapnotify(struct wl_listener *listener, void *data)
* If there is no parent, apply rules */
if ((p = client_get_parent(c))) {
c->isfloating = 1;
+ if (p->mon) {
+ c->geom.x = (p->mon->w.width - c->geom.width) / 2 + p->mon->m.x;
+ c->geom.y = (p->mon->w.height - c->geom.height) / 2 + p->mon->m.y;
+ }
setmon(c, p->mon, p->tags);
} else {
applyrules(c);
--
2.49.0
+10
View File
@@ -0,0 +1,10 @@
### Description
Newly created windows are placed at the bottom of the client tile stack.
### Download
- [git branch](https://codeberg.org/bencc/dwl/src/branch/attachbottom)
- [2024-05-16](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/attachbottom/attachbottom.patch)
### Authors
- [Ben Collerson](https://codeberg.org/bencc)
- [Aurel Weinhold](https://github.com/AurelWeinhold)
+29
View File
@@ -0,0 +1,29 @@
From 0dda3ed8634154fd3887b71133b451d66a11b61d Mon Sep 17 00:00:00 2001
From: Ben Collerson <benc@benc.cc>
Date: Thu, 4 Jan 2024 23:31:41 +1000
Subject: [PATCH] attachbottom
---
dwl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index bf763dfc..12e08e2b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1605,7 +1605,11 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.height += 2 * c->bw;
/* Insert this client into client lists. */
- wl_list_insert(&clients, &c->link);
+ if (clients.prev)
+ // tile at the bottom
+ wl_list_insert(clients.prev, &c->link);
+ else
+ wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus:
--
2.43.0
+11
View File
@@ -0,0 +1,11 @@
### Description
Makes windows attach below the currently active window.
KNOWN ISSUES: Upon closing the last client when using multiple monitors, the last client will briefly flash on all
monitors before closing.
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/attachfocused/attachfocused.patch)
### Authors
- [MayOrMayNotBeACat](https://codeberg.org/MayOrMayNotBeACat)
+29
View File
@@ -0,0 +1,29 @@
From d03851c14073874f5b3d19a095e184dc24d219cd Mon Sep 17 00:00:00 2001
From: MayOrMayNotBeACat <maybeacat804@gmail.com>
Date: Sun, 11 May 2025 20:24:51 -0400
Subject: [PATCH] Make new windows attach to active client
---
dwl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dwl.c b/dwl.c
index cf3ef70..1907c5f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1726,7 +1726,11 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.height += 2 * c->bw;
/* Insert this client into client lists. */
- wl_list_insert(&clients, &c->link);
+ Client* focused = focustop(selmon);
+ if (focused)
+ wl_list_insert(&focused->link, &c->link);
+ else
+ wl_list_insert(&clients, &c->link);
wl_list_insert(&fstack, &c->flink);
/* Set initial monitor, tags, floating status, and focus:
--
2.49.0
@@ -1,5 +1,4 @@
### 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.
@@ -7,7 +6,8 @@ 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
- [2023-07-15](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:attachtop.patch)
- [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)
### Authors
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
- [Nikita Ivanov](https://codeberg.org/nikitaivanov)
@@ -1,4 +1,4 @@
From 42a66d6e06c38e913766ce625f049fdbc3dd0d12 Mon Sep 17 00:00:00 2001
From 29e6a4bef02c473cc5bd04804fe508bda265077d 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..c0a3d74 100644
index bf763df..02e3d07 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1605,7 +1605,18 @@ mapnotify(struct wl_listener *listener, void *data)
@@ -18,7 +18,7 @@ index bf763df..c0a3d74 100644
- wl_list_insert(&clients, &c->link);
+ i = 0;
+ wl_list_for_each(w, &clients, link) {
+ if (!VISIBLEON(w, selmon) || c->isfloating)
+ if (!VISIBLEON(w, selmon) || w->isfloating)
+ continue;
+ p = w;
+ if (++i >= selmon->nmaster)
@@ -32,5 +32,5 @@ index bf763df..c0a3d74 100644
/* Set initial monitor, tags, floating status, and focus:
--
2.44.0
2.49.0
+14
View File
@@ -0,0 +1,14 @@
### Description
Allow dwl to execute commands from autostart array in your config.h file. And when you exit dwl all processes from autostart array will be killed.
Note: Commands from array are executed using execvp(). So if you need to execute shell command you need to prefix it with "sh", "-c" (change sh to any shell you like).
### Download
- [git branch](https://codeberg.org/sevz/dwl/src/branch/autostart)
- [2025-01-20](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/autostart/autostart.patch)
- [0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/autostart/autostart-0.7.patch)
### Authors
- [sevz](https://codeberg.org/sevz)
- [Rayan Nakib](https://nakibrayan2.pages.dev/)
- [NFVblog](https://github.com/nf02)
@@ -1,4 +1,4 @@
From 51d56a433f23e13ac711b283a03c7903068febf6 Mon Sep 17 00:00:00 2001
From 787f7252d63945996f009828aff3c44afd0f7781 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
@@ -15,10 +15,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
2 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/config.def.h b/config.def.h
index a8ed61d..3585711 100644
index 22d2171..8dc6502 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
@@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
/* logging */
static int log_level = WLR_ERROR;
@@ -29,14 +29,14 @@ index a8ed61d..3585711 100644
+};
+
+
/* 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 */
/* examples:
/* app_id title tags mask isfloating monitor */
diff --git a/dwl.c b/dwl.c
index 10d5a5b..bbbef2b 100644
index 5bf995e..e8b8727 100644
--- a/dwl.c
+++ b/dwl.c
@@ -236,6 +236,7 @@ static void arrange(Monitor *m);
@@ -249,6 +249,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);
@@ -44,7 +44,7 @@ index 10d5a5b..bbbef2b 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);
@@ -403,6 +404,9 @@ static xcb_atom_t netatom[NetLast];
@@ -432,6 +433,9 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
@@ -54,7 +54,7 @@ index 10d5a5b..bbbef2b 100644
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -533,6 +537,27 @@ arrangelayers(Monitor *m)
@@ -580,6 +584,27 @@ arrangelayers(Monitor *m)
}
}
@@ -82,7 +82,7 @@ index 10d5a5b..bbbef2b 100644
void
axisnotify(struct wl_listener *listener, void *data)
{
@@ -630,11 +655,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
@@ -676,11 +701,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
void
cleanup(void)
{
@@ -102,9 +102,9 @@ index 10d5a5b..bbbef2b 100644
+ }
+
if (child_pid > 0) {
kill(child_pid, SIGTERM);
kill(-child_pid, SIGTERM);
waitpid(child_pid, NULL, 0);
@@ -1294,18 +1329,31 @@ void
@@ -1497,18 +1532,31 @@ void
handlesig(int signo)
{
if (signo == SIGCHLD) {
@@ -141,7 +141,7 @@ index 10d5a5b..bbbef2b 100644
} else if (signo == SIGINT || signo == SIGTERM) {
quit(NULL);
}
@@ -1965,6 +2013,7 @@ run(char *startup_cmd)
@@ -2224,6 +2272,7 @@ run(char *startup_cmd)
die("startup: backend_start");
/* Now that the socket exists and the backend is started, run the startup command */
@@ -150,5 +150,5 @@ index 10d5a5b..bbbef2b 100644
int piperw[2];
if (pipe(piperw) < 0)
--
2.43.0
2.45.2
+148
View File
@@ -0,0 +1,148 @@
From 3b0b0249d900121a90528616f4d11f733c7a5ca2 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 | 7 +++++++
dwl.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/config.def.h b/config.def.h
index 22d2171d..8dc6502c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
/* logging */
static int log_level = WLR_ERROR;
+/* Autostart */
+static const char *const autostart[] = {
+ "wbg", "/path/to/your/image", NULL,
+ NULL /* terminate */
+};
+
+
/* 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 */
diff --git a/dwl.c b/dwl.c
index ad21e1ba..3118e07f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -246,6 +246,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);
+static void autostartexec(void);
static void axisnotify(struct wl_listener *listener, void *data);
static void buttonpress(struct wl_listener *listener, void *data);
static void chvt(const Arg *arg);
@@ -455,6 +456,9 @@ static struct wlr_xwayland *xwayland;
/* attempt to encapsulate suck into one file */
#include "client.h"
+static pid_t *autostart_pids;
+static size_t autostart_len;
+
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -599,6 +603,27 @@ arrangelayers(Monitor *m)
}
}
+void
+autostartexec(void) {
+ const char *const *p;
+ size_t i = 0;
+
+ /* count entries */
+ for (p = autostart; *p; autostart_len++, p++)
+ while (*++p);
+
+ autostart_pids = calloc(autostart_len, sizeof(pid_t));
+ for (p = autostart; *p; i++, p++) {
+ if ((autostart_pids[i] = fork()) == 0) {
+ setsid();
+ execvp(*p, (char *const *)p);
+ die("dwl: execvp %s:", *p);
+ }
+ /* skip arguments */
+ while (*++p);
+ }
+}
+
void
axisnotify(struct wl_listener *listener, void *data)
{
@@ -695,12 +720,23 @@ checkidleinhibitor(struct wlr_surface *exclude)
void
cleanup(void)
{
+ size_t i;
+
cleanuplisteners();
#ifdef XWAYLAND
wlr_xwayland_destroy(xwayland);
xwayland = NULL;
#endif
wl_display_destroy_clients(dpy);
+
+ /* kill child processes */
+ for (i = 0; i < autostart_len; i++) {
+ if (0 < autostart_pids[i]) {
+ kill(autostart_pids[i], SIGTERM);
+ waitpid(autostart_pids[i], NULL, 0);
+ }
+ }
+
if (child_pid > 0) {
kill(-child_pid, SIGTERM);
waitpid(child_pid, NULL, 0);
@@ -1551,10 +1587,25 @@ gpureset(struct wl_listener *listener, void *data)
void
handlesig(int signo)
{
- if (signo == SIGCHLD)
- 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)
+ child_pid = -1;
+ if (!(p = autostart_pids))
+ continue;
+ lim = &p[autostart_len];
+
+ for (; p < lim; p++) {
+ if (*p == pid) {
+ *p = -1;
+ break;
+ }
+ }
+ }
+ } else if (signo == SIGINT || signo == SIGTERM) {
quit(NULL);
+ }
}
void
@@ -2241,6 +2292,7 @@ run(char *startup_cmd)
die("startup: backend_start");
/* Now that the socket exists and the backend is started, run the startup command */
+ autostartexec();
if (startup_cmd) {
int piperw[2];
if (pipe(piperw) < 0)
--
2.48.0
+19
View File
@@ -0,0 +1,19 @@
### Description
Add a system tray to the [bar](/dwl/dwl-patches/src/branch/main/patches/bar).
To keep dependencies to minimum, icon(svg) loading from the filesystem is not
supported. Applications that expect this will show the initial letter of the
program name, instead of a real icon.
Menus for the icons are handled by a dmenu-like program of the user's choice.
### Dependencies
- [bar.patch](/dwl/dwl-patches/src/branch/main/patches/bar)
- [libdbus](https://gitlab.freedesktop.org/dbus/dbus)
### Download
- [git branch](/janetski/dwl/src/branch/0.7-bar-systray)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar-systray/bar-systray-0.7.patch)
### Authors
- [janetski](https://codeberg.org/janetski) ([.vetu](https://discordapp.com/users/355488216469471242) on discord)
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
### Description
Add a bar identical to dwm's bar.
To use a status-bar, you can pass in status text via stdin:
```
slstatus -s | dwl
```
### Dependencies
* tllist (build dependency, required & pulled automatically by fcft)
* fcft
* pixman
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.7.patch)
- [0.6](/dwl/dwl-patches/raw/branch/main/patches/bar/bar-0.6.patch)
It is required to remove, regenerate or update `config.h` after applying the patch,
since it makes changes to the configuration structure.
For example, in the `pertag` patch, `TAGCOUNT` must be replaced with `LENGTH(tags)`.
Below is a preview of the patch.
![bar patch preview](bar.png)
### Authors
- [sewn](https://codeberg.org/sewn)
### Credits
- [MadcowOG](https://github.com/MadcowOG)
- [kolumni](https://github.com/kolunmi/dwlb)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+10
View File
@@ -0,0 +1,10 @@
### Description
Add a border around the [bar](/dwl/dwl-patches/wiki/bar) similar to how a client is given a border.
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/barborder/barborder.patch)
### Authors
- [sewn](https://codeberg.org/sewn)
+136
View File
@@ -0,0 +1,136 @@
From 7d95ce0fba8f172748bbd71b4c03ce12acd54eea Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Fri, 23 Aug 2024 14:11:37 +0300
Subject: [PATCH] add border to bar
---
config.def.h | 3 ++-
dwl.c | 32 +++++++++++++++++++-------------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/config.def.h b/config.def.h
index 5d1dc2b..4763482 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 int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"monospace:size=10"};
@@ -18,6 +18,7 @@ static uint32_t colors[][3] = {
[SchemeNorm] = { 0xbbbbbbff, 0x222222ff, 0x444444ff },
[SchemeSel] = { 0xeeeeeeff, 0x005577ff, 0x005577ff },
[SchemeUrg] = { 0, 0, 0x770000ff },
+ [SchemeBar] = { 0, 0, 0x557700ff },
};
/* tagging - TAGCOUNT must be no greater than 31 */
diff --git a/dwl.c b/dwl.c
index ece537a..c637da4 100644
--- a/dwl.c
+++ b/dwl.c
@@ -85,7 +85,7 @@
#define TEXTW(mon, text) (drwl_font_getwidth(mon->drw, text) + mon->lrpad)
/* enums */
-enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeUrg, SchemeBar }; /* color schemes */
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */
enum { XDGShell, LayerShell, X11 }; /* client types */
enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */
@@ -750,7 +750,7 @@ buttonpress(struct wl_listener *listener, void *data)
if (!c && !exclusive_focus &&
(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) {
- cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
+ cx = (cursor->x - selmon->m.x - borderpx) * selmon->wlr_output->scale;
do
x += TEXTW(selmon, tags[i]);
while (cx >= x && ++i < LENGTH(tags));
@@ -1506,10 +1506,12 @@ dirtomon(enum wlr_direction dir)
void
drawbar(Monitor *m)
{
- int x, w, tw = 0;
+ int x, y = borderpx, w, tw = 0;
+ int mh = m->b.height - borderpx * 2, mw = m->b.width - borderpx * 2;
int boxs = m->drw->font->height / 9;
int boxw = m->drw->font->height / 6 + 2;
uint32_t i, occ = 0, urg = 0;
+ uint32_t borderscm[] = { colors[SchemeBar][ColBorder] };
Client *c;
Buffer *buf;
@@ -1518,11 +1520,15 @@ drawbar(Monitor *m)
if (!(buf = bufmon(m)))
return;
+ drwl_setscheme(m->drw, borderscm);
+ drwl_rect(m->drw, 0, 0, m->b.width, m->b.height, 1, 0);
+ drwl_setscheme(m->drw, colors[SchemeNorm]);
+
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drwl_setscheme(m->drw, colors[SchemeNorm]);
tw = TEXTW(m, stext) - m->lrpad + 2; /* 2px right padding */
- drwl_text(m->drw, m->b.width - tw, 0, tw, m->b.height, 0, stext, 0);
+ drwl_text(m->drw, borderpx + mw - tw, y, tw, mh, 0, stext, 0);
}
wl_list_for_each(c, &clients, link) {
@@ -1532,31 +1538,31 @@ drawbar(Monitor *m)
if (c->isurgent)
urg |= c->tags;
}
- x = 0;
+ x = borderpx;
c = focustop(m);
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(m, tags[i]);
drwl_setscheme(m->drw, colors[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, tags[i], urg & 1 << i);
+ drwl_text(m->drw, x, y, w, mh, m->lrpad / 2, tags[i], urg & 1 << i);
if (occ & 1 << i)
- drwl_rect(m->drw, x + boxs, boxs, boxw, boxw,
+ drwl_rect(m->drw, x + boxs, y + boxs, boxw, boxw,
m == selmon && c && c->tags & 1 << i,
urg & 1 << i);
x += w;
}
w = TEXTW(m, m->ltsymbol);
drwl_setscheme(m->drw, colors[SchemeNorm]);
- x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
+ x = drwl_text(m->drw, x, y, w, mh, m->lrpad / 2, m->ltsymbol, 0);
- if ((w = m->b.width - tw - x) > m->b.height) {
+ if ((w = mw - tw - x + borderpx) > mh) {
if (c) {
drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
- drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
+ drwl_text(m->drw, x, y, w, mh, m->lrpad / 2, client_get_title(c), 0);
if (c && c->isfloating)
- drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
+ drwl_rect(m->drw, x + boxs, y + boxs, boxw, boxw, 0, 0);
} else {
drwl_setscheme(m->drw, colors[SchemeNorm]);
- drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
+ drwl_rect(m->drw, x, y, w, mh, 1, 1);
}
}
@@ -3183,7 +3189,7 @@ updatebar(Monitor *m)
m->b.scale = m->wlr_output->scale;
m->lrpad = m->drw->font->height;
- m->b.height = m->drw->font->height + 2;
+ m->b.height = m->drw->font->height + 2 + borderpx * 2;
m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
}
--
2.46.0
+9
View File
@@ -0,0 +1,9 @@
### Description
Add support for colored status text to the [bar](/dwl/dwl-patches/src/branch/main/patches/bar). Text can be colored in the same manner as with dwlb, namely by wrapping it between `^fg(color)` and `^fg()` or `^bg(color)` and `^bg()`, where `color` is a 6-digit hexadecimal value.
### Download
- [git branch](/kerberoge/dwl/src/branch/barcolors)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/barcolors/barcolors.patch)
### Authors
- [kerberoge](https://codeberg.org/kerberoge)
+144
View File
@@ -0,0 +1,144 @@
From d2b529d9ebee6b2e625afd5c89c2ede5bb0ca91b Mon Sep 17 00:00:00 2001
From: Kerberoge <sjoerdenjh@gmail.com>
Date: Sun, 25 Aug 2024 22:41:55 +0200
Subject: [PATCH 1/1] updated barcolors
---
dwl.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 87 insertions(+), 6 deletions(-)
diff --git a/dwl.c b/dwl.c
index ece537a..6663399 100644
--- a/dwl.c
+++ b/dwl.c
@@ -83,6 +83,7 @@
#define LISTEN(E, L, H) wl_signal_add((E), ((L)->notify = (H), (L)))
#define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
#define TEXTW(mon, text) (drwl_font_getwidth(mon->drw, text) + mon->lrpad)
+#define PREFIX(str, prefix) !strncmp(str, prefix, strlen(prefix))
/* enums */
enum { SchemeNorm, SchemeSel, SchemeUrg }; /* color schemes */
@@ -318,6 +319,7 @@ static void destroykeyboardgroup(struct wl_listener *listener, void *data);
static Monitor *dirtomon(enum wlr_direction dir);
static void drawbar(Monitor *m);
static void drawbars(void);
+static int drawstatus(Monitor *m);
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
@@ -448,7 +450,7 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
-static char stext[256];
+static char stext[512];
static struct wl_event_source *status_event_source;
static const struct wlr_buffer_impl buffer_impl = {
@@ -1519,11 +1521,8 @@ drawbar(Monitor *m)
return;
/* draw status first so it can be overdrawn by tags later */
- if (m == selmon) { /* status is only drawn on selected monitor */
- drwl_setscheme(m->drw, colors[SchemeNorm]);
- tw = TEXTW(m, stext) - m->lrpad + 2; /* 2px right padding */
- drwl_text(m->drw, m->b.width - tw, 0, tw, m->b.height, 0, stext, 0);
- }
+ if (m == selmon) /* status is only drawn on selected monitor */
+ tw = drawstatus(m);
wl_list_for_each(c, &clients, link) {
if (c->mon != m)
@@ -1577,6 +1576,88 @@ drawbars(void)
drawbar(m);
}
+int
+drawstatus(Monitor *m)
+{
+ int x, tw, iw;
+ char rstext[512] = "";
+ char *p, *argstart, *argend, *itext;
+ uint32_t scheme[3], *color;
+
+ /* calculate real width of stext */
+ for (p = stext; *p; p++) {
+ if (PREFIX(p, "^^")) {
+ strncat(rstext, p, 2);
+ p++;
+ } else if (PREFIX(p, "^fg(") || PREFIX(p, "^bg(")) {
+ argend = strchr(p, ')');
+ if (!argend) { /* ignore this command */
+ argstart = strchr(p, '(') + 1;
+ strncat(rstext, p, argstart - p);
+ p = argstart - 1;
+ } else {
+ p = argend;
+ }
+ } else {
+ strncat(rstext, p, 1);
+ }
+ }
+ tw = TEXTW(m, rstext) - m->lrpad;
+
+ x = m->b.width - tw;
+ itext = stext;
+ scheme[0] = colors[SchemeNorm][0];
+ scheme[1] = colors[SchemeNorm][1];
+ drwl_setscheme(m->drw, scheme);
+ for (p = stext; *p; p++) {
+ if (PREFIX(p, "^^")) {
+ p++;
+ } else if (PREFIX(p, "^fg(") || PREFIX(p, "^bg(")) {
+ argstart = strchr(p, '(') + 1;
+ argend = strchr(argstart, ')');
+ if (!argend) { /* ignore this command */
+ p = argstart - 1;
+ continue;
+ }
+
+ *p = '\0';
+ iw = TEXTW(m, itext) - m->lrpad;
+ if (*itext) /* only draw text if there is something to draw */
+ x = drwl_text(m->drw, x, 0, iw, m->b.height, 0, itext, 0);
+ *p = '^';
+
+ if (PREFIX(p, "^fg("))
+ color = &scheme[0];
+ else
+ color = &scheme[1];
+
+ if (argend != argstart) {
+ *argend = '\0';
+ *color = strtoul(argstart, NULL, 16);
+ *color = *color << 8 | 0xff; /* add alpha channel */
+ *argend = ')';
+ } else {
+ *color = 0; /* reset */
+ }
+
+ /* reset color back to normal if none was provided */
+ if (!scheme[0])
+ scheme[0] = colors[SchemeNorm][0];
+ if (!scheme[1])
+ scheme[1] = colors[SchemeNorm][1];
+
+ itext = argend + 1;
+ drwl_setscheme(m->drw, scheme);
+ p = argend;
+ }
+ }
+ iw = TEXTW(m, itext) - m->lrpad;
+ if (*itext)
+ drwl_text(m->drw, x, 0, iw, m->b.height, 0, itext, 0);
+
+ return tw;
+}
+
void
focusclient(Client *c, int lift)
{
--
2.48.1
+11
View File
@@ -0,0 +1,11 @@
### Description
Adds the ability to change the [bar's](https://codeberg.org/dwl/dwl-patches/wiki/bar) height.
### Download
- [0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/barheight/barheight.patch) (bar 0.7)
- [git branch](https://codeberg.org/Oak/dwl/src/branch/barheight)
### Authors
- [Oak](https://codeberg.org/oak)
+38
View File
@@ -0,0 +1,38 @@
From d2f3ac840845802eaf9ff7daf406f04722fd02aa Mon Sep 17 00:00:00 2001
From: Oak <Oak@petrifiedoak.com>
Date: Sun, 25 Aug 2024 17:43:17 +0200
Subject: [PATCH] Implement barheight patch
---
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 5d1dc2b..f11089c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,6 +7,7 @@
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 int user_bh = 30; /* 0 means that dwl will calculate barheight, >= 1 means dwl will use user_bh as the bar height. */
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"};
diff --git a/dwl.c b/dwl.c
index ece537a..2863202 100644
--- a/dwl.c
+++ b/dwl.c
@@ -3183,7 +3183,7 @@ updatebar(Monitor *m)
m->b.scale = m->wlr_output->scale;
m->lrpad = m->drw->font->height;
- m->b.height = m->drw->font->height + 2;
+ m->b.height = user_bh ? user_bh : m->drw->font->height + 2;
m->b.real_height = (int)((float)m->b.height / m->wlr_output->scale);
}
--
2.46.0
+10
View File
@@ -0,0 +1,10 @@
### Description
Add vertical and horizontal space between the [bar](/dwl/dwl-patches/wiki/bar) and the edge of the screen.
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/barpadding/barpadding.patch)
### Authors
- [sewn](https://codeberg.org/sewn)
+73
View File
@@ -0,0 +1,73 @@
From f01cea73042155e856b2f41452724fe5c895eee4 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org>
Date: Fri, 23 Aug 2024 09:59:03 +0300
Subject: [PATCH] add vertical and horizontal spacing to bar
https://dwm.suckless.org/patches/barpadding/
---
config.def.h | 2 ++
dwl.c | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/config.def.h b/config.def.h
index 5d1dc2b..756b1ae 100644
--- a/config.def.h
+++ b/config.def.h
@@ -9,6 +9,8 @@ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will
static const unsigned int borderpx = 1; /* border pixel of windows */
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 float rootcolor[] = COLOR(0x000000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
diff --git a/dwl.c b/dwl.c
index ece537a..380549a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -598,8 +598,8 @@ arrangelayers(Monitor *m)
return;
if (m->scene_buffer->node.enabled) {
- usable_area.height -= m->b.real_height;
- usable_area.y += topbar ? m->b.real_height : 0;
+ usable_area.height -= m->b.real_height + vertpad;
+ usable_area.y += topbar ? m->b.real_height + vertpad : 0;
}
/* Arrange exclusive surfaces from top->bottom */
@@ -750,7 +750,7 @@ buttonpress(struct wl_listener *listener, void *data)
if (!c && !exclusive_focus &&
(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) {
- cx = (cursor->x - selmon->m.x) * selmon->wlr_output->scale;
+ cx = (cursor->x - selmon->m.x - sidepad) * selmon->wlr_output->scale;
do
x += TEXTW(selmon, tags[i]);
while (cx >= x && ++i < LENGTH(tags));
@@ -1562,8 +1562,8 @@ drawbar(Monitor *m)
wlr_scene_buffer_set_dest_size(m->scene_buffer,
m->b.real_width, m->b.real_height);
- wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x,
- m->m.y + (topbar ? 0 : m->m.height - m->b.real_height));
+ wlr_scene_node_set_position(&m->scene_buffer->node, m->m.x + sidepad,
+ m->m.y + (topbar ? vertpad : m->m.height - m->b.real_height - vertpad));
wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
wlr_buffer_unlock(&buf->base);
}
@@ -3162,8 +3162,8 @@ updatebar(Monitor *m)
char fontattrs[12];
wlr_output_transformed_resolution(m->wlr_output, &rw, &rh);
- m->b.width = rw;
- m->b.real_width = (int)((float)m->b.width / m->wlr_output->scale);
+ m->b.width = rw - (2 * sidepad);
+ m->b.real_width = (int)((float)rw / m->wlr_output->scale) - (2 * sidepad);
wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
--
2.46.0
+11
View File
@@ -0,0 +1,11 @@
### Description
A homegrown port of dwm's _truecenteredtitle_ patch, with the addition of a config option to toggle its effects.<br>Requires [the bar patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) to be applied beforehand.
![](centeredtitle.webp)
### Download
- [v0.7/v0.6](/dwl/dwl-patches/raw/branch/main/patches/bartruecenteredtitle/bartruecenteredtitle.patch)<br>Works on both v0.7 and v0.6.
### Author
- [moonsabre](https://codeberg.org/moonsabre)
- [sewn](https://codeberg.org/sewn)
@@ -0,0 +1,46 @@
From 17501c9f28226b1f332d6842be0d7f50ba618a29 Mon Sep 17 00:00:00 2001
From: moonsabre <moonsabre@tuta.io>
Date: Fri, 14 Mar 2025 16:04:25 -0700
Subject: [PATCH] Bar title centering parameter.
---
config.def.h | 1 +
dwl.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 5d1dc2b..8ac3a8b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -9,6 +9,7 @@ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will
static const unsigned int borderpx = 1; /* border pixel of windows */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
+static const int centeredtitle = 1; /* 1 means centered title */
static const char *fonts[] = {"monospace:size=10"};
static const float rootcolor[] = COLOR(0x000000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
diff --git a/dwl.c b/dwl.c
index ece537a..9eb816b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1551,9 +1551,14 @@ drawbar(Monitor *m)
if ((w = m->b.width - tw - x) > m->b.height) {
if (c) {
drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
- drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
+ tw = TEXTW(selmon, client_get_title(c));
+ drwl_text(m->drw, x, 0, w, m->b.height,
+ !centeredtitle || tw > w ? m->lrpad / 2 : (w - tw) / 2,
+ client_get_title(c), 0);
if (c && c->isfloating)
- drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
+ drwl_rect(m->drw,
+ !centeredtitle || tw > w ? x + boxs : x + ((w - tw) / 2 - boxs * 8),
+ boxs, boxw, boxw, 0, 0);
} else {
drwl_setscheme(m->drw, colors[SchemeNorm]);
drwl_rect(m->drw, x, 0, w, m->b.height, 1, 1);
--
2.48.1
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+37
View File
@@ -0,0 +1,37 @@
### Description
Adds 2 more borders to each side (top, bottom, left, right) of every window.
<details>
<summary>Preview</summary>
<pre>
With the following config:
```c
static const unsigned int borderpx = 9; /* border pixel of windows */
static const unsigned int borderspx = 3; /* width of the border that start from outside the windows */
static const unsigned int borderepx = 3; /* width of the border that start from inside the windows */
```
and `border_color_type` set to `BrdOriginal`:
<img src="https://i.imgur.com/msead2K.png"/>
and `border_color_type` set to `BrdStart`:
<img src="https://i.imgur.com/ssgPG36.png"/>
and `border_color_type` set to `BrdEnd`:
<img src="https://i.imgur.com/i2Xtjy6.png"/>
and `border_color_type` set to `BrdStartEnd`:
<img src="https://i.imgur.com/fnkitdR.png"/>
</pre>
</details>
### Download
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.5/borders)
- [2024-06-04](https://codeberg.org/dwl/dwl-patches/raw/commit/1a6825f2b8cd23044312c8040d0bf63ee7f85bc5/patches/borders/borders.patch)
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/borders/borders.patch)
### Authors
- [wochap](https://codeberg.org/wochap)
@@ -1,19 +1,21 @@
From 18abc170273690fd3fbbdcbe88b348a0b802ba91 Mon Sep 17 00:00:00 2001
From b12cfff672f0705d8259cf26b3a574faa5ca43ae Mon Sep 17 00:00:00 2001
From: wochap <gean.marroquin@gmail.com>
Date: Wed, 6 Mar 2024 11:45:30 -0500
Subject: [PATCH] add 2 more borders for each side
Date: Tue, 4 Jun 2024 16:02:25 -0500
Subject: [PATCH] implement borders patch
tihs patch adds 2 extra borders relative to the client, they don't
change the size of the client
---
client.h | 16 +++++++++++++---
config.def.h | 7 +++++++
dwl.c | 41 +++++++++++++++++++++++++++++++++++++----
3 files changed, 57 insertions(+), 7 deletions(-)
config.def.h | 8 ++++++++
dwl.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 70 insertions(+), 7 deletions(-)
diff --git a/client.h b/client.h
index 71c7d76..c65f3ec 100644
index 800b867..33fd579 100644
--- a/client.h
+++ b/client.h
@@ -309,11 +309,21 @@ client_send_close(Client *c)
@@ -325,11 +325,21 @@ client_send_close(Client *c)
}
static inline void
@@ -39,10 +41,10 @@ index 71c7d76..c65f3ec 100644
static inline void
diff --git a/config.def.h b/config.def.h
index db0babc..bc03d24 100644
index 8847e58..2d6bbe5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,7 +7,14 @@
@@ -7,8 +7,16 @@
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 */
@@ -50,18 +52,20 @@ index db0babc..bc03d24 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);
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
diff --git a/dwl.c b/dwl.c
index ef27a1d..e11b185 100644
index bf763df..303832a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -80,6 +80,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrFS, LyrTop, LyrOverlay, LyrBlock,
@@ -86,6 +86,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
#endif
@@ -69,7 +73,7 @@ index ef27a1d..e11b185 100644
typedef union {
int i;
@@ -103,6 +104,8 @@ typedef struct {
@@ -109,6 +110,8 @@ typedef struct {
Monitor *mon;
struct wlr_scene_tree *scene;
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
@@ -78,7 +82,7 @@ index ef27a1d..e11b185 100644
struct wlr_scene_tree *scene_surface;
struct wl_list link;
struct wl_list flink;
@@ -127,6 +130,8 @@ typedef struct {
@@ -136,6 +139,8 @@ typedef struct {
struct wl_listener set_hints;
#endif
unsigned int bw;
@@ -87,16 +91,16 @@ index ef27a1d..e11b185 100644
uint32_t tags;
int isfloating, isurgent, isfullscreen;
uint32_t resize; /* configure serial of a pending resize */
@@ -971,6 +976,8 @@ createnotify(struct wl_listener *listener, void *data)
@@ -973,6 +978,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 = borderspx;
+ c->bwe = borderepx;
+ c->bws = borders_only_floating ? 0 : borderspx;
+ c->bwe = borders_only_floating ? 0 : borderepx;
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
@@ -1205,7 +1212,7 @@ focusclient(Client *c, int lift)
@@ -1268,7 +1275,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)
@@ -105,7 +109,7 @@ index ef27a1d..e11b185 100644
}
/* Deactivate old client if focus is changing */
@@ -1222,7 +1229,7 @@ focusclient(Client *c, int lift)
@@ -1285,7 +1292,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))) {
@@ -114,9 +118,9 @@ index ef27a1d..e11b185 100644
client_activate_surface(old, 0);
}
@@ -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);
@@ -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);
c->border[i]->node.data = c;
+
+ c->borders[i] = wlr_scene_rect_create(c->scene, 0, 0, borderscolor);
@@ -127,7 +131,20 @@ index ef27a1d..e11b185 100644
}
/* Initialize client geometry with room for border */
@@ -1951,6 +1964,24 @@ resize(Client *c, struct wlr_box geo, int interact)
@@ -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)
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);
@@ -152,7 +169,20 @@ index ef27a1d..e11b185 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);
@@ -2063,6 +2094,8 @@ setfullscreen(Client *c, int fullscreen)
@@ -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)
if (!c->mon)
return;
c->bw = fullscreen ? 0 : borderpx;
@@ -161,24 +191,23 @@ index ef27a1d..e11b185 100644
client_set_fullscreen(c, fullscreen);
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
@@ -2651,7 +2684,7 @@ urgent(struct wl_listener *listener, void *data)
return;
@@ -2819,7 +2864,7 @@ urgent(struct wl_listener *listener, void *data)
printstatus();
if (client_surface(c)->mapped)
- client_set_border_color(c, urgentcolor);
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
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);
void
@@ -3023,7 +3068,7 @@ sethints(struct wl_listener *listener, void *data)
printstatus();
if (c->isurgent && surface && surface->mapped)
- client_set_border_color(c, urgentcolor);
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
printstatus();
}
void
--
2.42.0
2.44.1
+27
View File
@@ -0,0 +1,27 @@
### Description
bstack and bstackhoriz are two stack layouts for dwl.
### Scheme
```
bstack (TTT) bstackhoriz (===)
+-----------------+ +-----------------+
| | | |
| | | |
| | | |
+-----+-----+-----+ +-----------------+
| | | | +-----------------+
| | | | +-----------------+
+-----+-----+-----+ +-----------------+
```
### Download
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.6-b/bottomstack)
- [2024-07-09](https://codeberg.org/dwl/dwl-patches/raw/commit/20de07dc8759200c8a4c9651475acb331d245890/patches/bottomstack/bottomstack.patch)
- [2024-04-11](https://codeberg.org/dwl/dwl-patches/raw/commit/0f4e40fee49d1b8b430778e241b29496ae3b3b70/bottomstack/bottomstack.patch)
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/commit/5368aa392c7ebf8d7d24c232b80cfae1be457d41/bottomstack/bottomstack.patch)
### Authors
- [wochap](https://codeberg.org/wochap)
- [DanielMowitz](https://github.com/DanielMowitz)
- [Abanoub8](https://github.com/Abanoub8)
@@ -1,7 +1,7 @@
From 589c964e47965d84ffd3a2b036e75feddd619eed Mon Sep 17 00:00:00 2001
From b352fb08f40b1ee2d8c4748be4922df711e3aaa9 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
Date: Fri, 5 Jul 2024 10:44:29 -0500
Subject: [PATCH] implement bottomstack
---
config.def.h | 4 +++
@@ -9,10 +9,10 @@ Subject: [PATCH] add bstack and bstackhoriz layouts
2 files changed, 88 insertions(+)
diff --git a/config.def.h b/config.def.h
index 8847e58..68b62db 100644
index 22d2171..5aac3e9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -33,6 +33,8 @@ static const Layout layouts[] = {
@@ -34,6 +34,8 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -21,7 +21,7 @@ index 8847e58..68b62db 100644
};
/* monitors */
@@ -134,6 +136,8 @@ static const Key keys[] = {
@@ -139,6 +141,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 8847e58..68b62db 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 bf763df..dc3d000 100644
index dc0437e..5648d5f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -55,6 +55,7 @@
@@ -57,6 +57,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 bf763df..dc3d000 100644
#include <wlr/util/log.h>
#include <wlr/util/region.h>
#include <xkbcommon/xkbcommon.h>
@@ -347,6 +348,8 @@ static Monitor *xytomon(double x, double y);
@@ -351,6 +352,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);
@@ -51,7 +51,7 @@ index bf763df..dc3d000 100644
/* variables */
static const char broken[] = "broken";
@@ -3088,3 +3091,84 @@ main(int argc, char *argv[])
@@ -3160,3 +3163,84 @@ main(int argc, char *argv[])
usage:
die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
}
@@ -70,7 +70,7 @@ index bf763df..dc3d000 100644
+ return;
+
+ if (n > m->nmaster) {
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ mh = (int)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 bf763df..dc3d000 100644
+ return;
+
+ if (n > m->nmaster) {
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
+ mh = (int)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,4 @@ index bf763df..dc3d000 100644
+ }
+}
--
2.43.2
2.45.1
+103
View File
@@ -0,0 +1,103 @@
### Description
# btrtile — A Focus-Driven Tiling Layout
It provides a focus-driven, mouse- and keyboard-friendly tiling layout that grants you granular control over how clients are placed and resized.
![btrtile in action](https://github.com/julmajustus/dwl-patches/blob/main/demos/btrtiledemo.gif?raw=true)
---
# Why btrtile
While dwls patches folder is full of different layouts, I couldn't find suitable layout that would work well with my workflow and single ultrawide monitor setup. btrtile aims to solve that by introducing a layout strategy that splits clients according to user focus and pointer position.
---
# Features
- **Combined Tiling and Management**
Combines tiling layout and management of clients under one patchset.
- **Focus-Driven Splits**
When you add a new client, btrtile checks where your pointer is relative to the focused clients geometry.
- If the pointer is on the left half (for a horizontally large client), the new client spawns on the left side, and vice versa.
- By default, new splits are 50/50.
- **Adaptive Splitting**
- If the area to be split is wider than its height, btrtile does a vertical split.
- Otherwise, it does a horizontal split.
- **Keyboard and Mouse Driven**
- Supports keyboard-based commands for quick ratio adjustments and client swapping.
- Mouse-based resizing and moving are integrated for more intuitive manipulation.
---
# How It Works
btrtile organizes clients using a binary tree data structure that represents splits either vertically or horizontally.
When a new client appears:
1. **Focused Client Detection**
btrtile checks your pointer location to find which client (if any) youre interacting with.
2. **Split Creation**
- If theres a focused client, btrtile creates a split node around it, placing the new client on the side where your pointer is.
3. **Ratio Management**
Each split node has a `split_ratio` (defaulting to 0.5). This ratio defines how much space is allocated to each child node. You can adjust this ratio using keyboard or mouse actions.
---
# What It Doesnt Handle
- **Suckless philosophy**
- Yea, it's a bloat. I tried to hide the suck inside a single file as much I could. While this approach is not ideal, it's how it's at least for now.
---
# Configuring btrtile
btrtile adds couple variables to config.h to fine tune the mouse resizing of tiled clients.
1. **resize_factor**
- A multiplier to transfer pointer movement to client weight ratio. Depends heavily on mouse sensivity.
Defaults to 0.0002f.
2. **resize_interval_ms**
- A time based resize call limiter. Depends on framerate and screen refresh rate.
Defaults to 16ms. (~60 resize updates per second)
Fine tune these values to find the best values for your setup, smoother resizing can significally increase cpu overhead.
If mouse resizing feels sluggish, you can try compiling dwl with more aggressive optimization flags like -O2/-O3.
---
# Patch recommendations
1. **Patches that I use with my btrtile**
- [focusdir](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/focusdir)
Great patch to move focus between clients.
- [rotatetags](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/rotatetags)
Good patch to rotate the view or shift clients between tags.
- [warpcursor](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/warpcursor)
Moves cursor location to focused client.
- [pertag](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/pertag)
Allows each tag to have individual layout setups.
- [gaps](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/gaps)
Add gaps between clients.
---
### Download
- [git branch](https://codeberg.org/julmajustus/dwl/src/branch/btrtile-dev)
- [0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/btrtile/btrtile-v0.7.patch)
- [0.7 WITH gaps](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/btrtile/btrtile-v0.7-gaps.patch)
### Authors
- [julmajustus](https://codeberg.org/julmajustus)
+922
View File
@@ -0,0 +1,922 @@
From 858ef20d36c2d5e6a23a69b3b5909a80fab05f97 Mon Sep 17 00:00:00 2001
From: julmajustus <julmajustus@tutanota.com>
Date: Thu, 13 Feb 2025 23:25:20 +0200
Subject: [PATCH] btrtile-gaps with multi-tag support
---
btrtile.c | 582 +++++++++++++++++++++++++++++++++++++++++++++++++++
config.def.h | 12 ++
dwl.c | 152 +++++++++++---
3 files changed, 717 insertions(+), 29 deletions(-)
create mode 100644 btrtile.c
diff --git a/btrtile.c b/btrtile.c
new file mode 100644
index 0000000..650cab5
--- /dev/null
+++ b/btrtile.c
@@ -0,0 +1,582 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* btrtile.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: jmakkone <jmakkone@student.hive.fi> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/12/15 00:26:07 by jmakkone #+# #+# */
+/* Updated: 2025/02/13 23:25:03 by jmakkone ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+typedef struct LayoutNode {
+ unsigned int is_client_node;
+ unsigned int is_split_vertically;
+ float split_ratio;
+ struct LayoutNode *left;
+ struct LayoutNode *right;
+ struct LayoutNode *split_node;
+ Client *client;
+} LayoutNode;
+
+static void apply_layout(Monitor *m, LayoutNode *node,
+ struct wlr_box area, unsigned int is_root);
+static void btrtile(Monitor *m);
+static LayoutNode *create_client_node(Client *c);
+static LayoutNode *create_split_node(unsigned int is_split_vertically,
+ LayoutNode *left, LayoutNode *right);
+static void destroy_node(LayoutNode *node);
+static void destroy_tree(Monitor *m);
+static LayoutNode *find_client_node(LayoutNode *node, Client *c);
+static LayoutNode *find_suitable_split(LayoutNode *start, unsigned int need_vert);
+static void init_tree(Monitor *m);
+static void insert_client(Monitor *m, Client *focused_client, Client *new_client);
+static LayoutNode *remove_client_node(LayoutNode *node, Client *c);
+static void remove_client(Monitor *m, Client *c);
+static void setratio_h(const Arg *arg);
+static void setratio_v(const Arg *arg);
+static void swapclients(const Arg *arg);
+static unsigned int visible_count(LayoutNode *node, Monitor *m);
+static Client *xytoclient(double x, double y);
+
+static int resizing_from_mouse = 0;
+static double resize_last_update_x, resize_last_update_y;
+static uint32_t last_resize_time = 0;
+
+void
+apply_layout(Monitor *m, LayoutNode *node,
+ struct wlr_box area, unsigned int is_root)
+{
+ Client *c;
+ float ratio;
+ unsigned int left_count, right_count, mid, e = m->gaps;
+ struct wlr_box left_area, right_area;
+
+ if (!node)
+ return;
+
+ if (is_root && e) {
+ area.x += gappx;
+ area.y += gappx;
+ area.width -= 2 * gappx;
+ area.height -= 2 * gappx;
+ }
+
+ /* If this node is a client node, check if it is visible. */
+ if (node->is_client_node) {
+ c = node->client;
+ if (!c || !VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
+ return;
+ resize(c, area, 0);
+ c->old_geom = area;
+ return;
+ }
+
+ /* For a split node, we see how many visible children are on each side: */
+ left_count = visible_count(node->left, m);
+ right_count = visible_count(node->right, m);
+
+ if (left_count == 0 && right_count == 0) {
+ return;
+ } else if (left_count > 0 && right_count == 0) {
+ apply_layout(m, node->left, area, 0);
+ return;
+ } else if (left_count == 0 && right_count > 0) {
+ apply_layout(m, node->right, area, 0);
+ return;
+ }
+
+ /* If were here, we have visible clients in both subtrees. */
+ ratio = node->split_ratio;
+ if (ratio < 0.05f)
+ ratio = 0.05f;
+ if (ratio > 0.95f)
+ ratio = 0.95f;
+
+ memset(&left_area, 0, sizeof(left_area));
+ memset(&right_area, 0, sizeof(right_area));
+
+ if (node->is_split_vertically) {
+ mid = (unsigned int)(area.width * ratio);
+ left_area.x = area.x;
+ left_area.y = area.y;
+ left_area.width = mid;
+ left_area.height = area.height;
+
+ right_area.x = area.x + mid;
+ right_area.y = area.y;
+ right_area.width = area.width - mid;
+ right_area.height = area.height;
+
+ if (e) {
+ left_area.width -= gappx / 2;
+ right_area.x += gappx / 2;
+ right_area.width -= gappx / 2;
+ }
+ } else {
+ /* horizontal split */
+ mid = (unsigned int)(area.height * ratio);
+ left_area.x = area.x;
+ left_area.y = area.y;
+ left_area.width = area.width;
+ left_area.height = mid;
+
+ right_area.x = area.x;
+ right_area.y = area.y + mid;
+ right_area.width = area.width;
+ right_area.height= area.height - mid;
+
+ if (e) {
+ left_area.height -= gappx / 2;
+ right_area.y += gappx / 2;
+ right_area.height -= gappx / 2;
+ }
+ }
+
+ apply_layout(m, node->left, left_area, 0);
+ apply_layout(m, node->right, right_area, 0);
+}
+
+void
+btrtile(Monitor *m)
+{
+ Client *c, *focused = NULL;
+ int n = 0;
+ LayoutNode *found;
+ struct wlr_box full_area;
+
+ if (!m || !m->root)
+ return;
+
+ /* Remove non tiled clients from tree. */
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon == m && !c->isfloating && !c->isfullscreen) {
+ } else {
+ remove_client(m, c);
+ }
+ }
+
+ /* If no client is found under cursor, fallback to focustop(m) */
+ if (!(focused = xytoclient(cursor->x, cursor->y)))
+ focused = focustop(m);
+
+ /* Insert visible clients that are not part of the tree. */
+ wl_list_for_each(c, &clients, link) {
+ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen && c->mon == m) {
+ found = find_client_node(m->root, c);
+ if (!found) {
+ insert_client(m, focused, c);
+ }
+ n++;
+ }
+ }
+
+ if (n == 0)
+ return;
+
+ full_area = m->w;
+ apply_layout(m, m->root, full_area, 1);
+}
+
+LayoutNode *
+create_client_node(Client *c)
+{
+ LayoutNode *node = calloc(1, sizeof(LayoutNode));
+
+ if (!node)
+ return NULL;
+ node->is_client_node = 1;
+ node->split_ratio = 0.5f;
+ node->client = c;
+ return node;
+}
+
+LayoutNode *
+create_split_node(unsigned int is_split_vertically,
+ LayoutNode *left, LayoutNode *right)
+{
+ LayoutNode *node = calloc(1, sizeof(LayoutNode));
+
+ if (!node)
+ return NULL;
+ node->is_client_node = 0;
+ node->split_ratio = 0.5f;
+ node->is_split_vertically = is_split_vertically;
+ node->left = left;
+ node->right = right;
+ if (left)
+ left->split_node = node;
+ if (right)
+ right->split_node = node;
+ return node;
+}
+
+void
+destroy_node(LayoutNode *node)
+{
+ if (!node)
+ return;
+ if (!node->is_client_node) {
+ destroy_node(node->left);
+ destroy_node(node->right);
+ }
+ free(node);
+}
+
+void
+destroy_tree(Monitor *m)
+{
+ if (!m || !m->root)
+ return;
+ destroy_node(m->root);
+ m->root = NULL;
+}
+
+LayoutNode *
+find_client_node(LayoutNode *node, Client *c)
+{
+ LayoutNode *res;
+
+ if (!node || !c)
+ return NULL;
+ if (node->is_client_node) {
+ return (node->client == c) ? node : NULL;
+ }
+ res = find_client_node(node->left, c);
+ return res ? res : find_client_node(node->right, c);
+}
+
+LayoutNode *
+find_suitable_split(LayoutNode *start_node, unsigned int need_vertical)
+{
+ LayoutNode *n = start_node;
+ /* if we started from a client node, jump to its parent: */
+ if (n && n->is_client_node)
+ n = n->split_node;
+
+ while (n) {
+ if (!n->is_client_node && n->is_split_vertically == need_vertical &&
+ visible_count(n->left, selmon) > 0 && visible_count(n->right, selmon) > 0)
+ return n;
+ n = n->split_node;
+ }
+ return NULL;
+}
+
+void
+init_tree(Monitor *m)
+{
+ if (!m)
+ return;
+ m->root = calloc(1, sizeof(LayoutNode));
+ if (!m->root)
+ m->root = NULL;
+}
+
+void
+insert_client(Monitor *m, Client *focused_client, Client *new_client)
+{
+ Client *old_client;
+ LayoutNode **root = &m->root, *old_root,
+ *focused_node, *new_client_node, *old_client_node;
+ unsigned int wider, mid_x, mid_y;
+
+ /* If no root , new client becomes the root. */
+ if (!*root) {
+ *root = create_client_node(new_client);
+ return;
+ }
+
+ /* Find the focused_client node,
+ * if not found split the root. */
+ focused_node = focused_client ?
+ find_client_node(*root, focused_client) : NULL;
+ if (!focused_node) {
+ old_root = *root;
+ new_client_node = create_client_node(new_client);
+ *root = create_split_node(1, old_root, new_client_node);
+ return;
+ }
+
+ /* Turn focused node from a client node into a split node,
+ * and attach old_client + new_client. */
+ old_client = focused_node->client;
+ old_client_node = create_client_node(old_client);
+ new_client_node = create_client_node(new_client);
+
+ /* Decide split direction. */
+ wider = (focused_client->geom.width >= focused_client->geom.height);
+ focused_node->is_client_node = 0;
+ focused_node->client = NULL;
+ focused_node->is_split_vertically = (wider ? 1 : 0);
+
+ /* Pick new_client side depending on the cursor position. */
+ mid_x = focused_client->geom.x + focused_client->geom.width / 2;
+ mid_y = focused_client->geom.y + focused_client->geom.height / 2;
+
+ if (wider) {
+ /* vertical split => left vs right */
+ if (cursor->x <= mid_x) {
+ focused_node->left = new_client_node;
+ focused_node->right = old_client_node;
+ } else {
+ focused_node->left = old_client_node;
+ focused_node->right = new_client_node;
+ }
+ } else {
+ /* horizontal split => top vs bottom */
+ if (cursor->y <= mid_y) {
+ focused_node->left = new_client_node;
+ focused_node->right = old_client_node;
+ } else {
+ focused_node->left = old_client_node;
+ focused_node->right = new_client_node;
+ }
+ }
+ old_client_node->split_node = focused_node;
+ new_client_node->split_node = focused_node;
+ focused_node->split_ratio = 0.5f;
+}
+
+LayoutNode *
+remove_client_node(LayoutNode *node, Client *c)
+{
+ LayoutNode *tmp;
+ if (!node)
+ return NULL;
+ if (node->is_client_node) {
+ /* If this client_node is the client we're removing,
+ * return NULL to remove it */
+ if (node->client == c) {
+ free(node);
+ return NULL;
+ }
+ return node;
+ }
+
+ node->left = remove_client_node(node->left, c);
+ node->right = remove_client_node(node->right, c);
+
+ /* If one of the client node is NULL after removal and the other is not,
+ * we "lift" the other client node up to replace this split node. */
+ if (!node->left && node->right) {
+ tmp = node->right;
+
+ /* Save pointer to split node */
+ if (tmp)
+ tmp->split_node = node->split_node;
+
+ free(node);
+ return tmp;
+ }
+
+ if (!node->right && node->left) {
+ tmp = node->left;
+
+ /* Save pointer to split node */
+ if (tmp)
+ tmp->split_node = node->split_node;
+
+ free(node);
+ return tmp;
+ }
+
+ /* If both children exist or both are NULL (empty tree),
+ * return node as is. */
+ return node;
+}
+
+void
+remove_client(Monitor *m, Client *c)
+{
+ if (!m->root || !c)
+ return;
+ m->root = remove_client_node(m->root, c);
+}
+
+void
+setratio_h(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ LayoutNode *client_node, *split_node;
+ float new_ratio;
+
+ if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+ client_node = find_client_node(selmon->root, sel);
+ if (!client_node)
+ return;
+
+ split_node = find_suitable_split(client_node, 1);
+ if (!split_node)
+ return;
+
+ new_ratio = (arg->f != 0.0f) ? (split_node->split_ratio + arg->f) : 0.5f;
+ if (new_ratio < 0.05f)
+ new_ratio = 0.05f;
+ if (new_ratio > 0.95f)
+ new_ratio = 0.95f;
+ split_node->split_ratio = new_ratio;
+
+ /* Skip the arrange if done resizing by mouse,
+ * we call arrange from motionotify */
+ if (!resizing_from_mouse) {
+ arrange(selmon);
+ }
+}
+
+void
+setratio_v(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ LayoutNode *client_node, *split_node;
+ float new_ratio;
+
+ if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+ client_node = find_client_node(selmon->root, sel);
+ if (!client_node)
+ return;
+
+ split_node = find_suitable_split(client_node, 0);
+ if (!split_node)
+ return;
+
+ new_ratio = (arg->f != 0.0f) ? (split_node->split_ratio + arg->f) : 0.5f;
+ if (new_ratio < 0.05f)
+ new_ratio = 0.05f;
+ if (new_ratio > 0.95f)
+ new_ratio = 0.95f;
+ split_node->split_ratio = new_ratio;
+
+ /* Skip the arrange if done resizing by mouse,
+ * we call arrange from motionotify */
+ if (!resizing_from_mouse) {
+ arrange(selmon);
+ }
+}
+
+void swapclients(const Arg *arg) {
+ Client *c, *tmp, *target = NULL, *sel = focustop(selmon);
+ LayoutNode *sel_node, *target_node;
+ int closest_dist = INT_MAX, dist, sel_center_x, sel_center_y,
+ cand_center_x, cand_center_y;
+
+ if (!sel || sel->isfullscreen ||
+ !selmon->root || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+
+ /* Get the center coordinates of the selected client */
+ sel_center_x = sel->geom.x + sel->geom.width / 2;
+ sel_center_y = sel->geom.y + sel->geom.height / 2;
+
+ wl_list_for_each(c, &clients, link) {
+ if (!VISIBLEON(c, selmon) || c->isfloating || c->isfullscreen || c == sel)
+ continue;
+
+ /* Get the center of candidate client */
+ cand_center_x = c->geom.x + c->geom.width / 2;
+ cand_center_y = c->geom.y + c->geom.height / 2;
+
+ /* Check that the candidate lies in the requested direction. */
+ switch (arg->ui) {
+ case 0:
+ if (cand_center_x >= sel_center_x)
+ continue;
+ break;
+ case 1:
+ if (cand_center_x <= sel_center_x)
+ continue;
+ break;
+ case 2:
+ if (cand_center_y >= sel_center_y)
+ continue;
+ break;
+ case 3:
+ if (cand_center_y <= sel_center_y)
+ continue;
+ break;
+ default:
+ continue;
+ }
+
+ /* Get distance between the centers */
+ dist = abs(sel_center_x - cand_center_x) + abs(sel_center_y - cand_center_y);
+ if (dist < closest_dist) {
+ closest_dist = dist;
+ target = c;
+ }
+ }
+
+ /* If target is found, swap the two clients positions in the layout tree */
+ if (target) {
+ sel_node = find_client_node(selmon->root, sel);
+ target_node = find_client_node(selmon->root, target);
+ if (sel_node && target_node) {
+ tmp = sel_node->client;
+ sel_node->client = target_node->client;
+ target_node->client = tmp;
+ arrange(selmon);
+ }
+ }
+}
+
+unsigned int
+visible_count(LayoutNode *node, Monitor *m)
+{
+ Client *c;
+
+ if (!node)
+ return 0;
+ /* Check if this client is visible. */
+ if (node->is_client_node) {
+ c = node->client;
+ if (c && VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen)
+ return 1;
+ return 0;
+ }
+ /* Else its a split node. */
+ return visible_count(node->left, m) + visible_count(node->right, m);
+}
+
+Client *
+xytoclient(double x, double y) {
+ Client *c, *closest = NULL;
+ double dist, mindist = INT_MAX, dx, dy;
+
+ wl_list_for_each_reverse(c, &clients, link) {
+ if (VISIBLEON(c, selmon) && !c->isfloating && !c->isfullscreen &&
+ x >= c->geom.x && x <= (c->geom.x + c->geom.width) &&
+ y >= c->geom.y && y <= (c->geom.y + c->geom.height)){
+ return c;
+ }
+ }
+
+ /* If no client was found at cursor position fallback to closest. */
+ wl_list_for_each_reverse(c, &clients, link) {
+ if (VISIBLEON(c, selmon) && !c->isfloating && !c->isfullscreen) {
+ dx = 0, dy = 0;
+
+ if (x < c->geom.x)
+ dx = c->geom.x - x;
+ else if (x > (c->geom.x + c->geom.width))
+ dx = x - (c->geom.x + c->geom.width);
+
+ if (y < c->geom.y)
+ dy = c->geom.y - y;
+ else if (y > (c->geom.y + c->geom.height))
+ dy = y - (c->geom.y + c->geom.height);
+
+ dist = sqrt(dx * dx + dy * dy);
+ if (dist < mindist) {
+ mindist = dist;
+ closest = c;
+ }
+ }
+ }
+ return closest;
+}
diff --git a/config.def.h b/config.def.h
index 22d2171..92f3ad6 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,7 +13,10 @@ 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 resize_factor = 0.0002f; /* Resize multiplier for mouse resizing, depends on mouse sensivity. */
+static const uint32_t resize_interval_ms = 16; /* Resize interval depends on framerate and screen refresh rate. */
+enum Direction { DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN };
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -31,6 +34,7 @@ static const Rule rules[] = {
/* layout(s) */
static const Layout layouts[] = {
/* symbol arrange function */
+ { "|w|", btrtile },
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -148,6 +152,14 @@ static const Key keys[] = {
{ 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} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Up, swapclients, {.i = DIR_UP} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, swapclients, {.i = DIR_DOWN} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Right, swapclients, {.i = DIR_RIGHT} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Left, swapclients, {.i = DIR_LEFT} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Right, setratio_h, {.f = +0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Left, setratio_h, {.f = -0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Up, setratio_v, {.f = -0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Down, setratio_v, {.f = +0.025f} },
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
diff --git a/dwl.c b/dwl.c
index a2711f6..e49a061 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1,6 +1,7 @@
/*
* See LICENSE file for copyright and license details.
*/
+#include <limits.h>
#include <getopt.h>
#include <libinput.h>
#include <linux/input-event-codes.h>
@@ -103,6 +104,7 @@ typedef struct {
const Arg arg;
} Button;
+typedef struct LayoutNode LayoutNode;
typedef struct Monitor Monitor;
typedef struct {
/* Must keep these three elements in this order */
@@ -139,8 +141,9 @@ typedef struct {
#endif
unsigned int bw;
uint32_t tags;
- int isfloating, isurgent, isfullscreen;
+ int isfloating, isurgent, isfullscreen, was_tiled;
uint32_t resize; /* configure serial of a pending resize */
+ struct wlr_box old_geom;
} Client;
typedef struct {
@@ -208,6 +211,7 @@ struct Monitor {
int nmaster;
char ltsymbol[16];
int asleep;
+ LayoutNode *root;
};
typedef struct {
@@ -250,6 +254,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
struct wlr_box *usable_area, int exclusive);
static void arrangelayers(Monitor *m);
static void axisnotify(struct wl_listener *listener, void *data);
+static void btrtile(Monitor *m);
static void buttonpress(struct wl_listener *listener, void *data);
static void chvt(const Arg *arg);
static void checkidleinhibitor(struct wlr_surface *exclude);
@@ -333,6 +338,9 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
+static void setratio_h(const Arg *arg);
+static void setratio_v(const Arg *arg);
+static void swapclients(const Arg *arg);
static void spawn(const Arg *arg);
static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
@@ -431,6 +439,7 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
+#include "btrtile.c"
/* function implementations */
void
@@ -601,7 +610,7 @@ buttonpress(struct wl_listener *listener, void *data)
struct wlr_pointer_button_event *event = data;
struct wlr_keyboard *keyboard;
uint32_t mods;
- Client *c;
+ Client *c, *target = NULL;
const Button *b;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -622,7 +631,7 @@ buttonpress(struct wl_listener *listener, void *data)
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
for (b = buttons; b < END(buttons); b++) {
if (CLEANMASK(mods) == CLEANMASK(b->mod) &&
- event->button == b->button && b->func) {
+ event->button == b->button && b->func) {
b->func(&b->arg);
return;
}
@@ -632,15 +641,36 @@ buttonpress(struct wl_listener *listener, void *data)
/* If you released any buttons, we exit interactive move/resize mode. */
/* TODO should reset to the pointer focus's current setcursor */
if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {
+ c = grabc;
+ if (c && c->was_tiled && !strcmp(selmon->ltsymbol, "|w|")) {
+ if (cursor_mode == CurMove && c->isfloating) {
+ target = xytoclient(cursor->x, cursor->y);
+
+ if (target && !target->isfloating && !target->isfullscreen)
+ insert_client(selmon, target, c);
+ else
+ selmon->root = create_client_node(c);
+
+ setfloating(c, 0);
+ arrange(selmon);
+
+ } else if (cursor_mode == CurResize && !c->isfloating) {
+ resizing_from_mouse = 0;
+ }
+ } else {
+ if (cursor_mode == CurResize && resizing_from_mouse)
+ resizing_from_mouse = 0;
+ }
+ /* Default behaviour */
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
cursor_mode = CurNormal;
/* Drop the window off on its new monitor */
selmon = xytomon(cursor->x, cursor->y);
setmon(grabc, selmon, 0);
+ grabc = NULL;
return;
- } else {
- cursor_mode = CurNormal;
}
+ cursor_mode = CurNormal;
break;
}
/* If the event wasn't handled by the compositor, notify the client with
@@ -720,6 +750,7 @@ cleanupmon(struct wl_listener *listener, void *data)
wlr_output_layout_remove(output_layout, m->wlr_output);
wlr_scene_output_destroy(m->scene_output);
+ destroy_tree(m);
closemon(m);
wlr_scene_node_destroy(&m->fullscreen_bg->node);
free(m);
@@ -1024,6 +1055,7 @@ createmon(struct wl_listener *listener, void *data)
wl_list_insert(&mons, &m->link);
printstatus();
+ init_tree(m);
/* The xdg-protocol specifies:
*
@@ -1263,6 +1295,10 @@ destroynotify(struct wl_listener *listener, void *data)
wl_list_remove(&c->destroy.link);
wl_list_remove(&c->set_title.link);
wl_list_remove(&c->fullscreen.link);
+ /* We check if the destroyed client was part of any tiled_list, to catch
+ * client removals even if they would not be currently managed by btrtile */
+ if (selmon && selmon->root)
+ remove_client(selmon, c);
#ifdef XWAYLAND
if (c->type != XDGShell) {
wl_list_remove(&c->activate.link);
@@ -1809,7 +1845,8 @@ void
motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double dy,
double dx_unaccel, double dy_unaccel)
{
- double sx = 0, sy = 0, sx_confined, sy_confined;
+ int tiled = 0;
+ double sx = 0, sy = 0, sx_confined, sy_confined, dx_total, dy_total;
Client *c = NULL, *w = NULL;
LayerSurface *l = NULL;
struct wlr_surface *surface = NULL;
@@ -1863,18 +1900,56 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
/* Update drag icon's position */
wlr_scene_node_set_position(&drag_icon->node, (int)round(cursor->x), (int)round(cursor->y));
- /* If we are currently grabbing the mouse, handle and return */
+ /* Skip if internal call or already resizing */
+ if (time == 0 && resizing_from_mouse)
+ goto focus;
+
+ tiled = grabc && !grabc->isfloating && !grabc->isfullscreen;
if (cursor_mode == CurMove) {
/* Move the grabbed client to the new position. */
- resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
- .width = grabc->geom.width, .height = grabc->geom.height}, 1);
- return;
+ if (grabc && grabc->isfloating) {
+ resize(grabc, (struct wlr_box){
+ .x = (int)round(cursor->x) - grabcx,
+ .y = (int)round(cursor->y) - grabcy,
+ .width = grabc->geom.width,
+ .height = grabc->geom.height
+ }, 1);
+ return;
+ }
} else if (cursor_mode == CurResize) {
- resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y,
- .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1);
- return;
+ if (tiled && resizing_from_mouse) {
+ dx_total = cursor->x - resize_last_update_x;
+ dy_total = cursor->y - resize_last_update_y;
+
+ if (time - last_resize_time >= resize_interval_ms) {
+ Arg a = {0};
+ if (fabs(dx_total) > fabs(dy_total)) {
+ a.f = (float)(dx_total * resize_factor);
+ setratio_h(&a);
+ } else {
+ a.f = (float)(dy_total * resize_factor);
+ setratio_v(&a);
+ }
+ arrange(selmon);
+
+ last_resize_time = time;
+ resize_last_update_x = cursor->x;
+ resize_last_update_y = cursor->y;
+ }
+
+ } else if (grabc && grabc->isfloating) {
+ /* Floating resize as original */
+ resize(grabc, (struct wlr_box){
+ .x = grabc->geom.x,
+ .y = grabc->geom.y,
+ .width = (int)round(cursor->x) - grabc->geom.x,
+ .height = (int)round(cursor->y) - grabc->geom.y
+ }, 1);
+ return;
+ }
}
+focus:
/* If there's no client surface under the cursor, set the cursor image to a
* default. This is what makes the cursor image appear when you move it
* off of a client or over its border. */
@@ -1908,22 +1983,41 @@ moveresize(const Arg *arg)
if (!grabc || client_is_unmanaged(grabc) || grabc->isfullscreen)
return;
- /* Float the window and tell motionnotify to grab it */
- setfloating(grabc, 1);
- switch (cursor_mode = arg->ui) {
- case CurMove:
- grabcx = (int)round(cursor->x) - grabc->geom.x;
- grabcy = (int)round(cursor->y) - grabc->geom.y;
- wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
- break;
- case CurResize:
- /* Doesn't work for X11 output - the next absolute motion event
- * returns the cursor to where it started */
- wlr_cursor_warp_closest(cursor, NULL,
- grabc->geom.x + grabc->geom.width,
- grabc->geom.y + grabc->geom.height);
- wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
- break;
+ cursor_mode = arg->ui;
+ grabc->was_tiled = (!grabc->isfloating && !grabc->isfullscreen);
+
+ if (grabc->was_tiled) {
+ switch (cursor_mode) {
+ case CurMove:
+ setfloating(grabc, 1);
+ grabcx = (int)round(cursor->x) - grabc->geom.x;
+ grabcy = (int)round(cursor->y) - grabc->geom.y;
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
+ break;
+ case CurResize:
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
+ resize_last_update_x = cursor->x;
+ resize_last_update_y = cursor->y;
+ resizing_from_mouse = 1;
+ break;
+ }
+ } else {
+ /* Default floating logic */
+ /* Float the window and tell motionnotify to grab it */
+ setfloating(grabc, 1);
+ switch (cursor_mode) {
+ case CurMove:
+ grabcx = (int)round(cursor->x) - grabc->geom.x;
+ grabcy = (int)round(cursor->y) - grabc->geom.y;
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
+ break;
+ case CurResize:
+ wlr_cursor_warp_closest(cursor, NULL,
+ grabc->geom.x + grabc->geom.width,
+ grabc->geom.y + grabc->geom.height);
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
+ break;
+ }
}
}
--
2.45.3
+903
View File
@@ -0,0 +1,903 @@
From b9789420f166c20579f29ecd171a8956c681848d Mon Sep 17 00:00:00 2001
From: julmajustus <julmajustus@tutanota.com>
Date: Thu, 13 Feb 2025 23:23:40 +0200
Subject: [PATCH] btrtile with multi-tag support
---
btrtile.c | 563 +++++++++++++++++++++++++++++++++++++++++++++++++++
config.def.h | 12 ++
dwl.c | 152 +++++++++++---
3 files changed, 698 insertions(+), 29 deletions(-)
create mode 100644 btrtile.c
diff --git a/btrtile.c b/btrtile.c
new file mode 100644
index 0000000..03f4680
--- /dev/null
+++ b/btrtile.c
@@ -0,0 +1,563 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* btrtile.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: jmakkone <jmakkone@student.hive.fi> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2024/12/15 00:26:07 by jmakkone #+# #+# */
+/* Updated: 2025/02/13 23:22:33 by jmakkone ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+typedef struct LayoutNode {
+ unsigned int is_client_node;
+ unsigned int is_split_vertically;
+ float split_ratio;
+ struct LayoutNode *left;
+ struct LayoutNode *right;
+ struct LayoutNode *split_node;
+ Client *client;
+} LayoutNode;
+
+static void apply_layout(Monitor *m, LayoutNode *node,
+ struct wlr_box area, unsigned int is_root);
+static void btrtile(Monitor *m);
+static LayoutNode *create_client_node(Client *c);
+static LayoutNode *create_split_node(unsigned int is_split_vertically,
+ LayoutNode *left, LayoutNode *right);
+static void destroy_node(LayoutNode *node);
+static void destroy_tree(Monitor *m);
+static LayoutNode *find_client_node(LayoutNode *node, Client *c);
+static LayoutNode *find_suitable_split(LayoutNode *start, unsigned int need_vert);
+static void init_tree(Monitor *m);
+static void insert_client(Monitor *m, Client *focused_client, Client *new_client);
+static LayoutNode *remove_client_node(LayoutNode *node, Client *c);
+static void remove_client(Monitor *m, Client *c);
+static void setratio_h(const Arg *arg);
+static void setratio_v(const Arg *arg);
+static void swapclients(const Arg *arg);
+static unsigned int visible_count(LayoutNode *node, Monitor *m);
+static Client *xytoclient(double x, double y);
+
+static int resizing_from_mouse = 0;
+static double resize_last_update_x, resize_last_update_y;
+static uint32_t last_resize_time = 0;
+
+void
+apply_layout(Monitor *m, LayoutNode *node,
+ struct wlr_box area, unsigned int is_root)
+{
+ Client *c;
+ float ratio;
+ unsigned int left_count, right_count, mid;
+ struct wlr_box left_area, right_area;
+
+ if (!node)
+ return;
+
+ /* If this node is a client node, check if it is visible. */
+ if (node->is_client_node) {
+ c = node->client;
+ if (!c || !VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
+ return;
+ resize(c, area, 0);
+ c->old_geom = area;
+ return;
+ }
+
+ /* For a split node, we see how many visible children are on each side: */
+ left_count = visible_count(node->left, m);
+ right_count = visible_count(node->right, m);
+
+ if (left_count == 0 && right_count == 0) {
+ return;
+ } else if (left_count > 0 && right_count == 0) {
+ apply_layout(m, node->left, area, 0);
+ return;
+ } else if (left_count == 0 && right_count > 0) {
+ apply_layout(m, node->right, area, 0);
+ return;
+ }
+
+ /* If were here, we have visible clients in both subtrees. */
+ ratio = node->split_ratio;
+ if (ratio < 0.05f)
+ ratio = 0.05f;
+ if (ratio > 0.95f)
+ ratio = 0.95f;
+
+ memset(&left_area, 0, sizeof(left_area));
+ memset(&right_area, 0, sizeof(right_area));
+
+ if (node->is_split_vertically) {
+ mid = (unsigned int)(area.width * ratio);
+ left_area.x = area.x;
+ left_area.y = area.y;
+ left_area.width = mid;
+ left_area.height = area.height;
+
+ right_area.x = area.x + mid;
+ right_area.y = area.y;
+ right_area.width = area.width - mid;
+ right_area.height = area.height;
+ } else {
+ /* horizontal split */
+ mid = (unsigned int)(area.height * ratio);
+ left_area.x = area.x;
+ left_area.y = area.y;
+ left_area.width = area.width;
+ left_area.height = mid;
+
+ right_area.x = area.x;
+ right_area.y = area.y + mid;
+ right_area.width = area.width;
+ right_area.height= area.height - mid;
+ }
+
+ apply_layout(m, node->left, left_area, 0);
+ apply_layout(m, node->right, right_area, 0);
+}
+
+void
+btrtile(Monitor *m)
+{
+ Client *c, *focused = NULL;
+ int n = 0;
+ LayoutNode *found;
+ struct wlr_box full_area;
+
+ if (!m || !m->root)
+ return;
+
+ /* Remove non tiled clients from tree. */
+ wl_list_for_each(c, &clients, link) {
+ if (c->mon == m && !c->isfloating && !c->isfullscreen) {
+ } else {
+ remove_client(m, c);
+ }
+ }
+
+ /* If no client is found under cursor, fallback to focustop(m) */
+ if (!(focused = xytoclient(cursor->x, cursor->y)))
+ focused = focustop(m);
+
+ /* Insert visible clients that are not part of the tree. */
+ wl_list_for_each(c, &clients, link) {
+ if (VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen && c->mon == m) {
+ found = find_client_node(m->root, c);
+ if (!found) {
+ insert_client(m, focused, c);
+ }
+ n++;
+ }
+ }
+
+ if (n == 0)
+ return;
+
+ full_area = m->w;
+ apply_layout(m, m->root, full_area, 1);
+}
+
+LayoutNode *
+create_client_node(Client *c)
+{
+ LayoutNode *node = calloc(1, sizeof(LayoutNode));
+
+ if (!node)
+ return NULL;
+ node->is_client_node = 1;
+ node->split_ratio = 0.5f;
+ node->client = c;
+ return node;
+}
+
+LayoutNode *
+create_split_node(unsigned int is_split_vertically,
+ LayoutNode *left, LayoutNode *right)
+{
+ LayoutNode *node = calloc(1, sizeof(LayoutNode));
+
+ if (!node)
+ return NULL;
+ node->is_client_node = 0;
+ node->split_ratio = 0.5f;
+ node->is_split_vertically = is_split_vertically;
+ node->left = left;
+ node->right = right;
+ if (left)
+ left->split_node = node;
+ if (right)
+ right->split_node = node;
+ return node;
+}
+
+void
+destroy_node(LayoutNode *node)
+{
+ if (!node)
+ return;
+ if (!node->is_client_node) {
+ destroy_node(node->left);
+ destroy_node(node->right);
+ }
+ free(node);
+}
+
+void
+destroy_tree(Monitor *m)
+{
+ if (!m || !m->root)
+ return;
+ destroy_node(m->root);
+ m->root = NULL;
+}
+
+LayoutNode *
+find_client_node(LayoutNode *node, Client *c)
+{
+ LayoutNode *res;
+
+ if (!node || !c)
+ return NULL;
+ if (node->is_client_node) {
+ return (node->client == c) ? node : NULL;
+ }
+ res = find_client_node(node->left, c);
+ return res ? res : find_client_node(node->right, c);
+}
+
+LayoutNode *
+find_suitable_split(LayoutNode *start_node, unsigned int need_vertical)
+{
+ LayoutNode *n = start_node;
+ /* if we started from a client node, jump to its parent: */
+ if (n && n->is_client_node)
+ n = n->split_node;
+
+ while (n) {
+ if (!n->is_client_node && n->is_split_vertically == need_vertical &&
+ visible_count(n->left, selmon) > 0 && visible_count(n->right, selmon) > 0)
+ return n;
+ n = n->split_node;
+ }
+ return NULL;
+}
+
+void
+init_tree(Monitor *m)
+{
+ if (!m)
+ return;
+ m->root = calloc(1, sizeof(LayoutNode));
+ if (!m->root)
+ m->root = NULL;
+}
+
+void
+insert_client(Monitor *m, Client *focused_client, Client *new_client)
+{
+ Client *old_client;
+ LayoutNode **root = &m->root, *old_root,
+ *focused_node, *new_client_node, *old_client_node;
+ unsigned int wider, mid_x, mid_y;
+
+ /* If no root , new client becomes the root. */
+ if (!*root) {
+ *root = create_client_node(new_client);
+ return;
+ }
+
+ /* Find the focused_client node,
+ * if not found split the root. */
+ focused_node = focused_client ?
+ find_client_node(*root, focused_client) : NULL;
+ if (!focused_node) {
+ old_root = *root;
+ new_client_node = create_client_node(new_client);
+ *root = create_split_node(1, old_root, new_client_node);
+ return;
+ }
+
+ /* Turn focused node from a client node into a split node,
+ * and attach old_client + new_client. */
+ old_client = focused_node->client;
+ old_client_node = create_client_node(old_client);
+ new_client_node = create_client_node(new_client);
+
+ /* Decide split direction. */
+ wider = (focused_client->geom.width >= focused_client->geom.height);
+ focused_node->is_client_node = 0;
+ focused_node->client = NULL;
+ focused_node->is_split_vertically = (wider ? 1 : 0);
+
+ /* Pick new_client side depending on the cursor position. */
+ mid_x = focused_client->geom.x + focused_client->geom.width / 2;
+ mid_y = focused_client->geom.y + focused_client->geom.height / 2;
+
+ if (wider) {
+ /* vertical split => left vs right */
+ if (cursor->x <= mid_x) {
+ focused_node->left = new_client_node;
+ focused_node->right = old_client_node;
+ } else {
+ focused_node->left = old_client_node;
+ focused_node->right = new_client_node;
+ }
+ } else {
+ /* horizontal split => top vs bottom */
+ if (cursor->y <= mid_y) {
+ focused_node->left = new_client_node;
+ focused_node->right = old_client_node;
+ } else {
+ focused_node->left = old_client_node;
+ focused_node->right = new_client_node;
+ }
+ }
+ old_client_node->split_node = focused_node;
+ new_client_node->split_node = focused_node;
+ focused_node->split_ratio = 0.5f;
+}
+
+LayoutNode *
+remove_client_node(LayoutNode *node, Client *c)
+{
+ LayoutNode *tmp;
+ if (!node)
+ return NULL;
+ if (node->is_client_node) {
+ /* If this client_node is the client we're removing,
+ * return NULL to remove it */
+ if (node->client == c) {
+ free(node);
+ return NULL;
+ }
+ return node;
+ }
+
+ node->left = remove_client_node(node->left, c);
+ node->right = remove_client_node(node->right, c);
+
+ /* If one of the client node is NULL after removal and the other is not,
+ * we "lift" the other client node up to replace this split node. */
+ if (!node->left && node->right) {
+ tmp = node->right;
+
+ /* Save pointer to split node */
+ if (tmp)
+ tmp->split_node = node->split_node;
+
+ free(node);
+ return tmp;
+ }
+
+ if (!node->right && node->left) {
+ tmp = node->left;
+
+ /* Save pointer to split node */
+ if (tmp)
+ tmp->split_node = node->split_node;
+
+ free(node);
+ return tmp;
+ }
+
+ /* If both children exist or both are NULL (empty tree),
+ * return node as is. */
+ return node;
+}
+
+void
+remove_client(Monitor *m, Client *c)
+{
+ if (!m->root || !c)
+ return;
+ m->root = remove_client_node(m->root, c);
+}
+
+void
+setratio_h(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ LayoutNode *client_node, *split_node;
+ float new_ratio;
+
+ if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+ client_node = find_client_node(selmon->root, sel);
+ if (!client_node)
+ return;
+
+ split_node = find_suitable_split(client_node, 1);
+ if (!split_node)
+ return;
+
+ new_ratio = (arg->f != 0.0f) ? (split_node->split_ratio + arg->f) : 0.5f;
+ if (new_ratio < 0.05f)
+ new_ratio = 0.05f;
+ if (new_ratio > 0.95f)
+ new_ratio = 0.95f;
+ split_node->split_ratio = new_ratio;
+
+ /* Skip the arrange if done resizing by mouse,
+ * we call arrange from motionotify */
+ if (!resizing_from_mouse) {
+ arrange(selmon);
+ }
+}
+
+void
+setratio_v(const Arg *arg)
+{
+ Client *sel = focustop(selmon);
+ LayoutNode *client_node, *split_node;
+ float new_ratio;
+
+ if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+ client_node = find_client_node(selmon->root, sel);
+ if (!client_node)
+ return;
+
+ split_node = find_suitable_split(client_node, 0);
+ if (!split_node)
+ return;
+
+ new_ratio = (arg->f != 0.0f) ? (split_node->split_ratio + arg->f) : 0.5f;
+ if (new_ratio < 0.05f)
+ new_ratio = 0.05f;
+ if (new_ratio > 0.95f)
+ new_ratio = 0.95f;
+ split_node->split_ratio = new_ratio;
+
+ /* Skip the arrange if done resizing by mouse,
+ * we call arrange from motionotify */
+ if (!resizing_from_mouse) {
+ arrange(selmon);
+ }
+}
+
+void swapclients(const Arg *arg) {
+ Client *c, *tmp, *target = NULL, *sel = focustop(selmon);
+ LayoutNode *sel_node, *target_node;
+ int closest_dist = INT_MAX, dist, sel_center_x, sel_center_y,
+ cand_center_x, cand_center_y;
+
+ if (!sel || sel->isfullscreen ||
+ !selmon->root || !selmon->lt[selmon->sellt]->arrange)
+ return;
+
+
+ /* Get the center coordinates of the selected client */
+ sel_center_x = sel->geom.x + sel->geom.width / 2;
+ sel_center_y = sel->geom.y + sel->geom.height / 2;
+
+ wl_list_for_each(c, &clients, link) {
+ if (!VISIBLEON(c, selmon) || c->isfloating || c->isfullscreen || c == sel)
+ continue;
+
+ /* Get the center of candidate client */
+ cand_center_x = c->geom.x + c->geom.width / 2;
+ cand_center_y = c->geom.y + c->geom.height / 2;
+
+ /* Check that the candidate lies in the requested direction. */
+ switch (arg->ui) {
+ case 0:
+ if (cand_center_x >= sel_center_x)
+ continue;
+ break;
+ case 1:
+ if (cand_center_x <= sel_center_x)
+ continue;
+ break;
+ case 2:
+ if (cand_center_y >= sel_center_y)
+ continue;
+ break;
+ case 3:
+ if (cand_center_y <= sel_center_y)
+ continue;
+ break;
+ default:
+ continue;
+ }
+
+ /* Get distance between the centers */
+ dist = abs(sel_center_x - cand_center_x) + abs(sel_center_y - cand_center_y);
+ if (dist < closest_dist) {
+ closest_dist = dist;
+ target = c;
+ }
+ }
+
+ /* If target is found, swap the two clients positions in the layout tree */
+ if (target) {
+ sel_node = find_client_node(selmon->root, sel);
+ target_node = find_client_node(selmon->root, target);
+ if (sel_node && target_node) {
+ tmp = sel_node->client;
+ sel_node->client = target_node->client;
+ target_node->client = tmp;
+ arrange(selmon);
+ }
+ }
+}
+
+unsigned int
+visible_count(LayoutNode *node, Monitor *m)
+{
+ Client *c;
+
+ if (!node)
+ return 0;
+ /* Check if this client is visible. */
+ if (node->is_client_node) {
+ c = node->client;
+ if (c && VISIBLEON(c, m) && !c->isfloating && !c->isfullscreen)
+ return 1;
+ return 0;
+ }
+ /* Else its a split node. */
+ return visible_count(node->left, m) + visible_count(node->right, m);
+}
+
+Client *
+xytoclient(double x, double y) {
+ Client *c, *closest = NULL;
+ double dist, mindist = INT_MAX, dx, dy;
+
+ wl_list_for_each_reverse(c, &clients, link) {
+ if (VISIBLEON(c, selmon) && !c->isfloating && !c->isfullscreen &&
+ x >= c->geom.x && x <= (c->geom.x + c->geom.width) &&
+ y >= c->geom.y && y <= (c->geom.y + c->geom.height)){
+ return c;
+ }
+ }
+
+ /* If no client was found at cursor position fallback to closest. */
+ wl_list_for_each_reverse(c, &clients, link) {
+ if (VISIBLEON(c, selmon) && !c->isfloating && !c->isfullscreen) {
+ dx = 0, dy = 0;
+
+ if (x < c->geom.x)
+ dx = c->geom.x - x;
+ else if (x > (c->geom.x + c->geom.width))
+ dx = x - (c->geom.x + c->geom.width);
+
+ if (y < c->geom.y)
+ dy = c->geom.y - y;
+ else if (y > (c->geom.y + c->geom.height))
+ dy = y - (c->geom.y + c->geom.height);
+
+ dist = sqrt(dx * dx + dy * dy);
+ if (dist < mindist) {
+ mindist = dist;
+ closest = c;
+ }
+ }
+ }
+ return closest;
+}
diff --git a/config.def.h b/config.def.h
index 22d2171..92f3ad6 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,7 +13,10 @@ 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 resize_factor = 0.0002f; /* Resize multiplier for mouse resizing, depends on mouse sensivity. */
+static const uint32_t resize_interval_ms = 16; /* Resize interval depends on framerate and screen refresh rate. */
+enum Direction { DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN };
/* tagging - TAGCOUNT must be no greater than 31 */
#define TAGCOUNT (9)
@@ -31,6 +34,7 @@ static const Rule rules[] = {
/* layout(s) */
static const Layout layouts[] = {
/* symbol arrange function */
+ { "|w|", btrtile },
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -148,6 +152,14 @@ static const Key keys[] = {
{ 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} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Up, swapclients, {.i = DIR_UP} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, swapclients, {.i = DIR_DOWN} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Right, swapclients, {.i = DIR_RIGHT} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Left, swapclients, {.i = DIR_LEFT} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Right, setratio_h, {.f = +0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Left, setratio_h, {.f = -0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Up, setratio_v, {.f = -0.025f} },
+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_Down, setratio_v, {.f = +0.025f} },
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
diff --git a/dwl.c b/dwl.c
index a2711f6..e49a061 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1,6 +1,7 @@
/*
* See LICENSE file for copyright and license details.
*/
+#include <limits.h>
#include <getopt.h>
#include <libinput.h>
#include <linux/input-event-codes.h>
@@ -103,6 +104,7 @@ typedef struct {
const Arg arg;
} Button;
+typedef struct LayoutNode LayoutNode;
typedef struct Monitor Monitor;
typedef struct {
/* Must keep these three elements in this order */
@@ -139,8 +141,9 @@ typedef struct {
#endif
unsigned int bw;
uint32_t tags;
- int isfloating, isurgent, isfullscreen;
+ int isfloating, isurgent, isfullscreen, was_tiled;
uint32_t resize; /* configure serial of a pending resize */
+ struct wlr_box old_geom;
} Client;
typedef struct {
@@ -208,6 +211,7 @@ struct Monitor {
int nmaster;
char ltsymbol[16];
int asleep;
+ LayoutNode *root;
};
typedef struct {
@@ -250,6 +254,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
struct wlr_box *usable_area, int exclusive);
static void arrangelayers(Monitor *m);
static void axisnotify(struct wl_listener *listener, void *data);
+static void btrtile(Monitor *m);
static void buttonpress(struct wl_listener *listener, void *data);
static void chvt(const Arg *arg);
static void checkidleinhibitor(struct wlr_surface *exclude);
@@ -333,6 +338,9 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags);
static void setpsel(struct wl_listener *listener, void *data);
static void setsel(struct wl_listener *listener, void *data);
static void setup(void);
+static void setratio_h(const Arg *arg);
+static void setratio_v(const Arg *arg);
+static void swapclients(const Arg *arg);
static void spawn(const Arg *arg);
static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg);
@@ -431,6 +439,7 @@ static xcb_atom_t netatom[NetLast];
/* attempt to encapsulate suck into one file */
#include "client.h"
+#include "btrtile.c"
/* function implementations */
void
@@ -601,7 +610,7 @@ buttonpress(struct wl_listener *listener, void *data)
struct wlr_pointer_button_event *event = data;
struct wlr_keyboard *keyboard;
uint32_t mods;
- Client *c;
+ Client *c, *target = NULL;
const Button *b;
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
@@ -622,7 +631,7 @@ buttonpress(struct wl_listener *listener, void *data)
mods = keyboard ? wlr_keyboard_get_modifiers(keyboard) : 0;
for (b = buttons; b < END(buttons); b++) {
if (CLEANMASK(mods) == CLEANMASK(b->mod) &&
- event->button == b->button && b->func) {
+ event->button == b->button && b->func) {
b->func(&b->arg);
return;
}
@@ -632,15 +641,36 @@ buttonpress(struct wl_listener *listener, void *data)
/* If you released any buttons, we exit interactive move/resize mode. */
/* TODO should reset to the pointer focus's current setcursor */
if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {
+ c = grabc;
+ if (c && c->was_tiled && !strcmp(selmon->ltsymbol, "|w|")) {
+ if (cursor_mode == CurMove && c->isfloating) {
+ target = xytoclient(cursor->x, cursor->y);
+
+ if (target && !target->isfloating && !target->isfullscreen)
+ insert_client(selmon, target, c);
+ else
+ selmon->root = create_client_node(c);
+
+ setfloating(c, 0);
+ arrange(selmon);
+
+ } else if (cursor_mode == CurResize && !c->isfloating) {
+ resizing_from_mouse = 0;
+ }
+ } else {
+ if (cursor_mode == CurResize && resizing_from_mouse)
+ resizing_from_mouse = 0;
+ }
+ /* Default behaviour */
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
cursor_mode = CurNormal;
/* Drop the window off on its new monitor */
selmon = xytomon(cursor->x, cursor->y);
setmon(grabc, selmon, 0);
+ grabc = NULL;
return;
- } else {
- cursor_mode = CurNormal;
}
+ cursor_mode = CurNormal;
break;
}
/* If the event wasn't handled by the compositor, notify the client with
@@ -720,6 +750,7 @@ cleanupmon(struct wl_listener *listener, void *data)
wlr_output_layout_remove(output_layout, m->wlr_output);
wlr_scene_output_destroy(m->scene_output);
+ destroy_tree(m);
closemon(m);
wlr_scene_node_destroy(&m->fullscreen_bg->node);
free(m);
@@ -1024,6 +1055,7 @@ createmon(struct wl_listener *listener, void *data)
wl_list_insert(&mons, &m->link);
printstatus();
+ init_tree(m);
/* The xdg-protocol specifies:
*
@@ -1263,6 +1295,10 @@ destroynotify(struct wl_listener *listener, void *data)
wl_list_remove(&c->destroy.link);
wl_list_remove(&c->set_title.link);
wl_list_remove(&c->fullscreen.link);
+ /* We check if the destroyed client was part of any tiled_list, to catch
+ * client removals even if they would not be currently managed by btrtile */
+ if (selmon && selmon->root)
+ remove_client(selmon, c);
#ifdef XWAYLAND
if (c->type != XDGShell) {
wl_list_remove(&c->activate.link);
@@ -1809,7 +1845,8 @@ void
motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double dy,
double dx_unaccel, double dy_unaccel)
{
- double sx = 0, sy = 0, sx_confined, sy_confined;
+ int tiled = 0;
+ double sx = 0, sy = 0, sx_confined, sy_confined, dx_total, dy_total;
Client *c = NULL, *w = NULL;
LayerSurface *l = NULL;
struct wlr_surface *surface = NULL;
@@ -1863,18 +1900,56 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
/* Update drag icon's position */
wlr_scene_node_set_position(&drag_icon->node, (int)round(cursor->x), (int)round(cursor->y));
- /* If we are currently grabbing the mouse, handle and return */
+ /* Skip if internal call or already resizing */
+ if (time == 0 && resizing_from_mouse)
+ goto focus;
+
+ tiled = grabc && !grabc->isfloating && !grabc->isfullscreen;
if (cursor_mode == CurMove) {
/* Move the grabbed client to the new position. */
- resize(grabc, (struct wlr_box){.x = (int)round(cursor->x) - grabcx, .y = (int)round(cursor->y) - grabcy,
- .width = grabc->geom.width, .height = grabc->geom.height}, 1);
- return;
+ if (grabc && grabc->isfloating) {
+ resize(grabc, (struct wlr_box){
+ .x = (int)round(cursor->x) - grabcx,
+ .y = (int)round(cursor->y) - grabcy,
+ .width = grabc->geom.width,
+ .height = grabc->geom.height
+ }, 1);
+ return;
+ }
} else if (cursor_mode == CurResize) {
- resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y,
- .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1);
- return;
+ if (tiled && resizing_from_mouse) {
+ dx_total = cursor->x - resize_last_update_x;
+ dy_total = cursor->y - resize_last_update_y;
+
+ if (time - last_resize_time >= resize_interval_ms) {
+ Arg a = {0};
+ if (fabs(dx_total) > fabs(dy_total)) {
+ a.f = (float)(dx_total * resize_factor);
+ setratio_h(&a);
+ } else {
+ a.f = (float)(dy_total * resize_factor);
+ setratio_v(&a);
+ }
+ arrange(selmon);
+
+ last_resize_time = time;
+ resize_last_update_x = cursor->x;
+ resize_last_update_y = cursor->y;
+ }
+
+ } else if (grabc && grabc->isfloating) {
+ /* Floating resize as original */
+ resize(grabc, (struct wlr_box){
+ .x = grabc->geom.x,
+ .y = grabc->geom.y,
+ .width = (int)round(cursor->x) - grabc->geom.x,
+ .height = (int)round(cursor->y) - grabc->geom.y
+ }, 1);
+ return;
+ }
}
+focus:
/* If there's no client surface under the cursor, set the cursor image to a
* default. This is what makes the cursor image appear when you move it
* off of a client or over its border. */
@@ -1908,22 +1983,41 @@ moveresize(const Arg *arg)
if (!grabc || client_is_unmanaged(grabc) || grabc->isfullscreen)
return;
- /* Float the window and tell motionnotify to grab it */
- setfloating(grabc, 1);
- switch (cursor_mode = arg->ui) {
- case CurMove:
- grabcx = (int)round(cursor->x) - grabc->geom.x;
- grabcy = (int)round(cursor->y) - grabc->geom.y;
- wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
- break;
- case CurResize:
- /* Doesn't work for X11 output - the next absolute motion event
- * returns the cursor to where it started */
- wlr_cursor_warp_closest(cursor, NULL,
- grabc->geom.x + grabc->geom.width,
- grabc->geom.y + grabc->geom.height);
- wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
- break;
+ cursor_mode = arg->ui;
+ grabc->was_tiled = (!grabc->isfloating && !grabc->isfullscreen);
+
+ if (grabc->was_tiled) {
+ switch (cursor_mode) {
+ case CurMove:
+ setfloating(grabc, 1);
+ grabcx = (int)round(cursor->x) - grabc->geom.x;
+ grabcy = (int)round(cursor->y) - grabc->geom.y;
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
+ break;
+ case CurResize:
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
+ resize_last_update_x = cursor->x;
+ resize_last_update_y = cursor->y;
+ resizing_from_mouse = 1;
+ break;
+ }
+ } else {
+ /* Default floating logic */
+ /* Float the window and tell motionnotify to grab it */
+ setfloating(grabc, 1);
+ switch (cursor_mode) {
+ case CurMove:
+ grabcx = (int)round(cursor->x) - grabc->geom.x;
+ grabcy = (int)round(cursor->y) - grabc->geom.y;
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "fleur");
+ break;
+ case CurResize:
+ wlr_cursor_warp_closest(cursor, NULL,
+ grabc->geom.x + grabc->geom.width,
+ grabc->geom.y + grabc->geom.height);
+ wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize");
+ break;
+ }
}
}
--
2.45.3
+10
View File
@@ -0,0 +1,10 @@
### Description
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.
### Download
- [git branch](https://codeberg.org/nullsystem/dwl/src/branch/main_buttonbystate)
- [2024-04-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/buttonbystate/buttonbystate.patch)
### Authors
- [nullsystem](https://codeberg.org/nullsystem)
+13
View File
@@ -0,0 +1,13 @@
### Description
Add a keybinding that toggles centering the terminally horizontally when
it's the only window, while still tiling multiple windows.
This limits the width of long text making it easier to read, and avoids
covering the wallpaper more than necessary.
### Download
- [git branch](https://codeberg.org/guidocella/dwl/src/branch/center-terminal)
- [2024-02-06](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/center-terminal/center-terminal.patch)
### Authors
- [Guido Cella](https://codeberg.org/guidocella)
@@ -1,4 +1,4 @@
From 5646d7e7d933a2e7a667767c3fde89c91697c4ea Mon Sep 17 00:00:00 2001
From 340cc5ef90dfcc495bdad045f3f76ae07405cffd Mon Sep 17 00:00:00 2001
From: Guido Cella <guido@guidocella.xyz>
Date: Tue, 6 Feb 2024 09:20:48 +0100
Subject: [PATCH] add a keybinding to center the terminal
@@ -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 | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
dwl.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/config.def.h b/config.def.h
index a85ca27..2055df9 100644
index 22d2171..8229fcc 100644
--- a/config.def.h
+++ b/config.def.h
@@ -139,6 +139,7 @@ static const Key keys[] = {
@@ -142,6 +142,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 a85ca27..2055df9 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 002349a..4582413 100644
index 12f441e..3b15748 100644
--- a/dwl.c
+++ b/dwl.c
@@ -7,6 +7,7 @@
@@ -8,6 +8,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -37,7 +37,7 @@ index 002349a..4582413 100644
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
@@ -135,6 +136,7 @@ typedef struct {
@@ -138,6 +139,7 @@ typedef struct {
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
@@ -45,7 +45,7 @@ index 002349a..4582413 100644
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -319,6 +321,7 @@ static void startdrag(struct wl_listener *listener, void *data);
@@ -334,6 +336,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,25 +53,26 @@ index 002349a..4582413 100644
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
@@ -392,6 +395,8 @@ static struct wlr_box sgeom;
static struct wl_list mons;
static Monitor *selmon;
@@ -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};
+static bool center;
+
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -457,6 +462,8 @@ applyrules(Client *c)
}
@@ -499,6 +504,9 @@ applyrules(Client *c)
}
}
+ if (!strcasecmp(appid, termcmd[0]))
+ c->centered = true;
+
c->isfloating |= client_is_float_type(c);
setmon(c, mon, newtags);
}
@@ -2519,6 +2526,11 @@ tile(Monitor *m)
@@ -2730,6 +2738,11 @@ tile(Monitor *m)
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue;
if (i < m->nmaster) {
@@ -83,7 +84,7 @@ index 002349a..4582413 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;
@@ -2531,6 +2543,13 @@ tile(Monitor *m)
@@ -2742,6 +2755,13 @@ tile(Monitor *m)
}
}
@@ -98,5 +99,5 @@ index 002349a..4582413 100644
togglefloating(const Arg *arg)
{
--
2.43.0
2.49.0
+33
View File
@@ -0,0 +1,33 @@
### Description
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 || ||
|| || || || || || || ||
|+--------++--------++--------+| |+--------++--------++--------+|
+------------------------------+ +------------------------------+
```
### Download
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/centeredmaster/centeredmaster.patch)
- [2024-04-11](https://codeberg.org/dwl/dwl-patches/raw/commit/b104a580a80ebaf9f7e8917fe574e3e97ddd019a/centeredmaster/centeredmaster.patch)
- [0.5](https://codeberg.org/dwl/dwl-patches/raw/commit/0f4e40fee49d1b8b430778e241b29496ae3b3b70/centeredmaster/centeredmaster.patch)
### Authors
- [Nikita Ivanov](https://codeberg.org/nikitaivanov) ([GitHub](https://github.com/NikitaIvanovV))
- [wochap](https://codeberg.org/wochap)
@@ -1,19 +1,39 @@
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
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
inspiration: https://github.com/djpohly/dwl/wiki/centeredmaster
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 || ||
|| || || || || || || ||
|+--------++--------++--------+| |+--------++--------++--------+|
+------------------------------+ +------------------------------+
---
config.def.h | 2 ++
dwl.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
dwl.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git a/config.def.h b/config.def.h
index 8847e58..cfc6e62 100644
index 22d2171..9a3b0c5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -33,6 +33,7 @@ static const Layout layouts[] = {
@@ -34,6 +34,7 @@ static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
@@ -21,7 +41,7 @@ index 8847e58..cfc6e62 100644
};
/* monitors */
@@ -134,6 +135,7 @@ static const Key keys[] = {
@@ -139,6 +140,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]} },
@@ -30,10 +50,10 @@ index 8847e58..cfc6e62 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 bf763df..0e84ccf 100644
index def2562..c2456dd 100644
--- a/dwl.c
+++ b/dwl.c
@@ -248,6 +248,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
@@ -251,6 +251,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);
@@ -41,15 +61,14 @@ index bf763df..0e84ccf 100644
static void chvt(const Arg *arg);
static void checkidleinhibitor(struct wlr_surface *exclude);
static void cleanup(void);
@@ -628,6 +629,69 @@ buttonpress(struct wl_listener *listener, void *data)
@@ -649,6 +650,68 @@ buttonpress(struct wl_listener *listener, void *data)
event->time_msec, event->button, event->state);
}
+void
+centeredmaster(Monitor *m)
+{
+ unsigned int h, mw, mx, my, oty, ety, tw;
+ int i, n;
+ int i, n, h, mw, mx, my, oty, ety, tw;
+ Client *c;
+
+ n = 0;
@@ -67,7 +86,7 @@ index bf763df..0e84ccf 100644
+
+ if (n > m->nmaster) {
+ /* go mfact box in the center if more than nmaster clients */
+ mw = ROUND(m->nmaster ? m->w.width * m->mfact : 0);
+ mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
+ tw = m->w.width - mw;
+
+ if (n - m->nmaster > 1) {
@@ -112,5 +131,5 @@ index bf763df..0e84ccf 100644
chvt(const Arg *arg)
{
--
2.43.2
2.48.1
+13
View File
@@ -0,0 +1,13 @@
### Description
Port of the cfact patch for the centeredmaster layout.
Inspired by the original patch for dwm (https://dwm.suckless.org/patches/cfacts/)
This patch requires both [cfact](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/cfact) and [centeredmaster](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/centeredmaster) patches.
### Download
- [2024-06-26](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact-centeredmaster/cfact-centeredmaster.patch)
### Authors
- [acadmendes](https://codeberg.org/acadmendes)
@@ -0,0 +1,83 @@
From e3ad25b5149df936155cb51927f16648a9838bc0 Mon Sep 17 00:00:00 2001
From: estevao <estevao.mendes@acad.ufsm.br>
Date: Thu, 25 Jul 2024 13:20:50 -0300
Subject: [PATCH] cfact patch for centeredmaster layout
---
dwl.c | 42 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/dwl.c b/dwl.c
index 91c1511..37732c0 100644
--- a/dwl.c
+++ b/dwl.c
@@ -654,6 +656,7 @@ void
centeredmaster(Monitor *m)
{
unsigned int h, mw, mx, my, oty, ety, tw;
+ float mweight = 0, ltweight = 0, rtweight = 0;
int i, n;
Client *c;
@@ -672,7 +675,7 @@ centeredmaster(Monitor *m)
if (n > m->nmaster) {
/* go mfact box in the center if more than nmaster clients */
- mw = ROUND(m->nmaster ? m->w.width * m->mfact : 0);
+ mw = roundf(m->nmaster ? m->w.width * m->mfact : 0);
tw = m->w.width - mw;
if (n - m->nmaster > 1) {
@@ -682,6 +685,20 @@ centeredmaster(Monitor *m)
}
}
+ i = 0;
+ wl_list_for_each(c, &clients, link){
+ if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
+ continue;
+ if (i < m->nmaster)
+ mweight += c->cweight;
+ else if ( (i - m->nmaster)%2 ){
+ ltweight += c->cweight;
+ }else{
+ rtweight += c->cweight;
+ }
+ i++;
+ }
+
i = 0;
oty = 0;
ety = 0;
@@ -691,22 +708,24 @@ centeredmaster(Monitor *m)
if (i < m->nmaster) {
/* nmaster clients are stacked vertically, in the center
* of the screen */
- h = (m->w.height - my) / (MIN(n, m->nmaster) - i);
+ h = (m->w.height - my)*(c->cweight/mweight);
resize(c, (struct wlr_box){.x = m->w.x + mx, .y = m->w.y + my, .width = mw,
.height = h}, 0);
my += c->geom.height;
+ mweight -= c->cweight;
} else {
/* stack clients are stacked vertically */
if ((i - m->nmaster) % 2) {
- h = (m->w.height - ety) / ( (1 + n - i) / 2);
+ h = (m->w.height - ety)*(c->cweight/ltweight);
resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + ety, .width = tw,
.height = h}, 0);
ety += c->geom.height;
+ ltweight -= c->cweight;
} else {
- h = (m->w.height - oty) / ((1 + n - i) / 2);
+ h = (m->w.height - oty)*(c->cweight/rtweight);
resize(c, (struct wlr_box){.x = m->w.x + mx + mw, .y = m->w.y + oty, .width = tw,
.height = h}, 0);
oty += c->geom.height;
+ rtweight -= c->cweight;
}
}
i++;
--
2.45.2
+13
View File
@@ -0,0 +1,13 @@
### Description
This patch implements [cfact][cfact] for [snail][snail] layout.
This patch must be applied on top of cfact and snail patches.
[cfact]: /dwl/dwl-patches/src/branch/main/patches/cfact
[snail]: /dwl/dwl-patches/src/branch/main/patches/snail
### Download
- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/cfact-snail/cfact-snail.patch)
### Authors
- [Nikita Ivanov](https://codeberg.org/nikitaivanov) ([GitHub](https://github.com/NikitaIvanovV))
+68
View File
@@ -0,0 +1,68 @@
From 9f8109182a7d173d2a2cb30c089a7e7b9ffe0a5e Mon Sep 17 00:00:00 2001
From: Nikita Ivanov <nikita.vyach.ivanov@gmail.com>
Date: Tue, 25 Mar 2025 02:24:32 +0100
Subject: [PATCH] cfact patch for snail layout
---
dwl.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/dwl.c b/dwl.c
index 4f8c493..37aa935 100644
--- a/dwl.c
+++ b/dwl.c
@@ -2699,10 +2699,10 @@ snail(Monitor *m)
* Split the previous horizontally and put the current window on the right
*/
} else if (dir == WLR_DIRECTION_RIGHT) {
- c->geom = (struct wlr_box){.x = prev->geom.x + prev->geom.width / 2, .y = prev->geom.y,
- .width = prev->geom.width / 2, .height = prev->geom.height};
+ c->geom = (struct wlr_box){.x = prev->geom.x + (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.width), .y = prev->geom.y,
+ .width = (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.width), .height = prev->geom.height};
prev->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y,
- .width = prev->geom.width / 2, .height = prev->geom.height};
+ .width = (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.width), .height = prev->geom.height};
/*
* If it's a stack window or the first narrow window in the master
* area, put the next one below it
@@ -2713,28 +2713,28 @@ snail(Monitor *m)
* Split the previous vertically and put the current window below it
*/
} else if (dir == WLR_DIRECTION_DOWN) {
- c->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y + prev->geom.height / 2,
- .width = prev->geom.width, .height = prev->geom.height / 2};
+ c->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y + (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.height),
+ .width = prev->geom.width, .height = (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.height)};
prev->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y,
- .width = prev->geom.width, .height = prev->geom.height / 2};
+ .width = prev->geom.width, .height = (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.height)};
dir = WLR_DIRECTION_LEFT;
/*
* Split the previous horizontally and put the current window on the left
*/
} else if (dir == WLR_DIRECTION_LEFT) {
c->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y,
- .width = prev->geom.width / 2, .height = prev->geom.height};
- prev->geom = (struct wlr_box){.x = prev->geom.x + prev->geom.width / 2, .y = prev->geom.y,
- .width = prev->geom.width / 2, .height = prev->geom.height};
+ .width = (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.width), .height = prev->geom.height};
+ prev->geom = (struct wlr_box){.x = prev->geom.x + (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.width), .y = prev->geom.y,
+ .width = (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.width), .height = prev->geom.height};
dir = WLR_DIRECTION_UP;
/*
* Split the previous vertically and put the current window above it
*/
} else {
c->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y,
- .width = prev->geom.width, .height = prev->geom.height / 2};
- prev->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y + prev->geom.height / 2,
- .width = prev->geom.width, .height = prev->geom.height / 2};
+ .width = prev->geom.width, .height = (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.height)};
+ prev->geom = (struct wlr_box){.x = prev->geom.x, .y = prev->geom.y + (int)(c->cweight / (c->cweight + prev->cweight) * prev->geom.height),
+ .width = prev->geom.width, .height = (int)(prev->cweight / (prev->cweight + c->cweight) * prev->geom.height)};
dir = WLR_DIRECTION_RIGHT;
}
i++;
--
2.49.0

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