mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2026-06-19 06:22:39 +00:00
Compare commits
214 Commits
6770813364
..
legacy
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f8b0d3866 | |||
| 8bef5b09a4 | |||
| 63ad4cff6d | |||
| d9cd3ece0e | |||
| 6b4abeeb48 | |||
| 5841138587 | |||
| f719481787 | |||
| 2c53203176 | |||
| 1424a2e4d5 | |||
| 5be9643bbd | |||
| 84564e656d | |||
| 587c226f8b | |||
| 7d892cf813 | |||
| d62bced500 | |||
| 12a8307629 | |||
| 28fa4c79d4 | |||
| 6905f26b30 | |||
| d46409b726 | |||
| a0102f17ec | |||
| 53991f99ed | |||
| fc2252bd80 | |||
| 26477981b9 | |||
| a386148ba5 | |||
| 3b0efde6d1 | |||
| 4383783071 | |||
| c599b81e8c | |||
| 5258059c85 | |||
| f73a215be1 | |||
| 3b6daafd33 | |||
| f9ae4415a4 | |||
| 861ae80894 | |||
| f0d24ce8a5 | |||
| 44d448afe3 | |||
| 560cc7c692 | |||
| 9182bdafe6 | |||
| 382028c7ba | |||
| 198c265698 | |||
| 5d43995529 | |||
| bd0fdd6121 | |||
| 49b1aa5848 | |||
| 3f964d83c7 | |||
| ff2881f32a | |||
| aa61f857b3 | |||
| cd3fc471ed | |||
| 1843f21b81 | |||
| 15ff36805c | |||
| 0c4b6175f1 | |||
| 3cb9b3596b | |||
| 3dfdfb1eda | |||
| bedc1d5e56 | |||
| 36a355a4cd | |||
| 9821f7d463 | |||
| 8f25c8b838 | |||
| 831e910b94 | |||
| 279d0f70ec | |||
| 40cc73221a | |||
| d038194afc | |||
| 065f04e423 | |||
| 277cf1f076 | |||
| ca0c67979d | |||
| 2e5f0138a0 | |||
| 21ad6439f4 | |||
| 2fbc9f286b | |||
| 5066a878bb | |||
| a913eee690 | |||
| 0c4413e256 | |||
| d8abfd97aa | |||
| f92769a2bc | |||
| 1af42ffa1b | |||
| 2e2c61565a | |||
| dbfbf788a0 | |||
| 925e2d643f | |||
| 6a8cc7ecad | |||
| 4412927fe9 | |||
| cc70bf6524 | |||
| aa41569ab6 | |||
| 4c6fbd79d7 | |||
| 65aaf50aa5 | |||
| 9f4d94e106 | |||
| 179f38e8de | |||
| 1430751ccb | |||
| 42c3bf1a03 | |||
| aa3c82446c | |||
| 5d66670ac3 | |||
| 16fed77bc9 | |||
| 2246fbb99b | |||
| 3fa6690f27 | |||
| 630e658acd | |||
| caca5ee090 | |||
| 9dafc49450 | |||
| 27e3b52483 | |||
| 4f2fdb76a9 | |||
| 4ac31e8fbe | |||
| a11d028c42 | |||
| a99f3012da | |||
| ecaa3ea2da | |||
| 9a349e1f6d | |||
| 300a0eed96 | |||
| 587104be92 | |||
| fdb1e6760a | |||
| ac2ddd312a | |||
| a6e6e63cfa | |||
| a5044494b0 | |||
| ea2f5ee3e4 | |||
| 9a5f4cd294 | |||
| 83f381cd10 | |||
| 0eae875e3f | |||
| b20dcd2800 | |||
| 403548b562 | |||
| 99df63c75e | |||
| f00b6c944d | |||
| e57563ea71 | |||
| 82a3d12bd8 | |||
| 5a2b05dc5d | |||
| deb5c2b793 | |||
| a829f6da81 | |||
| 6fbb0cf30e | |||
| 84d28404c2 | |||
| ef9a89f7a3 | |||
| d30d411ecd | |||
| f2b54ac379 | |||
| 7f79fd831f | |||
| aa13a3190b | |||
| 26aedf8e99 | |||
| 2ce58c6ca7 | |||
| b1b8409147 | |||
| 20374e1f94 | |||
| e61e29a006 | |||
| e8ff67c6c0 | |||
| 1e1ad97943 | |||
| 541fa20344 | |||
| 713487ebcd | |||
| d9658f10e1 | |||
| e7e6a83e3a | |||
| d898e7e50f | |||
| db78ce728d | |||
| bc89ad64bb | |||
| 53f2d37ec5 | |||
| 9efb29925b | |||
| 00e381e802 | |||
| a9242e781d | |||
| 31119dba18 | |||
| 3d9d172866 | |||
| 303f152329 | |||
| bc201acb5f | |||
| 019c96b0c3 | |||
| 283746d524 | |||
| 07659e6084 | |||
| 444fa60bef | |||
| fc19168621 | |||
| 6d731299e0 | |||
| 596cc2fb95 | |||
| ba164236d6 | |||
| 4f7be3e33e | |||
| 708f71484b | |||
| 0c1f06fe6f | |||
| 86ca8b3ebd | |||
| 104e1fa8f0 | |||
| a0ddd5486d | |||
| d85555f7b9 | |||
| cdd5005f0a | |||
| d860f90bcf | |||
| 694083b6d1 | |||
| d1189c91ef | |||
| 896710da17 | |||
| 8ee7ec27a1 | |||
| 8685039c10 | |||
| 7ed530c5f7 | |||
| 46313a8745 | |||
| 9ae7acbecd | |||
| cde0fa7993 | |||
| a07d0adb8b | |||
| 29848bc99a | |||
| 0c2e7427d9 | |||
| c7d4497905 | |||
| 3604232b55 | |||
| 1185e3e026 | |||
| e3a0afb1b4 | |||
| bf055d8eb6 | |||
| 8816654a75 | |||
| a214c8e798 | |||
| 1c0f2e12dc | |||
| 0594755d4c | |||
| 7fda823649 | |||
| c9571999ca | |||
| c512f6c55f | |||
| 907fd82db2 | |||
| 1bebfa4fb9 | |||
| 4d23ba308f | |||
| 390ac6663a | |||
| a069d6b078 | |||
| d734ddc91f | |||
| f8d999990a | |||
| 7f5e626ded | |||
| 9a34bfb7ea | |||
| dc5b4743ba | |||
| 46c3c99d90 | |||
| e31a8f677e | |||
| 6ab3eb59e3 | |||
| 7311907859 | |||
| f616c9f1b7 | |||
| 1f97ea8f11 | |||
| 5612dfc27a | |||
| 64f8ec3f36 | |||
| 05ae24aeaf | |||
| eb3d0d48bd | |||
| 5e6e11e142 | |||
| 678e3d01c9 | |||
| 28ad880bde | |||
| b405cc06d7 | |||
| e2990c338b | |||
| 303cc53294 | |||
| 1946640804 | |||
| 6e1ef071b0 |
@@ -1,81 +1,5 @@
|
|||||||
# dwl-patches
|
## Welcome to [dwl-patches](https://codeberg.org/dwl/dwl-patches)!
|
||||||
* A general [dwl wiki](https://codeberg.org/dwl/dwl/wiki) is available at the main [dwl] repository.
|
The dwl project is available at [https://codeberg.org/dwl/dwl](https://codeberg.org/dwl/dwl).
|
||||||
* This repository is exclusively for dwl PATCHES.
|
This repository and the associated wiki is exclusively for dwl PATCHES.
|
||||||
|
|
||||||
*Note: All patches are user-submitted content. The authors of dwl do not continually monitor them. You are responsible for downloading and reviewing a patch before using it!*
|
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.
|
||||||
|
|
||||||
## 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.
|
|
||||||
|
|
||||||
## 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
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
### Description
|
||||||
|
Newly created windows are placed at the bottom of the client tile stack.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-attachbottom.patch)
|
||||||
|
- [2021-10-05](https://github.com/djpohly/dwl/compare/main...AurelWeinhold:attachbottom.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Aurel Weinhold](https://github.com/AurelWeinhold)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
When focus is changed, warp the cursor the the center of the new focused client (if it wasn't already within the client's geometry).
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2022-05-26](https://github.com/djpohly/dwl/compare/main...faerryn:cursor_warp.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Faerryn](https://github.com/faerryn)
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
### Description
|
### Description
|
||||||
Adds a layout with a monocle layout for clients in the stack (port of the [deck layout for dwm](https://dwm.suckless.org/patches/deck/)); stacked clients are like a deck of cards (see below)
|
[deck](https://dwm.suckless.org/patches/deck/) is a port of the dwm-layout with the same name. It applies the monocle-layout to the clients in the stack. The master-client is still visible. The stacked clients are like a deck of cards, hence the name.
|
||||||
|
|
||||||
|
### Scheme
|
||||||
```
|
```
|
||||||
Tile:
|
Showcase
|
||||||
|
|
||||||
|
Tile :
|
||||||
+-----------------+--------+
|
+-----------------+--------+
|
||||||
| | |
|
| | |
|
||||||
| | S1 |
|
| | S1 |
|
||||||
@@ -13,7 +16,7 @@ Tile:
|
|||||||
| | |
|
| | |
|
||||||
+-----------------+--------+
|
+-----------------+--------+
|
||||||
|
|
||||||
Deck:
|
Deck :
|
||||||
+-----------------+--------+
|
+-----------------+--------+
|
||||||
| | |
|
| | |
|
||||||
| | |
|
| | |
|
||||||
@@ -26,9 +29,7 @@ Deck:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
- [git branch](https://codeberg.org/anabasis/dwl/src/branch/deck)
|
- [2023-07-09](https://github.com/djpohly/dwl/compare/main...PalanixYT:deck.patch)
|
||||||
- [2024-05-10](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/deck/deck.patch)
|
|
||||||
|
|
||||||
### Authors
|
### Authors
|
||||||
- [anabasis](https://codeberg.org/anabasis)
|
- [Palanix](https://github.com/PalanixYT)
|
||||||
- [Palanix](https://codeberg.org/Palanix)
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
Floating clients have their own border color.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2022-03-26](https://github.com/djpohly/dwl/compare/main...PalanixYT:float_border_color.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Palanix](https://github.com/PalanixYT)
|
||||||
-3
@@ -2,10 +2,7 @@
|
|||||||
Allows clients to use the keyboard-shortcuts-inhibit protocol to block the compositor from using keybinds. This is useful for virtualization software like looking-glass which requires this protocol to run.
|
Allows clients to use the keyboard-shortcuts-inhibit protocol to block the compositor from using keybinds. This is useful for virtualization software like looking-glass which requires this protocol to run.
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
- [git branch](https://codeberg.org/Rutherther/dwl/src/branch/patch/keyboard-shortcuts-inhibit)
|
|
||||||
- [2024-05-10](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/keyboardshortcutsinhibit/keyboardshortcutsinhibit.patch)
|
|
||||||
- [2023-05-01](https://github.com/djpohly/dwl/compare/main...madcowog:keyboard-shortcuts-inhibit.patch)
|
- [2023-05-01](https://github.com/djpohly/dwl/compare/main...madcowog:keyboard-shortcuts-inhibit.patch)
|
||||||
|
|
||||||
### Authors
|
### Authors
|
||||||
- [Rutherther](https://codeberg.org/Rutherther)
|
|
||||||
- [MadcowOG](https://github.com/MadcowOG)
|
- [MadcowOG](https://github.com/MadcowOG)
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
### Description
|
|
||||||
Show the master area to the right.
|
|
||||||
|
|
||||||
### Reason for deprecation
|
|
||||||
I created this patch for a user on Discord and I have never used it.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [git branch](https://codeberg.org/sevz/dwl/src/branch/master-right)
|
|
||||||
- [main 2024-09-01](/dwl/dwl-patches/raw/branch/main/patches/master-right/master-right.patch)
|
|
||||||
- [master-right-0.7.patch](/dwl/dwl-patches/raw/branch/main/patches/master-right/master-right-0.7.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [sevz](https://codeberg.org/sevz)
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
From f72236247e5e7cb23c3cac86b496cdd2c523f7ff Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sevz17 <leohdz172@outlook.com>
|
|
||||||
Date: Fri, 25 Jun 2021 19:50:56 -0500
|
|
||||||
Subject: [PATCH] show master area to the right
|
|
||||||
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>
|
|
||||||
---
|
|
||||||
dwl.c | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index a2711f67..50b057a7 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -2710,11 +2710,12 @@ tile(Monitor *m)
|
|
||||||
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
|
||||||
continue;
|
|
||||||
if (i < m->nmaster) {
|
|
||||||
- resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
|
|
||||||
+ resize(c, (struct wlr_box){.x = m->w.x + m->w.width - mw,
|
|
||||||
+ .y = m->w.y + my, .width = mw,
|
|
||||||
.height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0);
|
|
||||||
my += c->geom.height;
|
|
||||||
} else {
|
|
||||||
- resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
|
|
||||||
+ resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + ty,
|
|
||||||
.width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
|
|
||||||
ty += c->geom.height;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.46.0
|
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
### Description
|
||||||
|
|
||||||
|
This patch adds `menu` command, which allows dwl to interface with dmenu-like programs.
|
||||||
|
|
||||||
|
By default, two menus are available:
|
||||||
|
- focusing a window by its title by pressing `Alt+o`
|
||||||
|
- selecting a layout from a list by pressing `Alt+Shift+o`
|
||||||
|
|
||||||
|
Edit `menus` array and `MENU` macro in `config.h` to add/change menus and use a different dmenu program.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2023-07-15](https://github.com/djpohly/dwl/compare/main...NikitaIvanovV:menu.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Nikita Ivanov](https://github.com/NikitaIvanovV)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
Implement the output-power-management protocol. I don't know what this is used by, but here it is in case you need it.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2022-03-20](https://github.com/djpohly/dwl/compare/main...guidocella:output-power-management.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Guido Cella](https://github.com/guidocella)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
Adds functions `pushup` and `pushdown` to move windows within the tiling order.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2022-12-05](https://github.com/djpohly/dwl/compare/wlroots-next...djpohly:push.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Devin J. Pohly](https://github.com/djpohly)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
### Description
|
||||||
|
|
||||||
|
When resizing windows, the mouse will no longer jump to the bottom
|
||||||
|
right corner and only resize from that corner. Instead, the mouse will
|
||||||
|
resize the window in the quadrant that the resize starts at. This is the
|
||||||
|
same resize behavior as Sway and is similar to the resizehere dwm patch.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [v0.4](https://github.com/djpohly/dwl/compare/main...schance995:dwl:relative-mouse-resize.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [schance995](https://github.com/schance995)
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
### Description
|
|
||||||
This patch modifies the behavior when selecting tags so that selecting a tag will also enable any other tags that were previously visible.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
1. Select tag 5, with mod+5
|
|
||||||
2. Toggle tag 8, with ctrl+mod+8
|
|
||||||
3. Select tag 1, with mod+1. Tags 5 and 8 should no longer be visible.
|
|
||||||
4. Select tag 5 again, with mod+5. Tag 8 should be visible since it was remembered.
|
|
||||||
5. Select tag 5 again, with mod_5. Selecting the already selected tag resets any remembered tags, so now tag 5 should be the only one visible.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [git branch](https://codeberg.org/minego/dwl/src/branch/remembertags)
|
|
||||||
- [2024-03-27](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/remembertags/remembertags.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [minego](https://codeberg.org/minego)
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
Adds a toggleable function that makes a sticky client that is visible on all tags.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-sticky.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Dmitry Zakharchenko](https://github.com/dm1tz)
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
### Description
|
|
||||||
Add a tab bar or window title to the top or bottom of windows.
|
|
||||||
|
|
||||||
**This is the old version of the `tab` patch. Deprecated because the [new version](https://codeberg.org/dwl/dwl-patches/raw/branch-main/patches/tab) is significantly more efficient and well-written than this, and it better adheres to the suckless philosophy.**
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [2024-03-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tab/tab.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [dev-gm](https://codeberg.org/dev-gm)
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Description
|
||||||
|
Configure a default "previous" layout for `setlayout({0})` to switch back to.
|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [2020-07-28](https://github.com/djpohly/dwl/compare/main...guidocella:toggle-layout-immediately.patch)
|
||||||
|
|
||||||
|
### Authors
|
||||||
|
- [Guido Cella](https://github.com/guidocella)
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
### Description
|
|
||||||
|
|
||||||
> This patch is no longer being maintained by me [wochap](https://codeberg.org/wochap), since I'm now using a different patch specific to my use case: https://codeberg.org/wochap/dwl/src/branch/v0.6-b/xkb-rules-switcher/xkb-rules-switcher.patch
|
|
||||||
|
|
||||||
Switch between multiple keyboard layouts at runtime.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.5/togglekblayout)
|
|
||||||
- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/togglekblayout/togglekblayout.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [wochap](https://codeberg.org/wochap)
|
|
||||||
- [Stivvo](https://github.com/Stivvo)
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
### Description
|
|
||||||
Switch between multiple keyboard layouts, variants, and options at runtime.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [2024-03-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/togglekblayoutandoptions/togglekblayoutandoptions.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [dev-gm](https://codeberg.org/dev-gm)
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
From 95ac2fd73af8cee3ce3e556c254e60a2ca985515 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Guido Cella <guido@guidocella.xyz>
|
||||||
|
Date: Tue, 16 Jan 2024 18:14:50 +0100
|
||||||
|
Subject: [PATCH] center floating windows
|
||||||
|
|
||||||
|
---
|
||||||
|
dwl.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 95ebee8..ac077e3 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -453,6 +453,8 @@ applyrules(Client *c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x;
|
||||||
|
+ c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y;
|
||||||
|
setmon(c, mon, newtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From d2829ed5c970c7e7692e39c451526b3860dabb2f Mon Sep 17 00:00:00 2001
|
From 51d56a433f23e13ac711b283a03c7903068febf6 Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
<leohdz172@proton.me>
|
<leohdz172@proton.me>
|
||||||
Date: Sat, 8 Jul 2023 17:11:36 -0600
|
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(-)
|
2 files changed, 61 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..1d0f935 100644
|
index a8ed61d..3585711 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/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
|
@@ -20,6 +20,13 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
|
||||||
/* logging */
|
/* logging */
|
||||||
static int log_level = WLR_ERROR;
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
@@ -29,14 +29,14 @@ index 22d2171..1d0f935 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[] = {
|
static const Rule rules[] = {
|
||||||
/* app_id title tags mask isfloating monitor */
|
/* app_id title tags mask isfloating monitor */
|
||||||
|
/* examples:
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 00e9cc1e..5de32831 100644
|
index 10d5a5b..bbbef2b 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -249,6 +249,7 @@ static void arrange(Monitor *m);
|
@@ -236,6 +236,7 @@ static void arrange(Monitor *m);
|
||||||
static void arrangelayer(Monitor *m, struct wl_list *list,
|
static void arrangelayer(Monitor *m, struct wl_list *list,
|
||||||
struct wlr_box *usable_area, int exclusive);
|
struct wlr_box *usable_area, int exclusive);
|
||||||
static void arrangelayers(Monitor *m);
|
static void arrangelayers(Monitor *m);
|
||||||
@@ -44,7 +44,7 @@ index 00e9cc1e..5de32831 100644
|
|||||||
static void axisnotify(struct wl_listener *listener, void *data);
|
static void axisnotify(struct wl_listener *listener, void *data);
|
||||||
static void buttonpress(struct wl_listener *listener, void *data);
|
static void buttonpress(struct wl_listener *listener, void *data);
|
||||||
static void chvt(const Arg *arg);
|
static void chvt(const Arg *arg);
|
||||||
@@ -429,6 +430,9 @@ static xcb_atom_t netatom[NetLast];
|
@@ -403,6 +404,9 @@ static xcb_atom_t netatom[NetLast];
|
||||||
/* attempt to encapsulate suck into one file */
|
/* attempt to encapsulate suck into one file */
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ index 00e9cc1e..5de32831 100644
|
|||||||
/* function implementations */
|
/* function implementations */
|
||||||
void
|
void
|
||||||
applybounds(Client *c, struct wlr_box *bbox)
|
applybounds(Client *c, struct wlr_box *bbox)
|
||||||
@@ -577,6 +581,27 @@ arrangelayers(Monitor *m)
|
@@ -533,6 +537,27 @@ arrangelayers(Monitor *m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ index 00e9cc1e..5de32831 100644
|
|||||||
void
|
void
|
||||||
axisnotify(struct wl_listener *listener, void *data)
|
axisnotify(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
@@ -672,11 +697,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
|
@@ -630,11 +655,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
|
||||||
void
|
void
|
||||||
cleanup(void)
|
cleanup(void)
|
||||||
{
|
{
|
||||||
@@ -102,9 +102,9 @@ index 00e9cc1e..5de32831 100644
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
if (child_pid > 0) {
|
if (child_pid > 0) {
|
||||||
kill(-child_pid, SIGTERM);
|
kill(child_pid, SIGTERM);
|
||||||
waitpid(child_pid, NULL, 0);
|
waitpid(child_pid, NULL, 0);
|
||||||
@@ -1438,18 +1473,31 @@ void
|
@@ -1294,18 +1329,31 @@ void
|
||||||
handlesig(int signo)
|
handlesig(int signo)
|
||||||
{
|
{
|
||||||
if (signo == SIGCHLD) {
|
if (signo == SIGCHLD) {
|
||||||
@@ -141,7 +141,7 @@ index 00e9cc1e..5de32831 100644
|
|||||||
} else if (signo == SIGINT || signo == SIGTERM) {
|
} else if (signo == SIGINT || signo == SIGTERM) {
|
||||||
quit(NULL);
|
quit(NULL);
|
||||||
}
|
}
|
||||||
@@ -2169,6 +2217,7 @@ run(char *startup_cmd)
|
@@ -1965,6 +2013,7 @@ run(char *startup_cmd)
|
||||||
die("startup: backend_start");
|
die("startup: backend_start");
|
||||||
|
|
||||||
/* Now that the socket exists and the backend is started, run the startup command */
|
/* Now that the socket exists and the backend is started, run the startup command */
|
||||||
@@ -150,5 +150,5 @@ index 00e9cc1e..5de32831 100644
|
|||||||
int piperw[2];
|
int piperw[2];
|
||||||
if (pipe(piperw) < 0)
|
if (pipe(piperw) < 0)
|
||||||
--
|
--
|
||||||
2.45.2
|
2.43.0
|
||||||
|
|
||||||
+1005
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,128 @@
|
|||||||
|
From 38dd71e51784ab68261d9c0479a4579d419315f1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: sewn <sewn@disroot.org>
|
||||||
|
Date: Sun, 14 Apr 2024 08:47:04 +0300
|
||||||
|
Subject: [PATCH] add border to bar
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 3 ++-
|
||||||
|
dwl.c | 27 ++++++++++++++++-----------
|
||||||
|
2 files changed, 18 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 0be3ad0..e5e595a 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -6,7 +6,7 @@
|
||||||
|
/* appearance */
|
||||||
|
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||||
|
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||||
|
-static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
|
+static const unsigned int borderpx = 1; /* border pixel of windows & bar */
|
||||||
|
static const float rootcolor[] = COLOR(0x000000ff);
|
||||||
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
|
@@ -19,6 +19,7 @@ static const int showbar = 1; /* 0 means no bar */
|
||||||
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
static const char *fonts[] = {"monospace:size=10"};
|
||||||
|
static const char *fontattrs = "dpi=96";
|
||||||
|
+static pixman_color_t borderbar = { 0x5555, 0x7777, 0x0000, 0xffff };
|
||||||
|
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
|
||||||
|
static pixman_color_t normbarbg = { 0x2222, 0x2222, 0x2222, 0xffff };
|
||||||
|
static pixman_color_t selbarfg = { 0xeeee, 0xeeee, 0xeeee, 0xffff };
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 54273ae..3153bfd 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -1344,7 +1344,8 @@ dirtomon(enum wlr_direction dir)
|
||||||
|
void
|
||||||
|
drawbar(Monitor *mon)
|
||||||
|
{
|
||||||
|
- int x, w, tw = 0;
|
||||||
|
+ int x, y = borderpx, w, tw = 0;
|
||||||
|
+ int mh, mw;
|
||||||
|
int sel;
|
||||||
|
int boxs = font->height / 9;
|
||||||
|
int boxw = font->height / 6 + 2;
|
||||||
|
@@ -1357,6 +1358,8 @@ drawbar(Monitor *mon)
|
||||||
|
if (!mon || !mon->showbar)
|
||||||
|
return;
|
||||||
|
|
||||||
|
+ mh = mon->b.height - borderpx * 2;
|
||||||
|
+ mw = mon->b.width - borderpx * 2;
|
||||||
|
stride = mon->b.width * 4;
|
||||||
|
size = stride * mon->b.height;
|
||||||
|
|
||||||
|
@@ -1367,12 +1370,14 @@ drawbar(Monitor *mon)
|
||||||
|
pix = pixman_image_create_bits(
|
||||||
|
PIXMAN_a8r8g8b8, mon->b.width, mon->b.height, buf->data, stride);
|
||||||
|
|
||||||
|
+ drwl_rect(pix, 0, 0, mon->b.width, mon->b.height, 1, &borderbar);
|
||||||
|
+
|
||||||
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
|
if (mon == selmon) {
|
||||||
|
if (stext[0] == '\0')
|
||||||
|
strncpy(stext, "dwl-"VERSION, sizeof(stext));
|
||||||
|
tw = TEXTW(stext) - lrpad;
|
||||||
|
- drwl_text(pix, font, mon->b.width - tw, 0, tw, mon->b.height, 0,
|
||||||
|
+ drwl_text(pix, font, borderpx + mw - tw, y, tw, mh, 0,
|
||||||
|
stext, &normbarfg, &normbarbg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1384,37 +1389,37 @@ drawbar(Monitor *mon)
|
||||||
|
urg |= c->tags;
|
||||||
|
}
|
||||||
|
c = focustop(mon);
|
||||||
|
- x = 0;
|
||||||
|
+ x = borderpx;
|
||||||
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
|
w = TEXTW(tags[i]);
|
||||||
|
sel = mon->tagset[mon->seltags] & 1 << i;
|
||||||
|
|
||||||
|
- drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2, tags[i],
|
||||||
|
+ drwl_text(pix, font, x, y, w, mh, lrpad / 2, tags[i],
|
||||||
|
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg),
|
||||||
|
urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
|
||||||
|
|
||||||
|
if (occ & 1 << i)
|
||||||
|
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, sel,
|
||||||
|
+ drwl_rect(pix, x + boxs, y + boxs, boxw, boxw, sel,
|
||||||
|
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg));
|
||||||
|
|
||||||
|
x += w;
|
||||||
|
}
|
||||||
|
|
||||||
|
w = TEXTW(mon->ltsymbol);
|
||||||
|
- x = drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
|
||||||
|
+ x = drwl_text(pix, font, x, y, w, mh, lrpad / 2,
|
||||||
|
mon->ltsymbol, &normbarfg, &normbarbg);
|
||||||
|
|
||||||
|
- if ((w = mon->b.width - tw - x) > mon->b.height) {
|
||||||
|
+ if ((w = mw - tw - x + borderpx) > mh) {
|
||||||
|
if (c != NULL) {
|
||||||
|
- drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
|
||||||
|
+ drwl_text(pix, font, x, y, w, mh, lrpad / 2,
|
||||||
|
c ? client_get_title(c) : NULL,
|
||||||
|
mon == selmon ? &selbarfg : &normbarfg,
|
||||||
|
(mon == selmon && c) ? &selbarbg : &normbarbg);
|
||||||
|
if (c && c->isfloating)
|
||||||
|
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, 0,
|
||||||
|
+ drwl_rect(pix, x + boxs, y + boxs, boxw, boxw, 0,
|
||||||
|
mon == selmon ? &selbarfg : &normbarfg);
|
||||||
|
} else {
|
||||||
|
- drwl_rect(pix, x, 0, w, mon->b.height, 1, &normbarbg);
|
||||||
|
+ drwl_rect(pix, x, y, w, mh, 1, &normbarbg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2664,7 +2669,7 @@ setup(void)
|
||||||
|
die("Could not load font");
|
||||||
|
|
||||||
|
lrpad = font->height;
|
||||||
|
- bh = font->height + 2;
|
||||||
|
+ bh = font->height + 2 + borderpx * 2;
|
||||||
|
|
||||||
|
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
|
||||||
|
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
|
||||||
|
--
|
||||||
|
2.44.0
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
From 225ce9045d0d2f101a33a61d741b466a240f30b8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: oak <oak@petrifiedoak.com>
|
||||||
|
Date: Fri, 5 Apr 2024 14:29:10 +0200
|
||||||
|
Subject: [PATCH] port barheight patch from dwm
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 1 +
|
||||||
|
dwl.c | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 8fb2d68..2a90092 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -17,6 +17,7 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
|
||||||
|
/* bar */
|
||||||
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
+static const int user_bh = 0; /* 0 means that dwl will calculate bar height, >= 1 means dwl will use user_bh as bar height */
|
||||||
|
static const char *fonts[] = {"monospace:size=10"};
|
||||||
|
static const char *fontattrs = "dpi=96";
|
||||||
|
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 056718d..4247f4c 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -2745,7 +2745,7 @@ setup(void)
|
||||||
|
die("Could not load font");
|
||||||
|
|
||||||
|
lrpad = font->height;
|
||||||
|
- bh = font->height + 2;
|
||||||
|
+ bh = user_bh ? user_bh : font->height + 2;
|
||||||
|
|
||||||
|
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
|
||||||
|
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
From 7fe1a19287e1f40d90efd0c3b314c178cb27a571 Mon Sep 17 00:00:00 2001
|
||||||
|
From: sewn <sewn@disroot.org>
|
||||||
|
Date: Sun, 14 Apr 2024 08:02:56 +0300
|
||||||
|
Subject: [PATCH] port barpadding patch to bar for dwl
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 2 ++
|
||||||
|
dwl.c | 13 ++++++++-----
|
||||||
|
2 files changed, 10 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 0be3ad0..423330b 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -17,6 +17,8 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
|
||||||
|
/* bar */
|
||||||
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
+static const int vertpad = 10; /* vertical padding of bar */
|
||||||
|
+static const int sidepad = 10; /* horizontal padding of bar */
|
||||||
|
static const char *fonts[] = {"monospace:size=10"};
|
||||||
|
static const char *fontattrs = "dpi=96";
|
||||||
|
static pixman_color_t normbarfg = { 0xbbbb, 0xbbbb, 0xbbbb, 0xffff };
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 54273ae..b19d1a3 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -431,6 +431,7 @@ static struct wl_list mons;
|
||||||
|
static Monitor *selmon;
|
||||||
|
|
||||||
|
static struct fcft_font *font;
|
||||||
|
+static int vp, sp;
|
||||||
|
static int bh;
|
||||||
|
static int lrpad;
|
||||||
|
static char stext[256];
|
||||||
|
@@ -569,8 +570,8 @@ arrangelayers(Monitor *m)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (m->showbar) {
|
||||||
|
- usable_area.height -= m->b.height;
|
||||||
|
- usable_area.y += topbar ? m->b.height : 0;
|
||||||
|
+ usable_area.height = usable_area.height - vertpad - m->b.height;
|
||||||
|
+ usable_area.y = topbar ? usable_area.y + m->b.height + vp : usable_area.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Arrange exclusive surfaces from top->bottom */
|
||||||
|
@@ -1419,8 +1420,8 @@ drawbar(Monitor *mon)
|
||||||
|
}
|
||||||
|
|
||||||
|
pixman_image_unref(pix);
|
||||||
|
- wlr_scene_node_set_position(&mon->scene_buffer->node, mon->m.x,
|
||||||
|
- mon->m.y + (topbar ? 0 : mon->m.height - mon->b.height));
|
||||||
|
+ wlr_scene_node_set_position(&mon->scene_buffer->node, mon->m.x + sp,
|
||||||
|
+ mon->m.y + vp + (topbar ? 0 : mon->m.height - mon->b.height));
|
||||||
|
wlr_scene_buffer_set_buffer(mon->scene_buffer, &buf->base);
|
||||||
|
wlr_buffer_drop(&buf->base);
|
||||||
|
}
|
||||||
|
@@ -2665,6 +2666,8 @@ setup(void)
|
||||||
|
|
||||||
|
lrpad = font->height;
|
||||||
|
bh = font->height + 2;
|
||||||
|
+ sp = sidepad;
|
||||||
|
+ vp = (topbar == 1) ? vertpad : - vertpad;
|
||||||
|
|
||||||
|
status_event_source = wl_event_loop_add_fd(wl_display_get_event_loop(dpy),
|
||||||
|
STDIN_FILENO, WL_EVENT_READABLE, status_in, NULL);
|
||||||
|
@@ -3004,7 +3007,7 @@ updatebardims(Monitor *m)
|
||||||
|
{
|
||||||
|
int rw, rh;
|
||||||
|
wlr_output_effective_resolution(m->wlr_output, &rw, &rh);
|
||||||
|
- m->b.width = rw;
|
||||||
|
+ m->b.width = rw - 2 * sp;
|
||||||
|
m->b.height = bh;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.44.0
|
||||||
|
|
||||||
@@ -1,21 +1,19 @@
|
|||||||
From b12cfff672f0705d8259cf26b3a574faa5ca43ae Mon Sep 17 00:00:00 2001
|
From 18abc170273690fd3fbbdcbe88b348a0b802ba91 Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Tue, 4 Jun 2024 16:02:25 -0500
|
Date: Wed, 6 Mar 2024 11:45:30 -0500
|
||||||
Subject: [PATCH] implement borders patch
|
Subject: [PATCH] add 2 more borders for each side
|
||||||
|
|
||||||
tihs patch adds 2 extra borders relative to the client, they don't
|
|
||||||
change the size of the client
|
|
||||||
---
|
---
|
||||||
client.h | 16 +++++++++++++---
|
client.h | 16 +++++++++++++---
|
||||||
config.def.h | 8 ++++++++
|
config.def.h | 7 +++++++
|
||||||
dwl.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----
|
dwl.c | 41 +++++++++++++++++++++++++++++++++++++----
|
||||||
3 files changed, 70 insertions(+), 7 deletions(-)
|
3 files changed, 57 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/client.h b/client.h
|
diff --git a/client.h b/client.h
|
||||||
index 800b867..33fd579 100644
|
index 71c7d76..c65f3ec 100644
|
||||||
--- a/client.h
|
--- a/client.h
|
||||||
+++ b/client.h
|
+++ b/client.h
|
||||||
@@ -325,11 +325,21 @@ client_send_close(Client *c)
|
@@ -309,11 +309,21 @@ client_send_close(Client *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -41,10 +39,10 @@ index 800b867..33fd579 100644
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 8847e58..2d6bbe5 100644
|
index db0babc..bc03d24 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -7,8 +7,16 @@
|
@@ -7,7 +7,14 @@
|
||||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
static const int 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 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 */
|
||||||
@@ -52,20 +50,18 @@ index 8847e58..2d6bbe5 100644
|
|||||||
+static const unsigned int borderepx = 0; /* width of the border that start from inside the windows */
|
+static const unsigned int 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 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 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 bordercolor[] = COLOR(0x444444ff);
|
||||||
+static const float borderscolor[] = COLOR(0x444444ff); /* color of the border that start from outside the windows */
|
+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 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 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 focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bf763df..303832a 100644
|
index ef27a1d..e11b185 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -86,6 +86,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
|
@@ -80,6 +80,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrFS, LyrTop, LyrOverlay, LyrBlock,
|
||||||
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
||||||
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
||||||
#endif
|
#endif
|
||||||
@@ -73,7 +69,7 @@ index bf763df..303832a 100644
|
|||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
int i;
|
int i;
|
||||||
@@ -109,6 +110,8 @@ typedef struct {
|
@@ -103,6 +104,8 @@ typedef struct {
|
||||||
Monitor *mon;
|
Monitor *mon;
|
||||||
struct wlr_scene_tree *scene;
|
struct wlr_scene_tree *scene;
|
||||||
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
struct wlr_scene_rect *border[4]; /* top, bottom, left, right */
|
||||||
@@ -82,7 +78,7 @@ index bf763df..303832a 100644
|
|||||||
struct wlr_scene_tree *scene_surface;
|
struct wlr_scene_tree *scene_surface;
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
struct wl_list flink;
|
struct wl_list flink;
|
||||||
@@ -136,6 +139,8 @@ typedef struct {
|
@@ -127,6 +130,8 @@ typedef struct {
|
||||||
struct wl_listener set_hints;
|
struct wl_listener set_hints;
|
||||||
#endif
|
#endif
|
||||||
unsigned int bw;
|
unsigned int bw;
|
||||||
@@ -91,16 +87,16 @@ index bf763df..303832a 100644
|
|||||||
uint32_t tags;
|
uint32_t tags;
|
||||||
int isfloating, isurgent, isfullscreen;
|
int isfloating, isurgent, isfullscreen;
|
||||||
uint32_t resize; /* configure serial of a pending resize */
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
@@ -973,6 +978,8 @@ createnotify(struct wl_listener *listener, void *data)
|
@@ -971,6 +976,8 @@ createnotify(struct wl_listener *listener, void *data)
|
||||||
c = xdg_surface->data = ecalloc(1, sizeof(*c));
|
c = xdg_surface->data = ecalloc(1, sizeof(*c));
|
||||||
c->surface.xdg = xdg_surface;
|
c->surface.xdg = xdg_surface;
|
||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
+ c->bws = borders_only_floating ? 0 : borderspx;
|
+ c->bws = borderspx;
|
||||||
+ c->bwe = borders_only_floating ? 0 : borderepx;
|
+ c->bwe = borderepx;
|
||||||
|
|
||||||
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
|
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
|
||||||
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
||||||
@@ -1268,7 +1275,7 @@ focusclient(Client *c, int lift)
|
@@ -1205,7 +1212,7 @@ focusclient(Client *c, int lift)
|
||||||
/* Don't change border color if there is an exclusive focus or we are
|
/* Don't change border color if there is an exclusive focus or we are
|
||||||
* handling a drag operation */
|
* handling a drag operation */
|
||||||
if (!exclusive_focus && !seat->drag)
|
if (!exclusive_focus && !seat->drag)
|
||||||
@@ -109,7 +105,7 @@ index bf763df..303832a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Deactivate old client if focus is changing */
|
/* Deactivate old client if focus is changing */
|
||||||
@@ -1285,7 +1292,7 @@ focusclient(Client *c, int lift)
|
@@ -1222,7 +1229,7 @@ focusclient(Client *c, int lift)
|
||||||
/* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
|
/* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
|
||||||
* and probably other clients */
|
* and probably other clients */
|
||||||
} else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
|
} else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
|
||||||
@@ -118,9 +114,9 @@ index bf763df..303832a 100644
|
|||||||
|
|
||||||
client_activate_surface(old, 0);
|
client_activate_surface(old, 0);
|
||||||
}
|
}
|
||||||
@@ -1597,6 +1604,12 @@ mapnotify(struct wl_listener *listener, void *data)
|
@@ -1535,6 +1542,12 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||||
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0,
|
for (i = 0; i < 4; i++) {
|
||||||
c->isurgent ? urgentcolor : bordercolor);
|
c->border[i] = wlr_scene_rect_create(c->scene, 0, 0, bordercolor);
|
||||||
c->border[i]->node.data = c;
|
c->border[i]->node.data = c;
|
||||||
+
|
+
|
||||||
+ c->borders[i] = wlr_scene_rect_create(c->scene, 0, 0, borderscolor);
|
+ c->borders[i] = wlr_scene_rect_create(c->scene, 0, 0, borderscolor);
|
||||||
@@ -131,20 +127,7 @@ index bf763df..303832a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize client geometry with room for border */
|
/* Initialize client geometry with room for border */
|
||||||
@@ -1618,6 +1631,12 @@ mapnotify(struct wl_listener *listener, void *data)
|
@@ -1951,6 +1964,24 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||||
} 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[2]->node, 0, c->bw);
|
||||||
wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
|
wlr_scene_node_set_position(&c->border[3]->node, c->geom.width - c->bw, c->bw);
|
||||||
|
|
||||||
@@ -169,20 +152,7 @@ index bf763df..303832a 100644
|
|||||||
/* this is a no-op if size hasn't changed */
|
/* this is a no-op if size hasn't changed */
|
||||||
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
|
c->resize = client_set_size(c, c->geom.width - 2 * c->bw,
|
||||||
c->geom.height - 2 * c->bw);
|
c->geom.height - 2 * c->bw);
|
||||||
@@ -2151,6 +2188,12 @@ setfloating(Client *c, int floating)
|
@@ -2063,6 +2094,8 @@ setfullscreen(Client *c, int fullscreen)
|
||||||
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)
|
if (!c->mon)
|
||||||
return;
|
return;
|
||||||
c->bw = fullscreen ? 0 : borderpx;
|
c->bw = fullscreen ? 0 : borderpx;
|
||||||
@@ -191,23 +161,24 @@ index bf763df..303832a 100644
|
|||||||
client_set_fullscreen(c, fullscreen);
|
client_set_fullscreen(c, fullscreen);
|
||||||
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
|
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
|
||||||
? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
|
? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
|
||||||
@@ -2819,7 +2864,7 @@ urgent(struct wl_listener *listener, void *data)
|
@@ -2651,7 +2684,7 @@ urgent(struct wl_listener *listener, void *data)
|
||||||
printstatus();
|
return;
|
||||||
|
|
||||||
if (client_surface(c)->mapped)
|
if (client_surface(c)->mapped)
|
||||||
- client_set_border_color(c, urgentcolor);
|
- client_set_border_color(c, urgentcolor);
|
||||||
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
|
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
|
||||||
}
|
c->isurgent = 1;
|
||||||
|
|
||||||
void
|
|
||||||
@@ -3023,7 +3068,7 @@ sethints(struct wl_listener *listener, void *data)
|
|
||||||
printstatus();
|
printstatus();
|
||||||
|
}
|
||||||
|
@@ -2835,7 +2868,7 @@ sethints(struct wl_listener *listener, void *data)
|
||||||
|
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
|
||||||
|
|
||||||
if (c->isurgent && surface && surface->mapped)
|
if (c->isurgent && surface && surface->mapped)
|
||||||
- client_set_border_color(c, urgentcolor);
|
- client_set_border_color(c, urgentcolor);
|
||||||
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
|
+ client_set_border_color(c, urgentcolor, urgentcolor, urgentcolor);
|
||||||
}
|
|
||||||
|
|
||||||
void
|
printstatus();
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.44.1
|
2.42.0
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
From b352fb08f40b1ee2d8c4748be4922df711e3aaa9 Mon Sep 17 00:00:00 2001
|
From 589c964e47965d84ffd3a2b036e75feddd619eed Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Fri, 5 Jul 2024 10:44:29 -0500
|
Date: Thu, 11 Apr 2024 16:50:20 -0500
|
||||||
Subject: [PATCH] implement bottomstack
|
Subject: [PATCH] add bstack and bstackhoriz layouts
|
||||||
|
|
||||||
---
|
---
|
||||||
config.def.h | 4 +++
|
config.def.h | 4 +++
|
||||||
@@ -9,10 +9,10 @@ Subject: [PATCH] implement bottomstack
|
|||||||
2 files changed, 88 insertions(+)
|
2 files changed, 88 insertions(+)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..5aac3e9 100644
|
index 8847e58..68b62db 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -34,6 +34,8 @@ static const Layout layouts[] = {
|
@@ -33,6 +33,8 @@ static const Layout layouts[] = {
|
||||||
{ "[]=", tile },
|
{ "[]=", tile },
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
@@ -21,7 +21,7 @@ index 22d2171..5aac3e9 100644
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* monitors */
|
/* monitors */
|
||||||
@@ -139,6 +141,8 @@ static const Key keys[] = {
|
@@ -134,6 +136,8 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
@@ -31,10 +31,10 @@ index 22d2171..5aac3e9 100644
|
|||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index dc0437e..5648d5f 100644
|
index bf763df..dc3d000 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -57,6 +57,7 @@
|
@@ -55,6 +55,7 @@
|
||||||
#include <wlr/types/wlr_xdg_decoration_v1.h>
|
#include <wlr/types/wlr_xdg_decoration_v1.h>
|
||||||
#include <wlr/types/wlr_xdg_output_v1.h>
|
#include <wlr/types/wlr_xdg_output_v1.h>
|
||||||
#include <wlr/types/wlr_xdg_shell.h>
|
#include <wlr/types/wlr_xdg_shell.h>
|
||||||
@@ -42,7 +42,7 @@ index dc0437e..5648d5f 100644
|
|||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include <wlr/util/region.h>
|
#include <wlr/util/region.h>
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
@@ -351,6 +352,8 @@ static Monitor *xytomon(double x, double y);
|
@@ -347,6 +348,8 @@ static Monitor *xytomon(double x, double y);
|
||||||
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
static void xytonode(double x, double y, struct wlr_surface **psurface,
|
||||||
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
Client **pc, LayerSurface **pl, double *nx, double *ny);
|
||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
@@ -51,7 +51,7 @@ index dc0437e..5648d5f 100644
|
|||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
static const char broken[] = "broken";
|
static const char broken[] = "broken";
|
||||||
@@ -3160,3 +3163,84 @@ main(int argc, char *argv[])
|
@@ -3088,3 +3091,84 @@ main(int argc, char *argv[])
|
||||||
usage:
|
usage:
|
||||||
die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
|
die("Usage: %s [-v] [-d] [-s startup command]", argv[0]);
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ index dc0437e..5648d5f 100644
|
|||||||
+ return;
|
+ return;
|
||||||
+
|
+
|
||||||
+ if (n > m->nmaster) {
|
+ if (n > m->nmaster) {
|
||||||
+ mh = (int)round(m->nmaster ? m->mfact * m->w.height : 0);
|
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
|
||||||
+ tw = m->w.width / (n - m->nmaster);
|
+ tw = m->w.width / (n - m->nmaster);
|
||||||
+ ty = m->w.y + mh;
|
+ ty = m->w.y + mh;
|
||||||
+ } else {
|
+ } else {
|
||||||
@@ -111,7 +111,7 @@ index dc0437e..5648d5f 100644
|
|||||||
+ return;
|
+ return;
|
||||||
+
|
+
|
||||||
+ if (n > m->nmaster) {
|
+ if (n > m->nmaster) {
|
||||||
+ mh = (int)round(m->nmaster ? m->mfact * m->w.height : 0);
|
+ mh = ROUND(m->nmaster ? m->mfact * m->w.height : 0);
|
||||||
+ th = (m->w.height - mh) / (n - m->nmaster);
|
+ th = (m->w.height - mh) / (n - m->nmaster);
|
||||||
+ ty = m->w.y + mh;
|
+ ty = m->w.y + mh;
|
||||||
+ } else {
|
+ } else {
|
||||||
@@ -137,4 +137,5 @@ index dc0437e..5648d5f 100644
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
--
|
--
|
||||||
2.45.1
|
2.43.2
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
From 226e204ec7fb6d6840a984ef8e8ec1d2514e985f Mon Sep 17 00:00:00 2001
|
From 8cad102fd59463e8a2238845399dcaa1f759508c Mon Sep 17 00:00:00 2001
|
||||||
From: Ben Collerson <benc@benc.cc>
|
From: Ben Collerson <benc@benc.cc>
|
||||||
Date: Tue, 2 Jan 2024 10:33:59 +1000
|
Date: Tue, 2 Jan 2024 10:33:59 +1000
|
||||||
Subject: [PATCH] chainkeys
|
Subject: [PATCH 1/2] chainkeys
|
||||||
|
|
||||||
---
|
---
|
||||||
config.def.h | 62 ++++++++++++++++++++++++++--------------------------
|
config.def.h | 62 ++++++++++++++++++++++++++--------------------------
|
||||||
dwl.c | 23 ++++++++++++++++++-
|
dwl.c | 22 ++++++++++++++++++-
|
||||||
2 files changed, 53 insertions(+), 32 deletions(-)
|
2 files changed, 52 insertions(+), 32 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 8f498d2f..1c182547 100644
|
index 9009517..f4b7b2a 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -105,10 +105,10 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
@@ -105,10 +105,10 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||||
@@ -27,7 +27,7 @@ index 8f498d2f..1c182547 100644
|
|||||||
|
|
||||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
@@ -119,30 +119,30 @@ static const char *menucmd[] = { "wmenu-run", NULL };
|
@@ -119,30 +119,30 @@ static const char *menucmd[] = { "bemenu-run", NULL };
|
||||||
|
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||||
@@ -62,8 +62,8 @@ index 8f498d2f..1c182547 100644
|
|||||||
+ { MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
|
+ { MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
+ { MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
|
+ { MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
+ { MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
|
+ { MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||||
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||||
+ { MODKEY, -1, XKB_KEY_Return, zoom, {0} },
|
+ { MODKEY, -1, XKB_KEY_Return, zoom, {0} },
|
||||||
+ { MODKEY, -1, XKB_KEY_Tab, view, {0} },
|
+ { MODKEY, -1, XKB_KEY_Tab, view, {0} },
|
||||||
+ { MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
|
+ { MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
|
||||||
@@ -101,26 +101,26 @@ index 8f498d2f..1c182547 100644
|
|||||||
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
||||||
};
|
};
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bf763dfc..05e667f8 100644
|
index f25ac2f..8ffad73 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -143,6 +143,7 @@ typedef struct {
|
@@ -139,6 +139,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t mod;
|
uint32_t mod;
|
||||||
+ int chain;
|
+ xkb_keysym_t chain;
|
||||||
xkb_keysym_t keysym;
|
xkb_keysym_t keysym;
|
||||||
void (*func)(const Arg *);
|
void (*func)(const Arg *);
|
||||||
const Arg arg;
|
const Arg arg;
|
||||||
@@ -353,6 +354,7 @@ static const char broken[] = "broken";
|
@@ -338,6 +339,7 @@ static const char broken[] = "broken";
|
||||||
static pid_t child_pid = -1;
|
static pid_t child_pid = -1;
|
||||||
static int locked;
|
static int locked;
|
||||||
static void *exclusive_focus;
|
static void *exclusive_focus;
|
||||||
+static int chainkey = -1;
|
+static xkb_keysym_t chainkey = -1;
|
||||||
static struct wl_display *dpy;
|
static struct wl_display *dpy;
|
||||||
static struct wlr_backend *backend;
|
static struct wlr_backend *backend;
|
||||||
static struct wlr_scene *scene;
|
static struct wlr_scene *scene;
|
||||||
@@ -1438,11 +1440,30 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
@@ -1363,10 +1365,28 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
const Key *k;
|
const Key *k;
|
||||||
for (k = keys; k < END(keys); k++) {
|
for (k = keys; k < END(keys); k++) {
|
||||||
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||||
@@ -141,17 +141,75 @@ index bf763dfc..05e667f8 100644
|
|||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+ else if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
+ else if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||||
+ && k->chain == (int)sym
|
+ && k->chain == sym
|
||||||
+ && chainkey == -1
|
+ && chainkey == -1
|
||||||
+ && k->func) {
|
+ && k->func) {
|
||||||
+ chainkey = sym;
|
+ chainkey = sym;
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
+ chainkey = -1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|
||||||
|
From 0b11cce166dc0daabe305622d593532407a178ed Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ben Collerson <benc@benc.cc>
|
||||||
|
Date: Tue, 2 Jan 2024 10:33:59 +1000
|
||||||
|
Subject: [PATCH 2/2] fix types - signed ints should be signed.
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 4 ++--
|
||||||
|
dwl.c | 6 +++---
|
||||||
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index f4b7b2a..ac70906 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -126,8 +126,8 @@ static const Key keys[] = {
|
||||||
|
{ MODKEY, -1, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
|
{ MODKEY, -1, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
|
{ MODKEY, -1, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
|
- { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||||
|
- { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||||
|
+ { MODKEY, -1, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||||
|
+ { MODKEY, -1, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||||
|
{ MODKEY, -1, XKB_KEY_Return, zoom, {0} },
|
||||||
|
{ MODKEY, -1, XKB_KEY_Tab, view, {0} },
|
||||||
|
{ MODKEY|WLR_MODIFIER_SHIFT, -1, XKB_KEY_C, killclient, {0} },
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 8ffad73..cbb9cbf 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -139,7 +139,7 @@ typedef struct {
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t mod;
|
||||||
|
- xkb_keysym_t chain;
|
||||||
|
+ int chain;
|
||||||
|
xkb_keysym_t keysym;
|
||||||
|
void (*func)(const Arg *);
|
||||||
|
const Arg arg;
|
||||||
|
@@ -339,7 +339,7 @@ static const char broken[] = "broken";
|
||||||
|
static pid_t child_pid = -1;
|
||||||
|
static int locked;
|
||||||
|
static void *exclusive_focus;
|
||||||
|
-static xkb_keysym_t chainkey = -1;
|
||||||
|
+static int chainkey = -1;
|
||||||
|
static struct wl_display *dpy;
|
||||||
|
static struct wlr_backend *backend;
|
||||||
|
static struct wlr_scene *scene;
|
||||||
|
@@ -1381,7 +1381,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||||
|
- && k->chain == sym
|
||||||
|
+ && k->chain == (int)sym
|
||||||
|
&& chainkey == -1
|
||||||
|
&& k->func) {
|
||||||
|
chainkey = sym;
|
||||||
--
|
--
|
||||||
2.43.0
|
2.43.0
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 652fd0f8c03724fc7addaa2822913790cbbe89f0 Mon Sep 17 00:00:00 2001
|
From adbc47f25aadfa55d2e042c52f81ba4db08dd57f Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
<leohdz172@proton.me>
|
<leohdz172@proton.me>
|
||||||
Date: Tue, 25 Jul 2023 12:48:22 -0600
|
Date: Tue, 25 Jul 2023 12:48:22 -0600
|
||||||
@@ -10,50 +10,52 @@ Content-Transfer-Encoding: 8bit
|
|||||||
|
|
||||||
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
---
|
---
|
||||||
config.def.h | 9 ++++++---
|
config.def.h | 10 +++++++---
|
||||||
dwl.c | 38 ++++++++++++++++++++++++++++++++++++++
|
dwl.c | 38 ++++++++++++++++++++++++++++++++++++++
|
||||||
2 files changed, 44 insertions(+), 3 deletions(-)
|
2 files changed, 45 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index a784eb4f..2e3cdfbb 100644
|
index a8ed61d..3c79817 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
||||||
+static const float default_opacity = 0.75;
|
+static const float default_opacity = 0.75;
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
@@ -21,10 +22,10 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
|
@@ -21,11 +22,12 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
|
||||||
static int log_level = WLR_ERROR;
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
- /* app_id title tags mask isfloating monitor */
|
- /* app_id title tags mask isfloating monitor */
|
||||||
+ /* app_id title tags mask isfloating alpha monitor */
|
+ /* app_id title tags mask isfloating alpha monitor */
|
||||||
/* examples: */
|
/* examples:
|
||||||
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
- { "Gimp", NULL, 0, 1, -1 },
|
||||||
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
+ { "Gimp", NULL, 0, 1, default_alpha, -1 },
|
||||||
+ { "Gimp_EXAMPLE", NULL, 0, 1, default_opacity, -1 }, /* Start on currently visible tags floating, not tiled */
|
+ { "Alacritty",NULL, 1 << 2, 0, 1.0, -1 },
|
||||||
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, 1.0, -1 }, /* Start on ONLY tag "9" */
|
*/
|
||||||
|
- { "firefox", NULL, 1 << 8, 0, -1 },
|
||||||
|
+ { "firefox", NULL, 1 << 8, 0, default_opacity, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@@ -130,6 +131,8 @@ static const Key keys[] = {
|
@@ -128,6 +130,8 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||||
+ { MODKEY, XKB_KEY_o, setopacity, {.f = +0.1f} },
|
+ { MODKEY, XKB_KEY_o, setopacity, {.f = +0.1} },
|
||||||
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, setopacity, {.f = -0.1f} },
|
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, setopacity, {.f = -0.1} },
|
||||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 6f041a0d..83c3cd23 100644
|
index 4d19357..1b905ed 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -138,6 +138,7 @@ typedef struct {
|
@@ -133,6 +133,7 @@ typedef struct {
|
||||||
unsigned int bw;
|
unsigned int bw;
|
||||||
uint32_t tags;
|
uint32_t tags;
|
||||||
int isfloating, isurgent, isfullscreen;
|
int isfloating, isurgent, isfullscreen;
|
||||||
@@ -61,7 +63,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
uint32_t resize; /* configure serial of a pending resize */
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
} Client;
|
} Client;
|
||||||
|
|
||||||
@@ -228,6 +229,7 @@ typedef struct {
|
@@ -217,6 +218,7 @@ typedef struct {
|
||||||
const char *title;
|
const char *title;
|
||||||
uint32_t tags;
|
uint32_t tags;
|
||||||
int isfloating;
|
int isfloating;
|
||||||
@@ -69,7 +71,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
int monitor;
|
int monitor;
|
||||||
} Rule;
|
} Rule;
|
||||||
|
|
||||||
@@ -317,6 +319,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data);
|
@@ -299,6 +301,7 @@ static void requeststartdrag(struct wl_listener *listener, void *data);
|
||||||
static void requestmonstate(struct wl_listener *listener, void *data);
|
static void requestmonstate(struct wl_listener *listener, void *data);
|
||||||
static void resize(Client *c, struct wlr_box geo, int interact);
|
static void resize(Client *c, struct wlr_box geo, int interact);
|
||||||
static void run(char *startup_cmd);
|
static void run(char *startup_cmd);
|
||||||
@@ -77,7 +79,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
static void setcursor(struct wl_listener *listener, void *data);
|
static void setcursor(struct wl_listener *listener, void *data);
|
||||||
static void setcursorshape(struct wl_listener *listener, void *data);
|
static void setcursorshape(struct wl_listener *listener, void *data);
|
||||||
static void setfloating(Client *c, int floating);
|
static void setfloating(Client *c, int floating);
|
||||||
@@ -325,6 +328,7 @@ static void setgamma(struct wl_listener *listener, void *data);
|
@@ -307,6 +310,7 @@ static void setgamma(struct wl_listener *listener, void *data);
|
||||||
static void setlayout(const Arg *arg);
|
static void setlayout(const Arg *arg);
|
||||||
static void setmfact(const Arg *arg);
|
static void setmfact(const Arg *arg);
|
||||||
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
static void setmon(Client *c, Monitor *m, uint32_t newtags);
|
||||||
@@ -85,7 +87,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
static void setpsel(struct wl_listener *listener, void *data);
|
static void setpsel(struct wl_listener *listener, void *data);
|
||||||
static void setsel(struct wl_listener *listener, void *data);
|
static void setsel(struct wl_listener *listener, void *data);
|
||||||
static void setup(void);
|
static void setup(void);
|
||||||
@@ -464,6 +468,7 @@ applyrules(Client *c)
|
@@ -440,6 +444,7 @@ applyrules(Client *c)
|
||||||
if ((!r->title || strstr(title, r->title))
|
if ((!r->title || strstr(title, r->title))
|
||||||
&& (!r->id || strstr(appid, r->id))) {
|
&& (!r->id || strstr(appid, r->id))) {
|
||||||
c->isfloating = r->isfloating;
|
c->isfloating = r->isfloating;
|
||||||
@@ -93,15 +95,15 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
newtags |= r->tags;
|
newtags |= r->tags;
|
||||||
i = 0;
|
i = 0;
|
||||||
wl_list_for_each(m, &mons, link) {
|
wl_list_for_each(m, &mons, link) {
|
||||||
@@ -472,6 +477,7 @@ applyrules(Client *c)
|
@@ -448,6 +453,7 @@ applyrules(Client *c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, scenebuffersetopacity, c);
|
+ wlr_scene_node_for_each_buffer(&c->scene_surface->node, scenebuffersetopacity, c);
|
||||||
|
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
|
||||||
setmon(c, mon, newtags);
|
setmon(c, mon, newtags);
|
||||||
}
|
}
|
||||||
|
@@ -734,6 +740,9 @@ commitnotify(struct wl_listener *listener, void *data)
|
||||||
@@ -773,6 +779,9 @@ commitnotify(struct wl_listener *listener, void *data)
|
|
||||||
if (client_surface(c)->mapped && c->mon)
|
if (client_surface(c)->mapped && c->mon)
|
||||||
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
||||||
|
|
||||||
@@ -111,7 +113,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
/* mark a pending resize as completed */
|
/* mark a pending resize as completed */
|
||||||
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
|
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
|
||||||
c->resize = 0;
|
c->resize = 0;
|
||||||
@@ -1024,6 +1033,7 @@ createnotify(struct wl_listener *listener, void *data)
|
@@ -947,6 +956,7 @@ createnotify(struct wl_listener *listener, void *data)
|
||||||
c = xdg_surface->data = ecalloc(1, sizeof(*c));
|
c = xdg_surface->data = ecalloc(1, sizeof(*c));
|
||||||
c->surface.xdg = xdg_surface;
|
c->surface.xdg = xdg_surface;
|
||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
@@ -119,7 +121,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
|
|
||||||
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
|
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
|
||||||
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
||||||
@@ -2173,6 +2183,15 @@ run(char *startup_cmd)
|
@@ -2002,6 +2012,15 @@ run(char *startup_cmd)
|
||||||
wl_display_run(dpy);
|
wl_display_run(dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +137,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
void
|
void
|
||||||
setcursor(struct wl_listener *listener, void *data)
|
setcursor(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
@@ -2241,6 +2260,7 @@ setfullscreen(Client *c, int fullscreen)
|
@@ -2067,6 +2086,7 @@ setfullscreen(Client *c, int fullscreen)
|
||||||
* client positions are set by the user and cannot be recalculated */
|
* client positions are set by the user and cannot be recalculated */
|
||||||
resize(c, c->prev, 0);
|
resize(c, c->prev, 0);
|
||||||
}
|
}
|
||||||
@@ -143,7 +145,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
@@ -2308,6 +2328,23 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
@@ -2132,6 +2152,23 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
||||||
focusclient(focustop(selmon), 1);
|
focusclient(focustop(selmon), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +169,7 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
void
|
void
|
||||||
setpsel(struct wl_listener *listener, void *data)
|
setpsel(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
@@ -2997,6 +3034,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
|
@@ -2842,6 +2879,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
|
||||||
c->surface.xwayland = xsurface;
|
c->surface.xwayland = xsurface;
|
||||||
c->type = X11;
|
c->type = X11;
|
||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
@@ -176,5 +178,5 @@ index 6f041a0d..83c3cd23 100644
|
|||||||
/* Listen to the various events it can emit */
|
/* Listen to the various events it can emit */
|
||||||
LISTEN(&xsurface->events.associate, &c->associate, associatex11);
|
LISTEN(&xsurface->events.associate, &c->associate, associatex11);
|
||||||
--
|
--
|
||||||
2.45.2
|
2.43.0
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From ab8abc0186ad74e24bdf9e4f3af00d03ac269631 Mon Sep 17 00:00:00 2001
|
From 38bf34759e5eb3aed9fd14429eee8a1e509c014e Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
<leohdz172@proton.me>
|
<leohdz172@protonmail.com>
|
||||||
Date: Wed, 5 Oct 2022 23:07:13 -0500
|
Date: Wed, 5 Oct 2022 23:07:13 -0500
|
||||||
Subject: [PATCH] increase RLIMIT_CORE (generate a coredump)
|
Subject: [PATCH] increase RLIMIT_CORE (generate a coredump)
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
@@ -13,10 +13,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
|||||||
1 file changed, 9 insertions(+)
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 9021e442..3af09d54 100644
|
index 10d5a5b..62cdb5a 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -8,6 +8,7 @@
|
@@ -7,6 +7,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -24,24 +24,24 @@ index 9021e442..3af09d54 100644
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -357,6 +358,8 @@ static void xytonode(double x, double y, struct wlr_surface **psurface,
|
@@ -334,6 +335,8 @@ static void zoom(const Arg *arg);
|
||||||
static void zoom(const Arg *arg);
|
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
|
static const char broken[] = "broken";
|
||||||
+static struct rlimit oldrlimit;
|
+static struct rlimit oldrlimit;
|
||||||
+static struct rlimit newrlimit;
|
+static struct rlimit newrlimit;
|
||||||
static pid_t child_pid = -1;
|
static pid_t child_pid = -1;
|
||||||
static int locked;
|
static int locked;
|
||||||
static void *exclusive_focus;
|
static void *exclusive_focus;
|
||||||
@@ -2201,6 +2204,7 @@ run(char *startup_cmd)
|
@@ -1972,6 +1975,7 @@ run(char *startup_cmd)
|
||||||
if ((child_pid = fork()) < 0)
|
if ((child_pid = fork()) < 0)
|
||||||
die("startup: fork:");
|
die("startup: fork:");
|
||||||
if (child_pid == 0) {
|
if (child_pid == 0) {
|
||||||
+ setrlimit(RLIMIT_CORE, &oldrlimit);
|
+ setrlimit(RLIMIT_CORE, &oldrlimit);
|
||||||
setsid();
|
|
||||||
dup2(piperw[0], STDIN_FILENO);
|
dup2(piperw[0], STDIN_FILENO);
|
||||||
close(piperw[0]);
|
close(piperw[0]);
|
||||||
@@ -2609,6 +2613,7 @@ void
|
close(piperw[1]);
|
||||||
|
@@ -2410,6 +2414,7 @@ void
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
@@ -49,7 +49,7 @@ index 9021e442..3af09d54 100644
|
|||||||
dup2(STDERR_FILENO, STDOUT_FILENO);
|
dup2(STDERR_FILENO, STDOUT_FILENO);
|
||||||
setsid();
|
setsid();
|
||||||
execvp(((char **)arg->v)[0], (char **)arg->v);
|
execvp(((char **)arg->v)[0], (char **)arg->v);
|
||||||
@@ -3156,6 +3161,10 @@ main(int argc, char *argv[])
|
@@ -2928,6 +2933,10 @@ main(int argc, char *argv[])
|
||||||
char *startup_cmd = NULL;
|
char *startup_cmd = NULL;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@@ -61,5 +61,5 @@ index 9021e442..3af09d54 100644
|
|||||||
if (c == 's')
|
if (c == 's')
|
||||||
startup_cmd = optarg;
|
startup_cmd = optarg;
|
||||||
--
|
--
|
||||||
2.46.0
|
2.43.0
|
||||||
|
|
||||||
@@ -1,46 +1,51 @@
|
|||||||
From f08376a2a04929a3907612e6c1f980ad3cdf939f Mon Sep 17 00:00:00 2001
|
From 55c22683c88c9816ceba6351a716fbe005555abd Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Fri, 5 Jul 2024 11:10:39 -0500
|
Date: Thu, 11 Apr 2024 12:43:29 -0500
|
||||||
Subject: [PATCH] implement cursortheme
|
Subject: [PATCH] add ability to change cursor's theme and size
|
||||||
|
|
||||||
---
|
---
|
||||||
config.def.h | 2 ++
|
config.def.h | 2 ++
|
||||||
dwl.c | 8 ++++++--
|
dwl.c | 6 ++++--
|
||||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..1f9ff56 100644
|
index 8847e58..3189d48 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -13,6 +13,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
@@ -13,6 +13,8 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to 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 */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
+static const char *cursor_theme = NULL;
|
+static const char cursortheme[] = ""; /* theme from /usr/share/cursors/xorg-x11 */
|
||||||
+static const char cursor_size[] = "24"; /* Make sure it's a valid integer, otherwise things will break */
|
+static const unsigned int cursorsize = 24;
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index dc0437e..a91d42b 100644
|
index bf763df..961e2f1 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -2522,8 +2522,12 @@ setup(void)
|
@@ -2274,7 +2274,9 @@ setup(void)
|
||||||
|
|
||||||
|
int i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
||||||
|
struct sigaction sa = {.sa_flags = SA_RESTART, .sa_handler = handlesig};
|
||||||
|
+ char cursorsize_str[3];
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
+ sprintf(cursorsize_str, "%d", cursorsize);
|
||||||
|
|
||||||
|
for (i = 0; i < (int)LENGTH(sig); i++)
|
||||||
|
sigaction(sig[i], &sa, NULL);
|
||||||
|
@@ -2412,8 +2414,8 @@ setup(void)
|
||||||
* Xcursor themes to source cursor images from and makes sure that cursor
|
* Xcursor themes to source cursor images from and makes sure that cursor
|
||||||
* images are available at all scale factors on the screen (necessary for
|
* images are available at all scale factors on the screen (necessary for
|
||||||
* HiDPI support). Scaled cursors will be loaded with each output. */
|
* HiDPI support). Scaled cursors will be loaded with each output. */
|
||||||
- cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
- cursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
||||||
- setenv("XCURSOR_SIZE", "24", 1);
|
- setenv("XCURSOR_SIZE", "24", 1);
|
||||||
+ cursor_mgr = wlr_xcursor_manager_create(cursor_theme, atoi(cursor_size));
|
+ cursor_mgr = wlr_xcursor_manager_create(cursortheme, cursorsize);
|
||||||
+ setenv("XCURSOR_SIZE", cursor_size, 1);
|
+ setenv("XCURSOR_SIZE", cursorsize_str, 1);
|
||||||
+ if (cursor_theme)
|
|
||||||
+ setenv("XCURSOR_THEME", cursor_theme, 1);
|
|
||||||
+ else
|
|
||||||
+ unsetenv("XCURSOR_THEME");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wlr_cursor *only* displays an image on screen. It does not move around
|
* wlr_cursor *only* displays an image on screen. It does not move around
|
||||||
--
|
--
|
||||||
2.45.1
|
2.43.2
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
From ff29aba2f45d5acdee66efaf7cf94ab66145c0ed Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Thu, 11 Apr 2024 14:19:24 -0500
|
||||||
|
Subject: [PATCH] rules for floating windows support default x, y, width,
|
||||||
|
height If the width or height is less than or equal to 1, then the value will
|
||||||
|
be interpreted as a percentage. For example, 0.5 represents 50%, 0.25
|
||||||
|
represents 25%, and 1 represents 100%. NOTE: Some clients, like Thunar, have
|
||||||
|
minimum width/height
|
||||||
|
|
||||||
|
`floating_relative_to_monitor` allows the user to choose whether to position relative to the monitor or relative to the window area.
|
||||||
|
---
|
||||||
|
config.def.h | 7 ++++---
|
||||||
|
dwl.c | 16 ++++++++++++++++
|
||||||
|
2 files changed, 20 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 8847e58..ebaf1ab 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
|
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||||
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
+static const int floating_relative_to_monitor = 0; /* 0 means center floating relative to the window area */
|
||||||
|
|
||||||
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
|
#define TAGCOUNT (9)
|
||||||
|
@@ -21,10 +22,10 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
|
||||||
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
|
static const Rule rules[] = {
|
||||||
|
- /* app_id title tags mask isfloating monitor */
|
||||||
|
+ /* app_id title tags mask isfloating monitor x y width height */
|
||||||
|
/* examples: */
|
||||||
|
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
|
||||||
|
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
|
||||||
|
+ { "Gimp_EXAMPLE", NULL, 0, 1, -1, 0, 0, 1000, 0.75 }, /* Start on currently visible tags floating, not tiled */
|
||||||
|
+ { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1, 0, 0, 0, 0 },/* Start on ONLY tag "9" */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index bf763df..94e4d7d 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -228,6 +228,10 @@ typedef struct {
|
||||||
|
uint32_t tags;
|
||||||
|
int isfloating;
|
||||||
|
int monitor;
|
||||||
|
+ int x;
|
||||||
|
+ int y;
|
||||||
|
+ float w;
|
||||||
|
+ float h;
|
||||||
|
} Rule;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
@@ -468,6 +472,18 @@ applyrules(Client *c)
|
||||||
|
if (r->monitor == i++)
|
||||||
|
mon = m;
|
||||||
|
}
|
||||||
|
+ if (c->isfloating) {
|
||||||
|
+ struct wlr_box b = floating_relative_to_monitor ? mon->m : mon->w;
|
||||||
|
+ int newwidth = ROUND(r->w ? (r->w <= 1 ? b.width * r->w : r->w) : c->geom.width);
|
||||||
|
+ int newheight = ROUND(r->h ? (r->h <= 1 ? b.height * r->h : r->h) : c->geom.height);
|
||||||
|
+
|
||||||
|
+ resize(c, (struct wlr_box){
|
||||||
|
+ .x = r->x ? r->x + b.x : (b.width - newwidth) / 2 + b.x,
|
||||||
|
+ .y = r->y ? r->y + b.y : (b.height - newheight) / 2 + b.y,
|
||||||
|
+ .width = newwidth,
|
||||||
|
+ .height = newheight,
|
||||||
|
+ }, 1);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setmon(c, mon, newtags);
|
||||||
|
--
|
||||||
|
2.43.2
|
||||||
+12
-12
@@ -1,4 +1,4 @@
|
|||||||
From 3c3ea42cd50bfa5111be69b3c1f71afa0443bb53 Mon Sep 17 00:00:00 2001
|
From a822ac65306ca331b95b17ffe08147110c03c60d Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Sat, 30 Dec 2023 10:49:48 +0200
|
Date: Sat, 30 Dec 2023 10:49:48 +0200
|
||||||
Subject: [PATCH] allow environment variables to override config.h
|
Subject: [PATCH] allow environment variables to override config.h
|
||||||
@@ -12,19 +12,19 @@ Subject: [PATCH] allow environment variables to override config.h
|
|||||||
create mode 100644 env.c
|
create mode 100644 env.c
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
diff --git a/Makefile b/Makefile
|
||||||
index 9308656..c66d376 100644
|
index 0822ddc..fbdfdca 100644
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -22,6 +22,7 @@ dwl: dwl.o util.o
|
@@ -17,6 +17,7 @@ all: dwl
|
||||||
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
|
dwl: dwl.o util.o
|
||||||
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
$(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
||||||
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h
|
||||||
+dwl.o: env.c
|
+dwl.o: env.c
|
||||||
util.o: util.c util.h
|
util.o: util.c util.h
|
||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index a784eb4..e0f10de 100644
|
index 9009517..c6b9ae0 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -6,11 +6,11 @@
|
@@ -6,11 +6,11 @@
|
||||||
@@ -41,14 +41,14 @@ index a784eb4..e0f10de 100644
|
|||||||
+static float bordercolor[] = COLOR(0x444444ff);
|
+static float bordercolor[] = COLOR(0x444444ff);
|
||||||
+static float focuscolor[] = COLOR(0x005577ff);
|
+static float focuscolor[] = COLOR(0x005577ff);
|
||||||
+static float urgentcolor[] = COLOR(0xff0000ff);
|
+static float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index d48bf40..de33dfe 100644
|
index fa76db2..6dd4524 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -429,6 +429,8 @@ static xcb_atom_t netatom[NetLast];
|
@@ -407,6 +407,8 @@ static xcb_atom_t netatom[NetLast];
|
||||||
/* attempt to encapsulate suck into one file */
|
/* attempt to encapsulate suck into one file */
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ index d48bf40..de33dfe 100644
|
|||||||
/* function implementations */
|
/* function implementations */
|
||||||
void
|
void
|
||||||
applybounds(Client *c, struct wlr_box *bbox)
|
applybounds(Client *c, struct wlr_box *bbox)
|
||||||
@@ -1082,6 +1084,8 @@ createpointer(struct wlr_pointer *pointer)
|
@@ -1010,6 +1012,8 @@ createpointer(struct wlr_pointer *pointer)
|
||||||
libinput_device_config_accel_set_profile(device, accel_profile);
|
libinput_device_config_accel_set_profile(device, accel_profile);
|
||||||
libinput_device_config_accel_set_speed(device, accel_speed);
|
libinput_device_config_accel_set_speed(device, accel_speed);
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ index d48bf40..de33dfe 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
wlr_cursor_attach_input_device(cursor, &pointer->base);
|
wlr_cursor_attach_input_device(cursor, &pointer->base);
|
||||||
@@ -3141,6 +3145,7 @@ main(int argc, char *argv[])
|
@@ -2974,6 +2978,7 @@ main(int argc, char *argv[])
|
||||||
/* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
|
/* Wayland requires XDG_RUNTIME_DIR for creating its communications socket */
|
||||||
if (!getenv("XDG_RUNTIME_DIR"))
|
if (!getenv("XDG_RUNTIME_DIR"))
|
||||||
die("XDG_RUNTIME_DIR must be set");
|
die("XDG_RUNTIME_DIR must be set");
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From a94c52af879027e654f67c36621a8c9b2f338f56 Mon Sep 17 00:00:00 2001
|
From 830f6ed5352d32a66c62f49b28439b2bcd904417 Mon Sep 17 00:00:00 2001
|
||||||
From: Dima Krasner <dima@dimakrasner.com>
|
From: Dima Krasner <dima@dimakrasner.com>
|
||||||
Date: Sat, 2 Dec 2023 10:36:35 +0200
|
Date: Sat, 2 Dec 2023 10:36:35 +0200
|
||||||
Subject: [PATCH] fall back to a lower output mode if needed
|
Subject: [PATCH] fall back to a lower output mode if needed
|
||||||
@@ -9,10 +9,10 @@ Subject: [PATCH] fall back to a lower output mode if needed
|
|||||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index d48bf40..7719f7e 100644
|
index fa76db2..88cabeb 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -920,6 +920,7 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -848,6 +848,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
/* This event is raised by the backend when a new output (aka a display or
|
/* This event is raised by the backend when a new output (aka a display or
|
||||||
* monitor) becomes available. */
|
* monitor) becomes available. */
|
||||||
struct wlr_output *wlr_output = data;
|
struct wlr_output *wlr_output = data;
|
||||||
@@ -20,7 +20,7 @@ index d48bf40..7719f7e 100644
|
|||||||
const MonitorRule *r;
|
const MonitorRule *r;
|
||||||
size_t i;
|
size_t i;
|
||||||
struct wlr_output_state state;
|
struct wlr_output_state state;
|
||||||
@@ -956,7 +957,17 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -884,7 +885,17 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
* monitor supports only a specific set of modes. We just pick the
|
* monitor supports only a specific set of modes. We just pick the
|
||||||
* monitor's preferred mode; a more sophisticated compositor would let
|
* monitor's preferred mode; a more sophisticated compositor would let
|
||||||
* the user configure it. */
|
* the user configure it. */
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
From 50e3dd4746b6cb719efb9f8213b94ac52a5320d9 Mon Sep 17 00:00:00 2001
|
From c814a3f16995a2fe8542c5bbdb28e38e7de5ef7e Mon Sep 17 00:00:00 2001
|
||||||
From: peesock <kcormn@gmail.com>
|
From: sewn <sewn@disroot.org>
|
||||||
Date: Mon, 24 Jun 2024 20:06:42 -0700
|
Date: Sun, 15 Oct 2023 09:38:16 +0100
|
||||||
Subject: [PATCH] gaps!
|
Subject: [PATCH] introduce gaps with functionality of useless gaps from dwm
|
||||||
|
|
||||||
Co-authored-by: sewn <sewn@disroot.org>
|
|
||||||
Co-authored-by: serenevoid <ajuph9224@gmail.com>
|
Co-authored-by: serenevoid <ajuph9224@gmail.com>
|
||||||
---
|
---
|
||||||
config.def.h | 4 ++++
|
config.def.h | 4 ++++
|
||||||
dwl.c | 34 ++++++++++++++++++++++++++--------
|
dwl.c | 38 ++++++++++++++++++++++++++++----------
|
||||||
2 files changed, 30 insertions(+), 8 deletions(-)
|
2 files changed, 32 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..b388b4e 100644
|
index 8847e58..dca0a46 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -6,6 +6,9 @@
|
@@ -6,6 +6,9 @@
|
||||||
@@ -24,7 +23,7 @@ index 22d2171..b388b4e 100644
|
|||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const float rootcolor[] = COLOR(0x222222ff);
|
static const float rootcolor[] = COLOR(0x222222ff);
|
||||||
static const float bordercolor[] = COLOR(0x444444ff);
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
@@ -135,6 +138,7 @@ static const Key keys[] = {
|
@@ -130,6 +133,7 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||||
@@ -33,10 +32,10 @@ index 22d2171..b388b4e 100644
|
|||||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index dc0437e..dc851df 100644
|
index 39ce68c..2d317c5 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -199,6 +199,7 @@ struct Monitor {
|
@@ -198,6 +198,7 @@ struct Monitor {
|
||||||
struct wlr_box w; /* window area, layout-relative */
|
struct wlr_box w; /* window area, layout-relative */
|
||||||
struct wl_list layers[4]; /* LayerSurface.link */
|
struct wl_list layers[4]; /* LayerSurface.link */
|
||||||
const Layout *lt[2];
|
const Layout *lt[2];
|
||||||
@@ -44,7 +43,7 @@ index dc0437e..dc851df 100644
|
|||||||
unsigned int seltags;
|
unsigned int seltags;
|
||||||
unsigned int sellt;
|
unsigned int sellt;
|
||||||
uint32_t tagset[2];
|
uint32_t tagset[2];
|
||||||
@@ -336,6 +337,7 @@ static void tagmon(const Arg *arg);
|
@@ -332,6 +333,7 @@ static void tagmon(const Arg *arg);
|
||||||
static void tile(Monitor *m);
|
static void tile(Monitor *m);
|
||||||
static void togglefloating(const Arg *arg);
|
static void togglefloating(const Arg *arg);
|
||||||
static void togglefullscreen(const Arg *arg);
|
static void togglefullscreen(const Arg *arg);
|
||||||
@@ -52,7 +51,7 @@ index dc0437e..dc851df 100644
|
|||||||
static void toggletag(const Arg *arg);
|
static void toggletag(const Arg *arg);
|
||||||
static void toggleview(const Arg *arg);
|
static void toggleview(const Arg *arg);
|
||||||
static void unlocksession(struct wl_listener *listener, void *data);
|
static void unlocksession(struct wl_listener *listener, void *data);
|
||||||
@@ -949,6 +951,8 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -881,6 +883,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
wlr_output_state_init(&state);
|
wlr_output_state_init(&state);
|
||||||
/* Initialize monitor state using configured rules */
|
/* Initialize monitor state using configured rules */
|
||||||
@@ -61,7 +60,7 @@ index dc0437e..dc851df 100644
|
|||||||
m->tagset[0] = m->tagset[1] = 1;
|
m->tagset[0] = m->tagset[1] = 1;
|
||||||
for (r = monrules; r < END(monrules); r++) {
|
for (r = monrules; r < END(monrules); r++) {
|
||||||
if (!r->name || strstr(wlr_output->name, r->name)) {
|
if (!r->name || strstr(wlr_output->name, r->name)) {
|
||||||
@@ -2638,7 +2642,7 @@ tagmon(const Arg *arg)
|
@@ -2572,7 +2576,7 @@ tagmon(const Arg *arg)
|
||||||
void
|
void
|
||||||
tile(Monitor *m)
|
tile(Monitor *m)
|
||||||
{
|
{
|
||||||
@@ -70,7 +69,7 @@ index dc0437e..dc851df 100644
|
|||||||
int i, n = 0;
|
int i, n = 0;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
@@ -2647,23 +2651,30 @@ tile(Monitor *m)
|
@@ -2581,23 +2585,30 @@ tile(Monitor *m)
|
||||||
n++;
|
n++;
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return;
|
return;
|
||||||
@@ -78,11 +77,12 @@ index dc0437e..dc851df 100644
|
|||||||
+ e = 0;
|
+ e = 0;
|
||||||
|
|
||||||
if (n > m->nmaster)
|
if (n > m->nmaster)
|
||||||
- mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
|
- mw = m->nmaster ? ROUND(m->w.width * m->mfact) : 0;
|
||||||
+ mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0;
|
+ mw = m->nmaster ? ROUND((m->w.width + gappx*e) * m->mfact) : 0;
|
||||||
else
|
else
|
||||||
mw = m->w.width;
|
- mw = m->w.width;
|
||||||
- i = my = ty = 0;
|
- i = my = ty = 0;
|
||||||
|
+ mw = m->w.width - 2*gappx*e + gappx*e;
|
||||||
+ i = 0;
|
+ i = 0;
|
||||||
+ my = ty = gappx*e;
|
+ my = ty = gappx*e;
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
@@ -95,20 +95,21 @@ index dc0437e..dc851df 100644
|
|||||||
+ r = MIN(n, m->nmaster) - i;
|
+ r = MIN(n, m->nmaster) - i;
|
||||||
+ h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
|
+ h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
|
||||||
+ resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
|
+ resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
|
||||||
+ .width = mw - 2*gappx*e, .height = h}, 0);
|
+ .width = mw - gappx*e, .height = h}, 0);
|
||||||
+ my += c->geom.height + gappx*e;
|
+ my += c->geom.height + gappx*e;
|
||||||
} else {
|
} else {
|
||||||
+ r = n - i;
|
- resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
|
||||||
+ h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
|
|
||||||
resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
|
|
||||||
- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
|
- .width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0);
|
||||||
- ty += c->geom.height;
|
- ty += c->geom.height;
|
||||||
+ .width = m->w.width - mw - gappx*e, .height = h}, 0);
|
+ r = n - i;
|
||||||
|
+ h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
|
||||||
|
+ resize(c, (struct wlr_box){.x = m->w.x + mw + gappx*e, .y = m->w.y + ty,
|
||||||
|
+ .width = m->w.width - mw - 2*gappx*e, .height = h}, 0);
|
||||||
+ ty += c->geom.height + gappx*e;
|
+ ty += c->geom.height + gappx*e;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -2686,6 +2697,13 @@ togglefullscreen(const Arg *arg)
|
@@ -2620,6 +2631,13 @@ togglefullscreen(const Arg *arg)
|
||||||
setfullscreen(sel, !sel->isfullscreen);
|
setfullscreen(sel, !sel->isfullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,5 +124,5 @@ index dc0437e..dc851df 100644
|
|||||||
toggletag(const Arg *arg)
|
toggletag(const Arg *arg)
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.45.2
|
2.44.0
|
||||||
|
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
From 42f97e88bd901d81b81da61c44a790b583706308 Mon Sep 17 00:00:00 2001
|
From 6b9c8f96a2f1ed3c36d260df1e1dcba24cb98550 Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Fri, 5 Jul 2024 11:18:49 -0500
|
Date: Thu, 11 Apr 2024 14:46:48 -0500
|
||||||
Subject: [PATCH] implement gestures
|
Subject: [PATCH] add swipe gestures to trigger functions
|
||||||
|
|
||||||
|
like libinput-gestures, it supports the following gestures: SWIPE_UP, SWIPE_DOWN, SWIPE_LEFT and SWIPE_RIGHTsupport multiple fingers count in gestures[]support mods in gestures[]
|
||||||
---
|
---
|
||||||
config.def.h | 9 +++++++
|
config.def.h | 9 +++++++
|
||||||
dwl.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
dwl.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
2 files changed, 77 insertions(+)
|
2 files changed, 77 insertions(+)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..8b75564 100644
|
index 8847e58..53a8437 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -14,6 +14,8 @@ static const float urgentcolor[] = COLOR(0xff0000ff);
|
@@ -14,6 +14,8 @@ static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
@@ -21,7 +22,7 @@ index 22d2171..8b75564 100644
|
|||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
|
|
||||||
@@ -174,3 +176,10 @@ static const Button buttons[] = {
|
@@ -169,3 +171,10 @@ static const Button buttons[] = {
|
||||||
{ MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
{ MODKEY, BTN_MIDDLE, togglefloating, {0} },
|
||||||
{ MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
{ MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} },
|
||||||
};
|
};
|
||||||
@@ -33,10 +34,10 @@ index 22d2171..8b75564 100644
|
|||||||
+ { MODKEY, SWIPE_DOWN, 3, focusstack, {.i = -1} },
|
+ { MODKEY, SWIPE_DOWN, 3, focusstack, {.i = -1} },
|
||||||
+};
|
+};
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index ded83e2..5d861e8 100644
|
index e96ea09..7e8a684 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -88,6 +88,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
|
@@ -87,6 +87,7 @@ enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock,
|
||||||
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
enum { NetWMWindowTypeDialog, NetWMWindowTypeSplash, NetWMWindowTypeToolbar,
|
||||||
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
NetWMWindowTypeUtility, NetLast }; /* EWMH atoms */
|
||||||
#endif
|
#endif
|
||||||
@@ -44,7 +45,7 @@ index ded83e2..5d861e8 100644
|
|||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
int i;
|
int i;
|
||||||
@@ -103,6 +104,14 @@ typedef struct {
|
@@ -102,6 +103,14 @@ typedef struct {
|
||||||
const Arg arg;
|
const Arg arg;
|
||||||
} Button;
|
} Button;
|
||||||
|
|
||||||
@@ -59,7 +60,7 @@ index ded83e2..5d861e8 100644
|
|||||||
typedef struct Monitor Monitor;
|
typedef struct Monitor Monitor;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Must keep these three elements in this order */
|
/* Must keep these three elements in this order */
|
||||||
@@ -251,6 +260,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
|
@@ -249,6 +258,7 @@ static void arrangelayer(Monitor *m, struct wl_list *list,
|
||||||
static void arrangelayers(Monitor *m);
|
static void arrangelayers(Monitor *m);
|
||||||
static void axisnotify(struct wl_listener *listener, void *data);
|
static void axisnotify(struct wl_listener *listener, void *data);
|
||||||
static void buttonpress(struct wl_listener *listener, void *data);
|
static void buttonpress(struct wl_listener *listener, void *data);
|
||||||
@@ -67,7 +68,7 @@ index ded83e2..5d861e8 100644
|
|||||||
static void swipe_begin(struct wl_listener *listener, void *data);
|
static void swipe_begin(struct wl_listener *listener, void *data);
|
||||||
static void swipe_update(struct wl_listener *listener, void *data);
|
static void swipe_update(struct wl_listener *listener, void *data);
|
||||||
static void swipe_end(struct wl_listener *listener, void *data);
|
static void swipe_end(struct wl_listener *listener, void *data);
|
||||||
@@ -416,6 +426,10 @@ static struct wlr_box sgeom;
|
@@ -413,6 +423,10 @@ static struct wlr_box sgeom;
|
||||||
static struct wl_list mons;
|
static struct wl_list mons;
|
||||||
static Monitor *selmon;
|
static Monitor *selmon;
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ index ded83e2..5d861e8 100644
|
|||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
static void activatex11(struct wl_listener *listener, void *data);
|
static void activatex11(struct wl_listener *listener, void *data);
|
||||||
static void associatex11(struct wl_listener *listener, void *data);
|
static void associatex11(struct wl_listener *listener, void *data);
|
||||||
@@ -435,6 +449,8 @@ static xcb_atom_t netatom[NetLast];
|
@@ -432,6 +446,8 @@ static xcb_atom_t netatom[NetLast];
|
||||||
/* attempt to encapsulate suck into one file */
|
/* attempt to encapsulate suck into one file */
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ index ded83e2..5d861e8 100644
|
|||||||
/* function implementations */
|
/* function implementations */
|
||||||
void
|
void
|
||||||
applybounds(Client *c, struct wlr_box *bbox)
|
applybounds(Client *c, struct wlr_box *bbox)
|
||||||
@@ -657,6 +673,11 @@ swipe_begin(struct wl_listener *listener, void *data)
|
@@ -641,6 +657,11 @@ swipe_begin(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_pointer_swipe_begin_event *event = data;
|
struct wlr_pointer_swipe_begin_event *event = data;
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ index ded83e2..5d861e8 100644
|
|||||||
// Forward swipe begin event to client
|
// Forward swipe begin event to client
|
||||||
wlr_pointer_gestures_v1_send_swipe_begin(
|
wlr_pointer_gestures_v1_send_swipe_begin(
|
||||||
pointer_gestures,
|
pointer_gestures,
|
||||||
@@ -671,6 +692,11 @@ swipe_update(struct wl_listener *listener, void *data)
|
@@ -655,6 +676,11 @@ swipe_update(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct wlr_pointer_swipe_update_event *event = data;
|
struct wlr_pointer_swipe_update_event *event = data;
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ index ded83e2..5d861e8 100644
|
|||||||
// Forward swipe update event to client
|
// Forward swipe update event to client
|
||||||
wlr_pointer_gestures_v1_send_swipe_update(
|
wlr_pointer_gestures_v1_send_swipe_update(
|
||||||
pointer_gestures,
|
pointer_gestures,
|
||||||
@@ -681,11 +707,53 @@ swipe_update(struct wl_listener *listener, void *data)
|
@@ -665,11 +691,53 @@ swipe_update(struct wl_listener *listener, void *data)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +123,8 @@ index ded83e2..5d861e8 100644
|
|||||||
+ uint32_t mods;
|
+ uint32_t mods;
|
||||||
+ const Gesture *g;
|
+ const Gesture *g;
|
||||||
+ unsigned int motion;
|
+ unsigned int motion;
|
||||||
+ unsigned int adx = (int)round(fabs(swipe_dx));
|
+ unsigned int adx = ROUND(fabs(swipe_dx));
|
||||||
+ unsigned int ady = (int)round(fabs(swipe_dy));
|
+ unsigned int ady = ROUND(fabs(swipe_dy));
|
||||||
+ int handled = 0;
|
+ int handled = 0;
|
||||||
+
|
+
|
||||||
+ if (event->cancelled) {
|
+ if (event->cancelled) {
|
||||||
@@ -166,4 +167,4 @@ index ded83e2..5d861e8 100644
|
|||||||
wlr_pointer_gestures_v1_send_swipe_end(
|
wlr_pointer_gestures_v1_send_swipe_end(
|
||||||
pointer_gestures,
|
pointer_gestures,
|
||||||
--
|
--
|
||||||
2.45.1
|
2.43.2
|
||||||
+22
-28
@@ -1,6 +1,6 @@
|
|||||||
From a102d5220bbfcd74e345011ca0ccf908a9f6668b Mon Sep 17 00:00:00 2001
|
From da92f84aa261051b410a0ffcfc80b4d6c8c7dfae Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
<leohdz172@proton.me>
|
<leohdz172@protonmail.com>
|
||||||
Date: Sun, 10 Apr 2022 22:38:53 -0500
|
Date: Sun, 10 Apr 2022 22:38:53 -0500
|
||||||
Subject: [PATCH] hide-behind-fullscreen
|
Subject: [PATCH] hide-behind-fullscreen
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
@@ -10,64 +10,58 @@ Content-Transfer-Encoding: 8bit
|
|||||||
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
---
|
---
|
||||||
config.def.h | 2 +-
|
config.def.h | 2 +-
|
||||||
dwl.c | 24 +++++++++++++++++++++++-
|
dwl.c | 18 +++++++++++++++++-
|
||||||
2 files changed, 24 insertions(+), 2 deletions(-)
|
2 files changed, 18 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171d..1d5a4c84 100644
|
index a8ed61d..b219c0d 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -12,7 +12,7 @@ static const float bordercolor[] = COLOR(0x444444ff);
|
@@ -12,7 +12,7 @@ static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = COLOR(0x005577ff);
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
-static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
-static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
||||||
+static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 0.0f}; /* You can also use glsl colors */
|
+static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0}; /* You can also use glsl colors */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 9021e442..111be796 100644
|
index 10d5a5b..0b8d03a 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -480,7 +480,9 @@ applyrules(Client *c)
|
@@ -455,7 +455,9 @@ applyrules(Client *c)
|
||||||
void
|
void
|
||||||
arrange(Monitor *m)
|
arrange(Monitor *m)
|
||||||
{
|
{
|
||||||
- Client *c;
|
- Client *c;
|
||||||
+ LayerSurface *l;
|
+ LayerSurface *l;
|
||||||
+ Client *c, *sel = focustop(m);
|
+ Client *c, *sel = focustop(selmon);
|
||||||
+ int i;
|
+ int i;
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->mon == m) {
|
||||||
|
wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m));
|
||||||
|
@@ -468,6 +470,20 @@ arrange(Monitor *m)
|
||||||
|
|
||||||
if (!m->wlr_output->enabled)
|
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
||||||
return;
|
|
||||||
@@ -511,6 +513,26 @@ arrange(Monitor *m)
|
|
||||||
: c->scene->node.parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
|
+ if (sel && sel->isfullscreen && VISIBLEON(sel, m)) {
|
||||||
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
|
+ for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--)
|
||||||
+ wl_list_for_each(l, &sel->mon->layers[i], link)
|
+ wl_list_for_each(l, &sel->mon->layers[i], link)
|
||||||
+ wlr_scene_node_set_enabled(&l->scene->node, 0);
|
+ wlr_scene_node_set_enabled(&l->scene->node, 0);
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
+ wl_list_for_each(c, &clients, link) {
|
+ wl_list_for_each(c, &clients, link)
|
||||||
+ if (c->mon != m)
|
|
||||||
+ continue;
|
|
||||||
+ wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
|
+ wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel)
|
||||||
+ || !sel->isfullscreen);
|
+ || !sel->isfullscreen);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m)))
|
||||||
+ if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) {
|
+ for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--)
|
||||||
+ for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) {
|
|
||||||
+ wl_list_for_each(l, &m->layers[i], link)
|
+ wl_list_for_each(l, &m->layers[i], link)
|
||||||
+ wlr_scene_node_set_enabled(&l->scene->node, 1);
|
+ wlr_scene_node_set_enabled(&l->scene->node, 1);
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
if (m->lt[m->sellt]->arrange)
|
if (m->lt[m->sellt]->arrange)
|
||||||
m->lt[m->sellt]->arrange(m);
|
m->lt[m->sellt]->arrange(m);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0);
|
||||||
--
|
--
|
||||||
2.46.0
|
2.43.0
|
||||||
|
|
||||||
+43
-47
@@ -1,4 +1,4 @@
|
|||||||
From b6eb491465e7d7023c0fd127a20507855f985731 Mon Sep 17 00:00:00 2001
|
From 1ba8580b2596c14b9305f1e7cb8d88f54367af59 Mon Sep 17 00:00:00 2001
|
||||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
<leohdz172@proton.me>
|
<leohdz172@proton.me>
|
||||||
Date: Sat, 8 Jul 2023 17:25:16 -0600
|
Date: Sat, 8 Jul 2023 17:25:16 -0600
|
||||||
@@ -9,27 +9,26 @@ Content-Transfer-Encoding: 8bit
|
|||||||
|
|
||||||
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
---
|
---
|
||||||
dwl.c | 87 +++++++++++++++++++++++++++++++++++++----------------------
|
dwl.c | 84 ++++++++++++++++++++++++++++++++++++-----------------------
|
||||||
1 file changed, 55 insertions(+), 32 deletions(-)
|
1 file changed, 52 insertions(+), 32 deletions(-)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 9021e442..d44f97de 100644
|
index 10d5a5b..07659ea 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -289,10 +289,11 @@ static Monitor *dirtomon(enum wlr_direction dir);
|
@@ -267,9 +267,10 @@ static Monitor *dirtomon(enum wlr_direction dir);
|
||||||
static void focusclient(Client *c, int lift);
|
static void focusclient(Client *c, int lift);
|
||||||
static void focusmon(const Arg *arg);
|
static void focusmon(const Arg *arg);
|
||||||
static void focusstack(const Arg *arg);
|
static void focusstack(const Arg *arg);
|
||||||
-static Client *focustop(Monitor *m);
|
-static Client *focustop(Monitor *m);
|
||||||
+static Client *focustop(Monitor *m, int onlytiled);
|
+static Client *focustop(Monitor *m, int onlytiled);
|
||||||
static void fullscreennotify(struct wl_listener *listener, void *data);
|
static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||||
static void gpureset(struct wl_listener *listener, void *data);
|
|
||||||
static void handlesig(int signo);
|
static void handlesig(int signo);
|
||||||
+static void hidebehindmonocle(Monitor *m);
|
+static void hidebehindmonocle(Monitor *m);
|
||||||
static void incnmaster(const Arg *arg);
|
static void incnmaster(const Arg *arg);
|
||||||
static void inputdevice(struct wl_listener *listener, void *data);
|
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_keysym_t sym);
|
||||||
@@ -493,7 +494,7 @@ arrange(Monitor *m)
|
@@ -464,7 +465,7 @@ arrange(Monitor *m)
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
|
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
|
||||||
@@ -38,7 +37,7 @@ index 9021e442..d44f97de 100644
|
|||||||
|
|
||||||
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
||||||
|
|
||||||
@@ -744,7 +745,7 @@ closemon(Monitor *m)
|
@@ -700,7 +701,7 @@ closemon(Monitor *m)
|
||||||
if (c->mon == m)
|
if (c->mon == m)
|
||||||
setmon(c, selmon, c->tags);
|
setmon(c, selmon, c->tags);
|
||||||
}
|
}
|
||||||
@@ -47,25 +46,25 @@ index 9021e442..d44f97de 100644
|
|||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1181,7 +1182,7 @@ void
|
@@ -1030,7 +1031,7 @@ void
|
||||||
destroydragicon(struct wl_listener *listener, void *data)
|
destroydragicon(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
/* Focus enter isn't sent during drag, so refocus the focused node. */
|
/* Focus enter isn't sent during drag, so refocus the focused node. */
|
||||||
- focusclient(focustop(selmon), 1);
|
- focusclient(focustop(selmon), 1);
|
||||||
+ focusclient(focustop(selmon, 0), 1);
|
+ focusclient(focustop(selmon, 0), 1);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1216,7 +1217,7 @@ destroylock(SessionLock *lock, int unlock)
|
@@ -1066,7 +1067,7 @@ destroylock(SessionLock *lock, int unlock)
|
||||||
|
|
||||||
wlr_scene_node_set_enabled(&locked_bg->node, 0);
|
wlr_scene_node_set_enabled(&locked_bg->node, 0);
|
||||||
|
|
||||||
- focusclient(focustop(selmon), 0);
|
- focusclient(focustop(selmon), 0);
|
||||||
+ focusclient(focustop(selmon, 0), 0);
|
+ focusclient(focustop(selmon, 0), 0);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0);
|
||||||
|
|
||||||
destroy:
|
destroy:
|
||||||
@@ -1245,7 +1246,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
|
@@ -1095,7 +1096,7 @@ destroylocksurface(struct wl_listener *listener, void *data)
|
||||||
surface = wl_container_of(cur_lock->surfaces.next, surface, link);
|
surface = wl_container_of(cur_lock->surfaces.next, surface, link);
|
||||||
client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
|
client_notify_enter(surface->surface, wlr_seat_get_keyboard(seat));
|
||||||
} else if (!locked) {
|
} else if (!locked) {
|
||||||
@@ -74,15 +73,15 @@ index 9021e442..d44f97de 100644
|
|||||||
} else {
|
} else {
|
||||||
wlr_seat_keyboard_clear_focus(seat);
|
wlr_seat_keyboard_clear_focus(seat);
|
||||||
}
|
}
|
||||||
@@ -1363,6 +1364,7 @@ focusclient(Client *c, int lift)
|
@@ -1186,6 +1187,7 @@ focusclient(Client *c, int lift)
|
||||||
wl_list_insert(&fstack, &c->flink);
|
wl_list_insert(&fstack, &c->flink);
|
||||||
selmon = c->mon;
|
selmon = c->mon;
|
||||||
c->isurgent = 0;
|
c->isurgent = 0;
|
||||||
+ hidebehindmonocle(c->mon);
|
+ hidebehindmonocle(c->mon);
|
||||||
|
client_restack_surface(c);
|
||||||
|
|
||||||
/* Don't change border color if there is an exclusive focus or we are
|
/* Don't change border color if there is an exclusive focus or we are
|
||||||
* handling a drag operation */
|
@@ -1240,14 +1242,14 @@ focusmon(const Arg *arg)
|
||||||
@@ -1416,14 +1418,14 @@ focusmon(const Arg *arg)
|
|
||||||
selmon = dirtomon(arg->i);
|
selmon = dirtomon(arg->i);
|
||||||
while (!selmon->wlr_output->enabled && i++ < nmons);
|
while (!selmon->wlr_output->enabled && i++ < nmons);
|
||||||
}
|
}
|
||||||
@@ -96,10 +95,10 @@ index 9021e442..d44f97de 100644
|
|||||||
/* Focus the next or previous client (in tiling order) on selmon */
|
/* Focus the next or previous client (in tiling order) on selmon */
|
||||||
- Client *c, *sel = focustop(selmon);
|
- Client *c, *sel = focustop(selmon);
|
||||||
+ Client *c, *sel = focustop(selmon, 0);
|
+ Client *c, *sel = focustop(selmon, 0);
|
||||||
if (!sel || (sel->isfullscreen && !client_has_children(sel)))
|
if (!sel || sel->isfullscreen)
|
||||||
return;
|
return;
|
||||||
if (arg->i > 0) {
|
if (arg->i > 0) {
|
||||||
@@ -1449,12 +1451,15 @@ focusstack(const Arg *arg)
|
@@ -1273,12 +1275,15 @@ focusstack(const Arg *arg)
|
||||||
* will focus the topmost client of this mon, when actually will
|
* will focus the topmost client of this mon, when actually will
|
||||||
* only return that client */
|
* only return that client */
|
||||||
Client *
|
Client *
|
||||||
@@ -117,7 +116,7 @@ index 9021e442..d44f97de 100644
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1511,6 +1516,25 @@ handlesig(int signo)
|
@@ -1311,6 +1316,22 @@ handlesig(int signo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,11 +125,8 @@ index 9021e442..d44f97de 100644
|
|||||||
+{
|
+{
|
||||||
+ Client *c;
|
+ Client *c;
|
||||||
+ if (m && m->lt[m->sellt]->arrange == monocle) {
|
+ if (m && m->lt[m->sellt]->arrange == monocle) {
|
||||||
+ wl_list_for_each(c, &clients, link) {
|
+ wl_list_for_each(c, &clients, link)
|
||||||
+ if (c->mon != m)
|
|
||||||
+ continue;
|
|
||||||
+ wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
|
+ wlr_scene_node_set_enabled(&c->scene->node, VISIBLEON(c, m) && c->isfloating);
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
+ c = NULL;
|
+ c = NULL;
|
||||||
+
|
+
|
||||||
@@ -143,7 +139,7 @@ index 9021e442..d44f97de 100644
|
|||||||
void
|
void
|
||||||
incnmaster(const Arg *arg)
|
incnmaster(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -1649,7 +1673,7 @@ keyrepeat(void *data)
|
@@ -1449,7 +1470,7 @@ keyrepeat(void *data)
|
||||||
void
|
void
|
||||||
killclient(const Arg *arg)
|
killclient(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -152,7 +148,7 @@ index 9021e442..d44f97de 100644
|
|||||||
if (sel)
|
if (sel)
|
||||||
client_send_close(sel);
|
client_send_close(sel);
|
||||||
}
|
}
|
||||||
@@ -1778,8 +1802,7 @@ monocle(Monitor *m)
|
@@ -1584,8 +1605,7 @@ monocle(Monitor *m)
|
||||||
}
|
}
|
||||||
if (n)
|
if (n)
|
||||||
snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
|
snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
|
||||||
@@ -162,16 +158,16 @@ index 9021e442..d44f97de 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2046,7 +2069,7 @@ printstatus(void)
|
@@ -1813,7 +1833,7 @@ printstatus(void)
|
||||||
if (c->isurgent)
|
if (c->isurgent)
|
||||||
urg |= c->tags;
|
urg |= c->tags;
|
||||||
}
|
}
|
||||||
- if ((c = focustop(m))) {
|
- if ((c = focustop(m))) {
|
||||||
+ if ((c = focustop(m, 0))) {
|
+ if ((c = focustop(m, 0))) {
|
||||||
printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
|
title = client_get_title(c);
|
||||||
printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
|
appid = client_get_appid(c);
|
||||||
printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
|
||||||
@@ -2359,7 +2382,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
@@ -2129,7 +2149,7 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
|
||||||
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
||||||
setfloating(c, c->isfloating);
|
setfloating(c, c->isfloating);
|
||||||
}
|
}
|
||||||
@@ -180,7 +176,7 @@ index 9021e442..d44f97de 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2630,12 +2653,12 @@ startdrag(struct wl_listener *listener, void *data)
|
@@ -2431,12 +2451,12 @@ startdrag(struct wl_listener *listener, void *data)
|
||||||
void
|
void
|
||||||
tag(const Arg *arg)
|
tag(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -195,7 +191,7 @@ index 9021e442..d44f97de 100644
|
|||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
@@ -2643,7 +2666,7 @@ tag(const Arg *arg)
|
@@ -2444,7 +2464,7 @@ tag(const Arg *arg)
|
||||||
void
|
void
|
||||||
tagmon(const Arg *arg)
|
tagmon(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -204,7 +200,7 @@ index 9021e442..d44f97de 100644
|
|||||||
if (sel)
|
if (sel)
|
||||||
setmon(sel, dirtomon(arg->i), 0);
|
setmon(sel, dirtomon(arg->i), 0);
|
||||||
}
|
}
|
||||||
@@ -2685,7 +2708,7 @@ tile(Monitor *m)
|
@@ -2485,7 +2505,7 @@ tile(Monitor *m)
|
||||||
void
|
void
|
||||||
togglefloating(const Arg *arg)
|
togglefloating(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -213,7 +209,7 @@ index 9021e442..d44f97de 100644
|
|||||||
/* return if fullscreen */
|
/* return if fullscreen */
|
||||||
if (sel && !sel->isfullscreen)
|
if (sel && !sel->isfullscreen)
|
||||||
setfloating(sel, !sel->isfloating);
|
setfloating(sel, !sel->isfloating);
|
||||||
@@ -2694,7 +2717,7 @@ togglefloating(const Arg *arg)
|
@@ -2494,7 +2514,7 @@ togglefloating(const Arg *arg)
|
||||||
void
|
void
|
||||||
togglefullscreen(const Arg *arg)
|
togglefullscreen(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -222,7 +218,7 @@ index 9021e442..d44f97de 100644
|
|||||||
if (sel)
|
if (sel)
|
||||||
setfullscreen(sel, !sel->isfullscreen);
|
setfullscreen(sel, !sel->isfullscreen);
|
||||||
}
|
}
|
||||||
@@ -2703,12 +2726,12 @@ void
|
@@ -2503,12 +2523,12 @@ void
|
||||||
toggletag(const Arg *arg)
|
toggletag(const Arg *arg)
|
||||||
{
|
{
|
||||||
uint32_t newtags;
|
uint32_t newtags;
|
||||||
@@ -237,7 +233,7 @@ index 9021e442..d44f97de 100644
|
|||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
@@ -2721,7 +2744,7 @@ toggleview(const Arg *arg)
|
@@ -2521,7 +2541,7 @@ toggleview(const Arg *arg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
selmon->tagset[selmon->seltags] = newtagset;
|
selmon->tagset[selmon->seltags] = newtagset;
|
||||||
@@ -246,16 +242,16 @@ index 9021e442..d44f97de 100644
|
|||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
@@ -2745,7 +2768,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
|
@@ -2545,7 +2565,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
|
||||||
if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
|
if (l->layer_surface->output && (l->mon = l->layer_surface->output->data))
|
||||||
arrangelayers(l->mon);
|
arrangelayers(l->mon);
|
||||||
if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
|
if (l->layer_surface->surface == seat->keyboard_state.focused_surface)
|
||||||
- focusclient(focustop(selmon), 1);
|
- focusclient(focustop(selmon), 1);
|
||||||
+ focusclient(focustop(selmon, 0), 1);
|
+ focusclient(focustop(selmon, 0), 1);
|
||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2762,7 +2785,7 @@ unmapnotify(struct wl_listener *listener, void *data)
|
@@ -2562,7 +2582,7 @@ unmapnotify(struct wl_listener *listener, void *data)
|
||||||
if (client_is_unmanaged(c)) {
|
if (client_is_unmanaged(c)) {
|
||||||
if (c == exclusive_focus) {
|
if (c == exclusive_focus) {
|
||||||
exclusive_focus = NULL;
|
exclusive_focus = NULL;
|
||||||
@@ -264,7 +260,7 @@ index 9021e442..d44f97de 100644
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wl_list_remove(&c->link);
|
wl_list_remove(&c->link);
|
||||||
@@ -2843,7 +2866,7 @@ updatemons(struct wl_listener *listener, void *data)
|
@@ -2643,7 +2663,7 @@ updatemons(struct wl_listener *listener, void *data)
|
||||||
/* Don't move clients to the left output when plugging monitors */
|
/* Don't move clients to the left output when plugging monitors */
|
||||||
arrange(m);
|
arrange(m);
|
||||||
/* make sure fullscreen clients have the right size */
|
/* make sure fullscreen clients have the right size */
|
||||||
@@ -273,7 +269,7 @@ index 9021e442..d44f97de 100644
|
|||||||
resize(c, m->m, 0);
|
resize(c, m->m, 0);
|
||||||
|
|
||||||
/* Try to re-set the gamma LUT when updating monitors,
|
/* Try to re-set the gamma LUT when updating monitors,
|
||||||
@@ -2863,7 +2886,7 @@ updatemons(struct wl_listener *listener, void *data)
|
@@ -2659,7 +2679,7 @@ updatemons(struct wl_listener *listener, void *data)
|
||||||
if (!c->mon && client_surface(c)->mapped)
|
if (!c->mon && client_surface(c)->mapped)
|
||||||
setmon(c, selmon, c->tags);
|
setmon(c, selmon, c->tags);
|
||||||
}
|
}
|
||||||
@@ -282,7 +278,7 @@ index 9021e442..d44f97de 100644
|
|||||||
if (selmon->lock_surface) {
|
if (selmon->lock_surface) {
|
||||||
client_notify_enter(selmon->lock_surface->surface,
|
client_notify_enter(selmon->lock_surface->surface,
|
||||||
wlr_seat_get_keyboard(seat));
|
wlr_seat_get_keyboard(seat));
|
||||||
@@ -2885,7 +2908,7 @@ void
|
@@ -2681,7 +2701,7 @@ void
|
||||||
updatetitle(struct wl_listener *listener, void *data)
|
updatetitle(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
Client *c = wl_container_of(listener, c, set_title);
|
Client *c = wl_container_of(listener, c, set_title);
|
||||||
@@ -291,7 +287,7 @@ index 9021e442..d44f97de 100644
|
|||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2895,7 +2918,7 @@ urgent(struct wl_listener *listener, void *data)
|
@@ -2691,7 +2711,7 @@ urgent(struct wl_listener *listener, void *data)
|
||||||
struct wlr_xdg_activation_v1_request_activate_event *event = data;
|
struct wlr_xdg_activation_v1_request_activate_event *event = data;
|
||||||
Client *c = NULL;
|
Client *c = NULL;
|
||||||
toplevel_from_wlr_surface(event->surface, &c, NULL);
|
toplevel_from_wlr_surface(event->surface, &c, NULL);
|
||||||
@@ -300,7 +296,7 @@ index 9021e442..d44f97de 100644
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
c->isurgent = 1;
|
c->isurgent = 1;
|
||||||
@@ -2913,7 +2936,7 @@ view(const Arg *arg)
|
@@ -2709,7 +2729,7 @@ view(const Arg *arg)
|
||||||
selmon->seltags ^= 1; /* toggle sel tagset */
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
if (arg->ui & TAGMASK)
|
if (arg->ui & TAGMASK)
|
||||||
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
|
||||||
@@ -309,7 +305,7 @@ index 9021e442..d44f97de 100644
|
|||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
printstatus();
|
printstatus();
|
||||||
}
|
}
|
||||||
@@ -2984,7 +3007,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
|
@@ -2767,7 +2787,7 @@ xytonode(double x, double y, struct wlr_surface **psurface,
|
||||||
void
|
void
|
||||||
zoom(const Arg *arg)
|
zoom(const Arg *arg)
|
||||||
{
|
{
|
||||||
@@ -318,7 +314,7 @@ index 9021e442..d44f97de 100644
|
|||||||
|
|
||||||
if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
|
if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating)
|
||||||
return;
|
return;
|
||||||
@@ -3108,7 +3131,7 @@ sethints(struct wl_listener *listener, void *data)
|
@@ -2880,7 +2900,7 @@ sethints(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
Client *c = wl_container_of(listener, c, set_hints);
|
Client *c = wl_container_of(listener, c, set_hints);
|
||||||
struct wlr_surface *surface = client_surface(c);
|
struct wlr_surface *surface = client_surface(c);
|
||||||
@@ -328,5 +324,5 @@ index 9021e442..d44f97de 100644
|
|||||||
|
|
||||||
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
|
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
|
||||||
--
|
--
|
||||||
2.46.0
|
2.43.0
|
||||||
|
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
From 6337cf36554eda98f3d160ef4fdd12eb042f4120 Mon Sep 17 00:00:00 2001
|
||||||
|
From: sewn <sewn@disroot.org>
|
||||||
|
Date: Sun, 14 Apr 2024 07:58:53 +0300
|
||||||
|
Subject: [PATCH] port hide vacant tags patch
|
||||||
|
|
||||||
|
---
|
||||||
|
dwl.c | 25 ++++++++++++++++---------
|
||||||
|
1 file changed, 16 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 54273ae..7db6273 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -651,7 +651,7 @@ void buffer_end_data_ptr_access(struct wlr_buffer *buffer) {
|
||||||
|
void
|
||||||
|
buttonpress(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
- unsigned int i = 0, x = 0;
|
||||||
|
+ unsigned int i = 0, x = 0, occ = 0;
|
||||||
|
unsigned int click;
|
||||||
|
struct wlr_pointer_button_event *event = data;
|
||||||
|
struct wlr_keyboard *keyboard;
|
||||||
|
@@ -672,9 +672,17 @@ buttonpress(struct wl_listener *listener, void *data)
|
||||||
|
if ((node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
|
||||||
|
(buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
|
||||||
|
x = selmon->m.x;
|
||||||
|
- do
|
||||||
|
- x += TEXTW(tags[i]);
|
||||||
|
- while (cursor->x >= x && ++i < LENGTH(tags));
|
||||||
|
+ wl_list_for_each(c, &clients, link) {
|
||||||
|
+ if (c->mon != selmon)
|
||||||
|
+ continue;
|
||||||
|
+ occ |= c->tags == TAGMASK ? 0 : c->tags;
|
||||||
|
+ }
|
||||||
|
+ do {
|
||||||
|
+ /* Do not reserve space for vacant tags */
|
||||||
|
+ if (!(occ & 1 << i || selmon->tagset[selmon->seltags] & 1 << i))
|
||||||
|
+ continue;
|
||||||
|
+ x += TEXTW(tags[i]);
|
||||||
|
+ } while (cursor->x >= x && ++i < LENGTH(tags));
|
||||||
|
if (i < LENGTH(tags)) {
|
||||||
|
click = ClkTagBar;
|
||||||
|
arg.ui = 1 << i;
|
||||||
|
@@ -1379,13 +1387,16 @@ drawbar(Monitor *mon)
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->mon != mon)
|
||||||
|
continue;
|
||||||
|
- occ |= c->tags;
|
||||||
|
+ occ |= c->tags == TAGMASK ? 0 : c->tags;
|
||||||
|
if (c->isurgent)
|
||||||
|
urg |= c->tags;
|
||||||
|
}
|
||||||
|
c = focustop(mon);
|
||||||
|
x = 0;
|
||||||
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
|
+ /* Do not draw vacant tags */
|
||||||
|
+ if(!(occ & 1 << i || mon->tagset[mon->seltags] & 1 << i))
|
||||||
|
+ continue;
|
||||||
|
w = TEXTW(tags[i]);
|
||||||
|
sel = mon->tagset[mon->seltags] & 1 << i;
|
||||||
|
|
||||||
|
@@ -1393,10 +1404,6 @@ drawbar(Monitor *mon)
|
||||||
|
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg),
|
||||||
|
urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
|
||||||
|
|
||||||
|
- if (occ & 1 << i)
|
||||||
|
- drwl_rect(pix, x + boxs, boxs, boxw, boxw, sel,
|
||||||
|
- urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg));
|
||||||
|
-
|
||||||
|
x += w;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.44.0
|
||||||
|
|
||||||
@@ -1,40 +1,37 @@
|
|||||||
From 6c6d655b68770ce82a24fde9b58c4d97b672553a Mon Sep 17 00:00:00 2001
|
From 5bbb9d70ab0a8322d1556ac0983eb3140b1c5dcd Mon Sep 17 00:00:00 2001
|
||||||
From: choc <notchoc@proton.me>
|
From: choc <notchoc@proton.me>
|
||||||
Date: Mon, 23 Oct 2023 10:35:17 +0800
|
Date: Mon, 23 Oct 2023 10:35:17 +0800
|
||||||
Subject: [PATCH] implement dwl-ipc-unstable-v2
|
Subject: [PATCH] implement dwl-ipc-unstable-v2
|
||||||
https://codeberg.org/dwl/dwl-patches/wiki/ipc
|
https://codeberg.org/dwl/dwl-patches/wiki/ipc
|
||||||
|
|
||||||
---
|
---
|
||||||
Makefile | 14 +-
|
Makefile | 13 +-
|
||||||
config.def.h | 1 +
|
config.def.h | 1 +
|
||||||
dwl.c | 257 ++++++++++++++++++++++++++----
|
dwl.c | 257 ++++++++++++++++++++++++++----
|
||||||
protocols/dwl-ipc-unstable-v2.xml | 181 +++++++++++++++++++++
|
protocols/dwl-ipc-unstable-v2.xml | 181 +++++++++++++++++++++
|
||||||
4 files changed, 419 insertions(+), 34 deletions(-)
|
4 files changed, 415 insertions(+), 37 deletions(-)
|
||||||
create mode 100644 protocols/dwl-ipc-unstable-v2.xml
|
create mode 100644 protocols/dwl-ipc-unstable-v2.xml
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
diff --git a/Makefile b/Makefile
|
||||||
index 8db7409..a79a080 100644
|
index a67fdd3..2b45b2c 100644
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -17,12 +17,14 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEV
|
@@ -14,10 +14,11 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
|
||||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS)
|
||||||
|
|
||||||
all: dwl
|
all: dwl
|
||||||
-dwl: dwl.o util.o
|
-dwl: dwl.o util.o
|
||||||
- $(CC) dwl.o util.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
- $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
||||||
|
-dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h
|
||||||
+dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
|
+dwl: dwl.o util.o dwl-ipc-unstable-v2-protocol.o
|
||||||
+ $(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
|
+ $(CC) dwl.o util.o dwl-ipc-unstable-v2-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@
|
||||||
dwl.o: dwl.c client.h config.h config.mk cursor-shape-v1-protocol.h \
|
+dwl.o: dwl.c config.mk config.h client.h cursor-shape-v1-protocol.h pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h xdg-shell-protocol.h dwl-ipc-unstable-v2-protocol.h
|
||||||
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
|
|
||||||
- wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h
|
|
||||||
+ wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h \
|
|
||||||
+ dwl-ipc-unstable-v2-protocol.h
|
|
||||||
util.o: util.c util.h
|
util.o: util.c util.h
|
||||||
+dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.c dwl-ipc-unstable-v2-protocol.h
|
+dwl-ipc-unstable-v2-protocol.o: dwl-ipc-unstable-v2-protocol.c dwl-ipc-unstable-v2-protocol.h
|
||||||
|
|
||||||
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
# wayland-scanner is a tool which generates C headers and rigging for Wayland
|
||||||
# protocols, which are specified in XML. wlroots requires you to rig these up
|
# protocols, which are specified in XML. wlroots requires you to rig these up
|
||||||
@@ -45,6 +47,12 @@ wlr-output-power-management-unstable-v1-protocol.h:
|
@@ -37,6 +38,12 @@ wlr-layer-shell-unstable-v1-protocol.h:
|
||||||
xdg-shell-protocol.h:
|
xdg-shell-protocol.h:
|
||||||
$(WAYLAND_SCANNER) server-header \
|
$(WAYLAND_SCANNER) server-header \
|
||||||
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
|
||||||
@@ -48,10 +45,10 @@ index 8db7409..a79a080 100644
|
|||||||
config.h:
|
config.h:
|
||||||
cp config.def.h $@
|
cp config.def.h $@
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..1593033 100644
|
index 9009517..3467fed 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -127,6 +127,7 @@ static const Key keys[] = {
|
@@ -122,6 +122,7 @@ static const Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
@@ -60,10 +57,10 @@ index 22d2171..1593033 100644
|
|||||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 8a587d1..7a4949b 100644
|
index d508d79..5f8af37 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -68,6 +68,7 @@
|
@@ -64,6 +64,7 @@
|
||||||
#include <xcb/xcb_icccm.h>
|
#include <xcb/xcb_icccm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -71,7 +68,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
/* macros */
|
/* macros */
|
||||||
@@ -144,6 +145,12 @@ typedef struct {
|
@@ -141,6 +142,12 @@ typedef struct {
|
||||||
uint32_t resize; /* configure serial of a pending resize */
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
} Client;
|
} Client;
|
||||||
|
|
||||||
@@ -84,7 +81,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t mod;
|
uint32_t mod;
|
||||||
xkb_keysym_t keysym;
|
xkb_keysym_t keysym;
|
||||||
@@ -189,6 +196,7 @@ typedef struct {
|
@@ -186,6 +193,7 @@ typedef struct {
|
||||||
|
|
||||||
struct Monitor {
|
struct Monitor {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
@@ -92,9 +89,9 @@ index 8a587d1..7a4949b 100644
|
|||||||
struct wlr_output *wlr_output;
|
struct wlr_output *wlr_output;
|
||||||
struct wlr_scene_output *scene_output;
|
struct wlr_scene_output *scene_output;
|
||||||
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
|
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
|
||||||
@@ -286,6 +294,17 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
|
@@ -278,6 +286,17 @@ static void destroypointerconstraint(struct wl_listener *listener, void *data);
|
||||||
|
static void destroysessionlock(struct wl_listener *listener, void *data);
|
||||||
static void destroysessionmgr(struct wl_listener *listener, void *data);
|
static void destroysessionmgr(struct wl_listener *listener, void *data);
|
||||||
static void destroykeyboardgroup(struct wl_listener *listener, void *data);
|
|
||||||
static Monitor *dirtomon(enum wlr_direction dir);
|
static Monitor *dirtomon(enum wlr_direction dir);
|
||||||
+static void dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id);
|
+static void dwl_ipc_manager_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id);
|
||||||
+static void dwl_ipc_manager_destroy(struct wl_resource *resource);
|
+static void dwl_ipc_manager_destroy(struct wl_resource *resource);
|
||||||
@@ -110,7 +107,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
static void focusclient(Client *c, int lift);
|
static void focusclient(Client *c, int lift);
|
||||||
static void focusmon(const Arg *arg);
|
static void focusmon(const Arg *arg);
|
||||||
static void focusstack(const Arg *arg);
|
static void focusstack(const Arg *arg);
|
||||||
@@ -338,6 +357,7 @@ static void startdrag(struct wl_listener *listener, void *data);
|
@@ -330,6 +349,7 @@ static void startdrag(struct wl_listener *listener, void *data);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
static void tagmon(const Arg *arg);
|
static void tagmon(const Arg *arg);
|
||||||
static void tile(Monitor *m);
|
static void tile(Monitor *m);
|
||||||
@@ -118,7 +115,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
static void togglefloating(const Arg *arg);
|
static void togglefloating(const Arg *arg);
|
||||||
static void togglefullscreen(const Arg *arg);
|
static void togglefullscreen(const Arg *arg);
|
||||||
static void toggletag(const Arg *arg);
|
static void toggletag(const Arg *arg);
|
||||||
@@ -411,6 +431,9 @@ static struct wlr_box sgeom;
|
@@ -405,6 +425,9 @@ static struct wlr_box sgeom;
|
||||||
static struct wl_list mons;
|
static struct wl_list mons;
|
||||||
static Monitor *selmon;
|
static Monitor *selmon;
|
||||||
|
|
||||||
@@ -128,7 +125,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
static void activatex11(struct wl_listener *listener, void *data);
|
static void activatex11(struct wl_listener *listener, void *data);
|
||||||
static void associatex11(struct wl_listener *listener, void *data);
|
static void associatex11(struct wl_listener *listener, void *data);
|
||||||
@@ -703,6 +726,10 @@ cleanupmon(struct wl_listener *listener, void *data)
|
@@ -684,6 +707,10 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||||
LayerSurface *l, *tmp;
|
LayerSurface *l, *tmp;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@@ -139,7 +136,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
/* m->layers[i] are intentionally not unlinked */
|
/* m->layers[i] are intentionally not unlinked */
|
||||||
for (i = 0; i < LENGTH(m->layers); i++) {
|
for (i = 0; i < LENGTH(m->layers); i++) {
|
||||||
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
|
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
|
||||||
@@ -983,6 +1010,8 @@ createmon(struct wl_listener *listener, void *data)
|
@@ -876,6 +903,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||||
m = wlr_output->data = ecalloc(1, sizeof(*m));
|
m = wlr_output->data = ecalloc(1, sizeof(*m));
|
||||||
m->wlr_output = wlr_output;
|
m->wlr_output = wlr_output;
|
||||||
|
|
||||||
@@ -148,7 +145,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
for (i = 0; i < LENGTH(m->layers); i++)
|
for (i = 0; i < LENGTH(m->layers); i++)
|
||||||
wl_list_init(&m->layers[i]);
|
wl_list_init(&m->layers[i]);
|
||||||
|
|
||||||
@@ -1334,6 +1363,192 @@ dirtomon(enum wlr_direction dir)
|
@@ -1233,6 +1262,190 @@ dirtomon(enum wlr_direction dir)
|
||||||
return selmon;
|
return selmon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,8 +244,8 @@ index 8a587d1..7a4949b 100644
|
|||||||
+ appid = focused ? client_get_appid(focused) : "";
|
+ appid = focused ? client_get_appid(focused) : "";
|
||||||
+
|
+
|
||||||
+ zdwl_ipc_output_v2_send_layout(ipc_output->resource, monitor->lt[monitor->sellt] - layouts);
|
+ zdwl_ipc_output_v2_send_layout(ipc_output->resource, monitor->lt[monitor->sellt] - layouts);
|
||||||
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title);
|
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title ? title : broken);
|
||||||
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid);
|
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid ? appid : broken);
|
||||||
+ zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, monitor->ltsymbol);
|
+ zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, monitor->ltsymbol);
|
||||||
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
|
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
|
||||||
+ zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, focused ? focused->isfullscreen : 0);
|
+ zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, focused ? focused->isfullscreen : 0);
|
||||||
@@ -281,8 +278,7 @@ index 8a587d1..7a4949b 100644
|
|||||||
+ return;
|
+ return;
|
||||||
+
|
+
|
||||||
+ selected_client->tags = newtags;
|
+ selected_client->tags = newtags;
|
||||||
+ if (selmon == monitor)
|
+ focusclient(focustop(selmon), 1);
|
||||||
+ focusclient(focustop(monitor), 1);
|
|
||||||
+ arrange(selmon);
|
+ arrange(selmon);
|
||||||
+ printstatus();
|
+ printstatus();
|
||||||
+}
|
+}
|
||||||
@@ -326,7 +322,6 @@ index 8a587d1..7a4949b 100644
|
|||||||
+ monitor->seltags ^= 1;
|
+ monitor->seltags ^= 1;
|
||||||
+
|
+
|
||||||
+ monitor->tagset[monitor->seltags] = newtags;
|
+ monitor->tagset[monitor->seltags] = newtags;
|
||||||
+ if (selmon == monitor)
|
|
||||||
+ focusclient(focustop(monitor), 1);
|
+ focusclient(focustop(monitor), 1);
|
||||||
+ arrange(monitor);
|
+ arrange(monitor);
|
||||||
+ printstatus();
|
+ printstatus();
|
||||||
@@ -341,12 +336,13 @@ index 8a587d1..7a4949b 100644
|
|||||||
void
|
void
|
||||||
focusclient(Client *c, int lift)
|
focusclient(Client *c, int lift)
|
||||||
{
|
{
|
||||||
@@ -2033,38 +2248,9 @@ void
|
@@ -1905,41 +2118,9 @@ void
|
||||||
printstatus(void)
|
printstatus(void)
|
||||||
{
|
{
|
||||||
Monitor *m = NULL;
|
Monitor *m = NULL;
|
||||||
- Client *c;
|
- Client *c;
|
||||||
- uint32_t occ, urg, sel;
|
- uint32_t occ, urg, sel;
|
||||||
|
- const char *appid, *title;
|
||||||
|
|
||||||
- wl_list_for_each(m, &mons, link) {
|
- wl_list_for_each(m, &mons, link) {
|
||||||
- occ = urg = 0;
|
- occ = urg = 0;
|
||||||
@@ -358,8 +354,10 @@ index 8a587d1..7a4949b 100644
|
|||||||
- urg |= c->tags;
|
- urg |= c->tags;
|
||||||
- }
|
- }
|
||||||
- if ((c = focustop(m))) {
|
- if ((c = focustop(m))) {
|
||||||
- printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
|
- title = client_get_title(c);
|
||||||
- printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
|
- appid = client_get_appid(c);
|
||||||
|
- printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
|
||||||
|
- printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
|
||||||
- printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
- printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
||||||
- printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
|
- printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
|
||||||
- sel = c->tags;
|
- sel = c->tags;
|
||||||
@@ -382,16 +380,15 @@ index 8a587d1..7a4949b 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2584,6 +2770,8 @@ setup(void)
|
@@ -2502,6 +2683,7 @@ setup(void)
|
||||||
LISTEN_STATIC(&output_mgr->events.apply, outputmgrapply);
|
|
||||||
LISTEN_STATIC(&output_mgr->events.test, outputmgrtest);
|
LISTEN_STATIC(&output_mgr->events.test, outputmgrtest);
|
||||||
|
|
||||||
|
wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
|
||||||
+ wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, dwl_ipc_manager_bind);
|
+ wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, dwl_ipc_manager_bind);
|
||||||
+
|
|
||||||
/* Make sure XWayland clients don't connect to the parent X server,
|
/* Make sure XWayland clients don't connect to the parent X server,
|
||||||
* e.g when running in the x11 backend or the wayland backend and the
|
* e.g when running in the x11 backend or the wayland backend and the
|
||||||
* compositor has Xwayland support */
|
@@ -2600,6 +2782,13 @@ tile(Monitor *m)
|
||||||
@@ -2681,6 +2869,13 @@ tile(Monitor *m)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,5 +590,5 @@ index 0000000..0a6e7e5
|
|||||||
+ </interface>
|
+ </interface>
|
||||||
+</protocol>
|
+</protocol>
|
||||||
--
|
--
|
||||||
2.43.0
|
2.44.0
|
||||||
|
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
From a0c758953fe0cbb20ea74d0acfa3e44b8173d12d Mon Sep 17 00:00:00 2001
|
||||||
|
From: ForzCross <forzcross@gmail.com>
|
||||||
|
Date: Sun, 21 Jan 2024 15:52:31 +0300
|
||||||
|
Subject: [PATCH] Add per client keyboard layout and status bar info
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 3 +++
|
||||||
|
dwl.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||||
|
2 files changed, 67 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 9009517..81bb10d 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -13,6 +13,9 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
|
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
||||||
|
+/* keyboard layout change notification for status bar */
|
||||||
|
+static const char kblayout_file[] = "/tmp/dwl-keymap";
|
||||||
|
+static const char *kblayout_cmd[] = {"pkill", "-RTMIN+3", "someblocks", NULL};
|
||||||
|
|
||||||
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
|
#define TAGCOUNT (9)
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index bf02a6d..17c8fa4 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -135,6 +135,7 @@ typedef struct {
|
||||||
|
uint32_t tags;
|
||||||
|
int isfloating, isurgent, isfullscreen;
|
||||||
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
|
+ xkb_layout_index_t layout_idx;
|
||||||
|
} Client;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
@@ -155,6 +156,7 @@ typedef struct {
|
||||||
|
|
||||||
|
struct wl_listener modifiers;
|
||||||
|
struct wl_listener key;
|
||||||
|
+ xkb_layout_index_t layout_idx;
|
||||||
|
} KeyboardGroup;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
@@ -273,6 +275,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||||
|
static void handlesig(int signo);
|
||||||
|
static void incnmaster(const Arg *arg);
|
||||||
|
static void inputdevice(struct wl_listener *listener, void *data);
|
||||||
|
+static void kblayoutnotify(KeyboardGroup *kb, int update);
|
||||||
|
static int keybinding(uint32_t mods, xkb_keysym_t sym);
|
||||||
|
static void keypress(struct wl_listener *listener, void *data);
|
||||||
|
static void keypressmod(struct wl_listener *listener, void *data);
|
||||||
|
@@ -385,6 +388,8 @@ static struct wlr_box sgeom;
|
||||||
|
static struct wl_list mons;
|
||||||
|
static Monitor *selmon;
|
||||||
|
|
||||||
|
+xkb_layout_index_t status_layout_idx = -1;
|
||||||
|
+
|
||||||
|
#ifdef XWAYLAND
|
||||||
|
static void activatex11(struct wl_listener *listener, void *data);
|
||||||
|
static void associatex11(struct wl_listener *listener, void *data);
|
||||||
|
@@ -772,6 +777,7 @@ createkeyboard(struct wlr_keyboard *keyboard)
|
||||||
|
|
||||||
|
/* Add the new keyboard to the group */
|
||||||
|
wlr_keyboard_group_add_keyboard(kb_group.wlr_group, keyboard);
|
||||||
|
+ kblayoutnotify(&kb_group, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
@@ -927,6 +933,7 @@ createnotify(struct wl_listener *listener, void *data)
|
||||||
|
struct wlr_xdg_surface *xdg_surface = data;
|
||||||
|
Client *c = NULL;
|
||||||
|
LayerSurface *l = NULL;
|
||||||
|
+ struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
|
||||||
|
|
||||||
|
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
|
||||||
|
struct wlr_xdg_popup *popup = xdg_surface->popup;
|
||||||
|
@@ -949,6 +956,9 @@ createnotify(struct wl_listener *listener, void *data)
|
||||||
|
c = xdg_surface->data = ecalloc(1, sizeof(*c));
|
||||||
|
c->surface.xdg = xdg_surface;
|
||||||
|
c->bw = borderpx;
|
||||||
|
+ c->layout_idx = kb
|
||||||
|
+ ? xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_EFFECTIVE)
|
||||||
|
+ : 0;
|
||||||
|
|
||||||
|
wlr_xdg_toplevel_set_wm_capabilities(xdg_surface->toplevel,
|
||||||
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
||||||
|
@@ -1165,6 +1175,9 @@ focusclient(Client *c, int lift)
|
||||||
|
int unused_lx, unused_ly, old_client_type;
|
||||||
|
Client *old_c = NULL;
|
||||||
|
LayerSurface *old_l = NULL;
|
||||||
|
+ xkb_mod_mask_t mdepr, mlatc, mlock;
|
||||||
|
+ xkb_layout_index_t ldepr, llatc, llock;
|
||||||
|
+ struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
|
||||||
|
|
||||||
|
if (locked)
|
||||||
|
return;
|
||||||
|
@@ -1217,6 +1230,17 @@ focusclient(Client *c, int lift)
|
||||||
|
}
|
||||||
|
printstatus();
|
||||||
|
|
||||||
|
+ /* Update keyboard layout */
|
||||||
|
+ if (kb) {
|
||||||
|
+ mdepr = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_DEPRESSED);
|
||||||
|
+ mlatc = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_LATCHED);
|
||||||
|
+ mlock = xkb_state_serialize_mods(kb->xkb_state, XKB_STATE_MODS_LOCKED);
|
||||||
|
+ ldepr = xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_DEPRESSED);
|
||||||
|
+ llatc = xkb_state_serialize_layout(kb->xkb_state, XKB_STATE_LAYOUT_LATCHED);
|
||||||
|
+ llock = c ? c->layout_idx : 0;
|
||||||
|
+ xkb_state_update_mask(kb->xkb_state, mdepr, mlatc, mlock, ldepr, llatc, llock);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (!c) {
|
||||||
|
/* With no client, all we have left is to clear focus */
|
||||||
|
wlr_seat_keyboard_notify_clear_focus(seat);
|
||||||
|
@@ -1227,7 +1251,7 @@ focusclient(Client *c, int lift)
|
||||||
|
motionnotify(0);
|
||||||
|
|
||||||
|
/* Have a client, so focus its top-level wlr_surface */
|
||||||
|
- client_notify_enter(client_surface(c), wlr_seat_get_keyboard(seat));
|
||||||
|
+ client_notify_enter(client_surface(c), kb);
|
||||||
|
|
||||||
|
/* Activate the new client */
|
||||||
|
client_activate_surface(client_surface(c), 1);
|
||||||
|
@@ -1352,6 +1376,41 @@ inputdevice(struct wl_listener *listener, void *data)
|
||||||
|
wlr_seat_set_capabilities(seat, caps);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+kblayoutnotify(KeyboardGroup *kb, int update)
|
||||||
|
+{
|
||||||
|
+ FILE *f;
|
||||||
|
+ Client *c;
|
||||||
|
+ xkb_layout_index_t old = kb->layout_idx;
|
||||||
|
+
|
||||||
|
+ if (update) {
|
||||||
|
+ kb->layout_idx = xkb_state_serialize_layout(kb->wlr_group->keyboard.xkb_state,
|
||||||
|
+ XKB_STATE_LAYOUT_EFFECTIVE);
|
||||||
|
+
|
||||||
|
+ // Update client layout
|
||||||
|
+ if (kb->layout_idx != old && (c = focustop(selmon)))
|
||||||
|
+ c->layout_idx = kb->layout_idx;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // If layout did not change, do nothing
|
||||||
|
+ if (status_layout_idx == kb->layout_idx)
|
||||||
|
+ return;
|
||||||
|
+ status_layout_idx = kb->layout_idx;
|
||||||
|
+
|
||||||
|
+ // Save current layout to kblayout_file
|
||||||
|
+ if (*kblayout_file && (f = fopen(kblayout_file, "w"))) {
|
||||||
|
+ fputs(xkb_keymap_layout_get_name(kb->wlr_group->keyboard.keymap,
|
||||||
|
+ kb->layout_idx), f);
|
||||||
|
+ fclose(f);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Run kblayout_cmd
|
||||||
|
+ if (kblayout_cmd[0] && fork() == 0) {
|
||||||
|
+ execvp(kblayout_cmd[0], (char *const *)kblayout_cmd);
|
||||||
|
+ die("dwl: execvp %s failed:", kblayout_cmd[0]);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
|
{
|
||||||
|
@@ -1391,6 +1450,8 @@ keypress(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
|
wlr_idle_notifier_v1_notify_activity(idle_notifier, seat);
|
||||||
|
|
||||||
|
+ kblayoutnotify(group, 0);
|
||||||
|
+
|
||||||
|
/* On _press_ if there is no active screen locker,
|
||||||
|
* attempt to process a compositor keybinding. */
|
||||||
|
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||||
|
@@ -1429,6 +1490,8 @@ keypressmod(struct wl_listener *listener, void *data)
|
||||||
|
/* Send modifiers to the client. */
|
||||||
|
wlr_seat_keyboard_notify_modifiers(seat,
|
||||||
|
&group->wlr_group->keyboard.modifiers);
|
||||||
|
+
|
||||||
|
+ kblayoutnotify(group, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@@ -0,0 +1,598 @@
|
|||||||
|
From 8e58ce22afe6a7cca34ff69d8862c89497156f40 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
|
<leohdz172@proton.me>
|
||||||
|
Date: Fri, 4 Jun 2021 16:51:01 -0500
|
||||||
|
Subject: [PATCH 1/2] allow use keycodes instead keysyms
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
|
---
|
||||||
|
config.def.h | 85 +++++++++---------
|
||||||
|
dwl.c | 35 +++-----
|
||||||
|
keys.h | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
3 files changed, 297 insertions(+), 65 deletions(-)
|
||||||
|
create mode 100644 keys.h
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index a8ed61d..40e13af 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -104,11 +104,11 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||||
|
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||||
|
#define MODKEY WLR_MODIFIER_ALT
|
||||||
|
|
||||||
|
-#define TAGKEYS(KEY,SKEY,TAG) \
|
||||||
|
+#define TAGKEYS(KEY,TAG) \
|
||||||
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
|
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, SKEY, tag, {.ui = 1 << TAG} }, \
|
||||||
|
- { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,SKEY,toggletag, {.ui = 1 << TAG} }
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
|
+ { MODKEY|WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT,KEY,toggletag, {.ui = 1 << TAG} }
|
||||||
|
|
||||||
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
@@ -117,51 +117,52 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||||
|
static const char *termcmd[] = { "foot", NULL };
|
||||||
|
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||||
|
|
||||||
|
+#include "keys.h"
|
||||||
|
static const Key keys[] = {
|
||||||
|
- /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||||
|
- /* modifier key function argument */
|
||||||
|
- { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
|
- { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
|
- { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
|
- { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
|
- { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||||
|
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||||
|
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||||
|
- { MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||||
|
- { MODKEY, XKB_KEY_Tab, view, {0} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||||
|
- { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||||
|
- { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||||
|
- { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
|
||||||
|
- { MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
|
- { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
|
- { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
||||||
|
- { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
|
- { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
|
- TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
|
||||||
|
- TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
|
||||||
|
- TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
|
||||||
|
- TAGKEYS( XKB_KEY_4, XKB_KEY_dollar, 3),
|
||||||
|
- TAGKEYS( XKB_KEY_5, XKB_KEY_percent, 4),
|
||||||
|
- TAGKEYS( XKB_KEY_6, XKB_KEY_asciicircum, 5),
|
||||||
|
- TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
|
||||||
|
- TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
|
||||||
|
- TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
|
||||||
|
+ /* modifier key function argument */
|
||||||
|
+ { MODKEY, Key_p, spawn, {.v = menucmd} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_Return, spawn, {.v = termcmd} },
|
||||||
|
+ { MODKEY, Key_j, focusstack, {.i = +1} },
|
||||||
|
+ { MODKEY, Key_k, focusstack, {.i = -1} },
|
||||||
|
+ { MODKEY, Key_i, incnmaster, {.i = +1} },
|
||||||
|
+ { MODKEY, Key_d, incnmaster, {.i = -1} },
|
||||||
|
+ { MODKEY, Key_h, setmfact, {.f = -0.05} },
|
||||||
|
+ { MODKEY, Key_l, setmfact, {.f = +0.05} },
|
||||||
|
+ { MODKEY, Key_Return, zoom, {0} },
|
||||||
|
+ { MODKEY, Key_Tab, view, {0} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_c, killclient, {0} },
|
||||||
|
+ { MODKEY, Key_t, setlayout, {.v = &layouts[0]} },
|
||||||
|
+ { MODKEY, Key_f, setlayout, {.v = &layouts[1]} },
|
||||||
|
+ { MODKEY, Key_m, setlayout, {.v = &layouts[2]} },
|
||||||
|
+ { MODKEY, Key_space, setlayout, {0} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_space, togglefloating, {0} },
|
||||||
|
+ { MODKEY, Key_e, togglefullscreen, {0} },
|
||||||
|
+ { MODKEY, Key_0, view, {.ui = ~0} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_0, tag, {.ui = ~0} },
|
||||||
|
+ { MODKEY, Key_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
|
+ { MODKEY, Key_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_period, tagmon, {.i = WLR_DIRECTION_RIGHT} },
|
||||||
|
+ TAGKEYS( Key_1, 0),
|
||||||
|
+ TAGKEYS( Key_2, 1),
|
||||||
|
+ TAGKEYS( Key_3, 2),
|
||||||
|
+ TAGKEYS( Key_4, 3),
|
||||||
|
+ TAGKEYS( Key_5, 4),
|
||||||
|
+ TAGKEYS( Key_6, 5),
|
||||||
|
+ TAGKEYS( Key_7, 6),
|
||||||
|
+ TAGKEYS( Key_8, 7),
|
||||||
|
+ TAGKEYS( Key_9, 8),
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_q, quit, {0} },
|
||||||
|
|
||||||
|
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
|
||||||
|
- { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
|
||||||
|
+ { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,Key_BackSpace, quit, {0} },
|
||||||
|
+#define CHVT(KEY,n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT, KEY, chvt, {.ui = (n)} }
|
||||||
|
/* Ctrl-Alt-Fx is used to switch to another VT, if you don't know what a VT is
|
||||||
|
* do not remove them.
|
||||||
|
*/
|
||||||
|
-#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
|
||||||
|
- CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
|
||||||
|
- CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
|
||||||
|
+ CHVT(Key_F1, 1), CHVT(Key_F2, 2), CHVT(Key_F3, 3), CHVT(Key_F4, 4),
|
||||||
|
+ CHVT(Key_F5, 5), CHVT(Key_F6, 6), CHVT(Key_F7, 7), CHVT(Key_F8, 8),
|
||||||
|
+ CHVT(Key_F9, 9), CHVT(Key_F10, 10), CHVT(Key_F11, 11), CHVT(Key_F12, 12),
|
||||||
|
};
|
||||||
|
|
||||||
|
static const Button buttons[] = {
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 10d5a5b..33fb251 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -138,7 +138,7 @@ typedef struct {
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t mod;
|
||||||
|
- xkb_keysym_t keysym;
|
||||||
|
+ xkb_keycode_t keycode;
|
||||||
|
void (*func)(const Arg *);
|
||||||
|
const Arg arg;
|
||||||
|
} Key;
|
||||||
|
@@ -147,9 +147,8 @@ typedef struct {
|
||||||
|
struct wl_list link;
|
||||||
|
struct wlr_keyboard_group *wlr_group;
|
||||||
|
|
||||||
|
- int nsyms;
|
||||||
|
- const xkb_keysym_t *keysyms; /* invalid if nsyms == 0 */
|
||||||
|
- uint32_t mods; /* invalid if nsyms == 0 */
|
||||||
|
+ xkb_keycode_t keycode;
|
||||||
|
+ uint32_t mods; /* invalid if keycode == 0 */
|
||||||
|
struct wl_event_source *key_repeat_source;
|
||||||
|
|
||||||
|
struct wl_listener modifiers;
|
||||||
|
@@ -272,7 +271,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||||
|
static void handlesig(int signo);
|
||||||
|
static void incnmaster(const Arg *arg);
|
||||||
|
static void inputdevice(struct wl_listener *listener, void *data);
|
||||||
|
-static int keybinding(uint32_t mods, xkb_keysym_t sym);
|
||||||
|
+static int keybinding(uint32_t mods, xkb_keycode_t keycode);
|
||||||
|
static void keypress(struct wl_listener *listener, void *data);
|
||||||
|
static void keypressmod(struct wl_listener *listener, void *data);
|
||||||
|
static int keyrepeat(void *data);
|
||||||
|
@@ -1351,7 +1350,7 @@ inputdevice(struct wl_listener *listener, void *data)
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
-keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
|
+keybinding(uint32_t mods, xkb_keycode_t keycode)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Here we handle compositor keybindings. This is when the compositor is
|
||||||
|
@@ -1361,7 +1360,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
|
const Key *k;
|
||||||
|
for (k = keys; k < END(keys); k++) {
|
||||||
|
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||||
|
- && sym == k->keysym && k->func) {
|
||||||
|
+ && keycode == k->keycode && k->func) {
|
||||||
|
k->func(&k->arg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@@ -1372,17 +1371,12 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||||
|
void
|
||||||
|
keypress(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
- int i;
|
||||||
|
/* This event is raised when a key is pressed or released. */
|
||||||
|
KeyboardGroup *group = wl_container_of(listener, group, key);
|
||||||
|
struct wlr_keyboard_key_event *event = data;
|
||||||
|
|
||||||
|
/* Translate libinput keycode -> xkbcommon */
|
||||||
|
uint32_t keycode = event->keycode + 8;
|
||||||
|
- /* Get a list of keysyms based on the keymap for this keyboard */
|
||||||
|
- const xkb_keysym_t *syms;
|
||||||
|
- int nsyms = xkb_state_key_get_syms(
|
||||||
|
- group->wlr_group->keyboard.xkb_state, keycode, &syms);
|
||||||
|
|
||||||
|
int handled = 0;
|
||||||
|
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
|
||||||
|
@@ -1391,19 +1385,16 @@ keypress(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
|
/* On _press_ if there is no active screen locker,
|
||||||
|
* attempt to process a compositor keybinding. */
|
||||||
|
- if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||||
|
- for (i = 0; i < nsyms; i++)
|
||||||
|
- handled = keybinding(mods, syms[i]) || handled;
|
||||||
|
- }
|
||||||
|
+ if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
|
||||||
|
+ handled = keybinding(mods, keycode);
|
||||||
|
|
||||||
|
if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
|
||||||
|
group->mods = mods;
|
||||||
|
- group->keysyms = syms;
|
||||||
|
- group->nsyms = nsyms;
|
||||||
|
+ group->keycode = keycode;
|
||||||
|
wl_event_source_timer_update(group->key_repeat_source,
|
||||||
|
group->wlr_group->keyboard.repeat_info.delay);
|
||||||
|
} else {
|
||||||
|
- group->nsyms = 0;
|
||||||
|
+ group->keycode = 0;
|
||||||
|
wl_event_source_timer_update(group->key_repeat_source, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1433,15 +1424,13 @@ int
|
||||||
|
keyrepeat(void *data)
|
||||||
|
{
|
||||||
|
KeyboardGroup *group = data;
|
||||||
|
- int i;
|
||||||
|
- if (!group->nsyms || group->wlr_group->keyboard.repeat_info.rate <= 0)
|
||||||
|
+ if (!group->keycode || group->wlr_group->keyboard.repeat_info.rate <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
wl_event_source_timer_update(group->key_repeat_source,
|
||||||
|
1000 / group->wlr_group->keyboard.repeat_info.rate);
|
||||||
|
|
||||||
|
- for (i = 0; i < group->nsyms; i++)
|
||||||
|
- keybinding(group->mods, group->keysyms[i]);
|
||||||
|
+ keybinding(group->mods, group->keycode);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff --git a/keys.h b/keys.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..e732f80
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/keys.h
|
||||||
|
@@ -0,0 +1,242 @@
|
||||||
|
+/* You can use the macros within this file
|
||||||
|
+ * instead of search the keycodes yourself
|
||||||
|
+ * with wev or something like that
|
||||||
|
+ * Also probably you search this:
|
||||||
|
+ * Key_XF86AudioMute
|
||||||
|
+ * Key_XF86AudioLowerVolume
|
||||||
|
+ * Key_XF86AudioRaiseVolume
|
||||||
|
+ * Key_XF86MonBrightnessDown
|
||||||
|
+ * Key_XF86MonBrightnessUp
|
||||||
|
+*/
|
||||||
|
+
|
||||||
|
+#define Key_Escape 9
|
||||||
|
+#define Key_1 10
|
||||||
|
+#define Key_2 11
|
||||||
|
+#define Key_3 12
|
||||||
|
+#define Key_4 13
|
||||||
|
+#define Key_5 14
|
||||||
|
+#define Key_6 15
|
||||||
|
+#define Key_7 16
|
||||||
|
+#define Key_8 17
|
||||||
|
+#define Key_9 18
|
||||||
|
+#define Key_0 19
|
||||||
|
+#define Key_minus 20
|
||||||
|
+#define Key_equal 21
|
||||||
|
+#define Key_BackSpace 22
|
||||||
|
+#define Key_Tab 23
|
||||||
|
+#define Key_q 24
|
||||||
|
+#define Key_w 25
|
||||||
|
+#define Key_e 26
|
||||||
|
+#define Key_r 27
|
||||||
|
+#define Key_t 28
|
||||||
|
+#define Key_y 29
|
||||||
|
+#define Key_u 30
|
||||||
|
+#define Key_i 31
|
||||||
|
+#define Key_o 32
|
||||||
|
+#define Key_p 33
|
||||||
|
+#define Key_bracketleft 34
|
||||||
|
+#define Key_bracketright 35
|
||||||
|
+#define Key_Return 36
|
||||||
|
+#define Key_Control_L 37
|
||||||
|
+#define Key_a 38
|
||||||
|
+#define Key_s 39
|
||||||
|
+#define Key_d 40
|
||||||
|
+#define Key_f 41
|
||||||
|
+#define Key_g 42
|
||||||
|
+#define Key_h 43
|
||||||
|
+#define Key_j 44
|
||||||
|
+#define Key_k 45
|
||||||
|
+#define Key_l 46
|
||||||
|
+#define Key_semicolon 47
|
||||||
|
+#define Key_apostrophe 48
|
||||||
|
+#define Key_grave 49
|
||||||
|
+#define Key_Shift_L 50
|
||||||
|
+#define Key_backslash 51
|
||||||
|
+#define Key_z 52
|
||||||
|
+#define Key_x 53
|
||||||
|
+#define Key_c 54
|
||||||
|
+#define Key_v 55
|
||||||
|
+#define Key_b 56
|
||||||
|
+#define Key_n 57
|
||||||
|
+#define Key_m 58
|
||||||
|
+#define Key_comma 59
|
||||||
|
+#define Key_period 60
|
||||||
|
+#define Key_slash 61
|
||||||
|
+#define Key_Shift_R 62
|
||||||
|
+#define Key_KP_Multiply 63
|
||||||
|
+#define Key_Alt_L 64
|
||||||
|
+#define Key_space 65
|
||||||
|
+#define Key_Caps_Lock 66
|
||||||
|
+#define Key_F1 67
|
||||||
|
+#define Key_F2 68
|
||||||
|
+#define Key_F3 69
|
||||||
|
+#define Key_F4 70
|
||||||
|
+#define Key_F5 71
|
||||||
|
+#define Key_F6 72
|
||||||
|
+#define Key_F7 73
|
||||||
|
+#define Key_F8 74
|
||||||
|
+#define Key_F9 75
|
||||||
|
+#define Key_F10 76
|
||||||
|
+#define Key_Num_Lock 77
|
||||||
|
+#define Key_Scroll_Lock 78
|
||||||
|
+#define Key_KP_Home 79
|
||||||
|
+#define Key_KP_7 Key_KP_Home
|
||||||
|
+#define Key_KP_Up 80
|
||||||
|
+#define Key_KP_8 Key_KP_Up
|
||||||
|
+#define Key_KP_Prior 81
|
||||||
|
+#define Key_KP_9 Key_KP_Prior
|
||||||
|
+#define Key_KP_Subtract 82
|
||||||
|
+#define Key_KP_Left 83
|
||||||
|
+#define Key_KP_4 Key_KP_Left
|
||||||
|
+#define Key_KP_Begin 84
|
||||||
|
+#define Key_KP_5 Key_KP_Begin
|
||||||
|
+#define Key_KP_Right 85
|
||||||
|
+#define Key_KP_6 Key_KP_Right
|
||||||
|
+#define Key_KP_Add 86
|
||||||
|
+#define Key_KP_End 87
|
||||||
|
+#define Key_KP_1 Key_KP_End
|
||||||
|
+#define Key_KP_Down 88
|
||||||
|
+#define Key_KP_2 Key_KP_Down
|
||||||
|
+#define Key_KP_Next 89
|
||||||
|
+#define Key_KP_3 Key_KP_Next
|
||||||
|
+#define Key_KP_Insert 90
|
||||||
|
+#define Key_KP_0 Key_KP_Insert
|
||||||
|
+#define Key_KP_Delete 91
|
||||||
|
+#define Key_KP_Period Key_KP_Insert
|
||||||
|
+#define Key_ISO_Level3_Shift 92
|
||||||
|
+#define Key_less 94
|
||||||
|
+#define Key_F11 95
|
||||||
|
+#define Key_F12 96
|
||||||
|
+#define Key_Katakana 98
|
||||||
|
+#define Key_Hiragana 99
|
||||||
|
+#define Key_Henkan_Mode 100
|
||||||
|
+#define Key_Hiragana_Katakana 101
|
||||||
|
+#define Key_Muhenkan 102
|
||||||
|
+#define Key_KP_Enter 104
|
||||||
|
+#define Key_Control_R 105
|
||||||
|
+#define Key_KP_Divide 106
|
||||||
|
+#define Key_Print 107
|
||||||
|
+#define Key_Alt_R 108
|
||||||
|
+#define Key_Linefeed 109
|
||||||
|
+#define Key_Home 110
|
||||||
|
+#define Key_Up 111
|
||||||
|
+#define Key_Prior 112
|
||||||
|
+#define Key_Left 113
|
||||||
|
+#define Key_Right 114
|
||||||
|
+#define Key_End 115
|
||||||
|
+#define Key_Down 116
|
||||||
|
+#define Key_Next 117
|
||||||
|
+#define Key_Insert 118
|
||||||
|
+#define Key_Delete 119
|
||||||
|
+#define Key_XF86AudioMute 121
|
||||||
|
+#define Key_XF86AudioLowerVolume 122
|
||||||
|
+#define Key_XF86AudioRaiseVolume 123
|
||||||
|
+#define Key_XF86PowerOff 124
|
||||||
|
+#define Key_KP_Equal 125
|
||||||
|
+#define Key_plusminus 126
|
||||||
|
+#define Key_Pause 127
|
||||||
|
+#define Key_XF86LaunchA 128
|
||||||
|
+#define Key_KP_Decimal 129
|
||||||
|
+#define Key_Hangul 130
|
||||||
|
+#define Key_Hangul_Hanja 131
|
||||||
|
+#define Key_Super_L 133
|
||||||
|
+#define Key_Super_R 134
|
||||||
|
+#define Key_Menu 135
|
||||||
|
+#define Key_Cancel 136
|
||||||
|
+#define Key_Redo 137
|
||||||
|
+#define Key_SunProps 138
|
||||||
|
+#define Key_Undo 139
|
||||||
|
+#define Key_SunFront 140
|
||||||
|
+#define Key_XF86Copy 141
|
||||||
|
+#define Key_XF86Open 142
|
||||||
|
+#define Key_XF86Paste 143
|
||||||
|
+#define Key_Find 144
|
||||||
|
+#define Key_XF86Cut 145
|
||||||
|
+#define Key_Help 146
|
||||||
|
+#define Key_XF86MenuKB 147
|
||||||
|
+#define Key_XF86Calculator 148
|
||||||
|
+#define Key_XF86Sleep 150
|
||||||
|
+#define Key_XF86WakeUp 151
|
||||||
|
+#define Key_XF86Explorer 152
|
||||||
|
+#define Key_XF86Send 153
|
||||||
|
+#define Key_XF86Xfer 155
|
||||||
|
+#define Key_XF86Launch1 156
|
||||||
|
+#define Key_XF86Launch2 157
|
||||||
|
+#define Key_XF86WWW 158
|
||||||
|
+#define Key_XF86DOS 159
|
||||||
|
+#define Key_XF86ScreenSaver 160
|
||||||
|
+#define Key_XF86RotateWindows 161
|
||||||
|
+#define Key_XF86TaskPane 162
|
||||||
|
+#define Key_XF86Mail 163
|
||||||
|
+#define Key_XF86Favorites 164
|
||||||
|
+#define Key_XF86MyComputer 165
|
||||||
|
+#define Key_XF86Back 166
|
||||||
|
+#define Key_XF86Forward 167
|
||||||
|
+#define Key_XF86Eject1 169
|
||||||
|
+#define Key_XF86Eject2 170
|
||||||
|
+#define Key_XF86AudioNext 171
|
||||||
|
+#define Key_XF86AudioPlay 172
|
||||||
|
+#define Key_XF86AudioPrev 173
|
||||||
|
+#define Key_XF86AudioStop 174
|
||||||
|
+#define Key_XF86AudioRecord 175
|
||||||
|
+#define Key_XF86AudioRewind 176
|
||||||
|
+#define Key_XF86Phone 177
|
||||||
|
+#define Key_XF86Tools 179
|
||||||
|
+#define Key_XF86HomePage 180
|
||||||
|
+#define Key_XF86Reload 181
|
||||||
|
+#define Key_XF86Close 182
|
||||||
|
+#define Key_XF86ScrollUp 185
|
||||||
|
+#define Key_XF86ScrollDown 186
|
||||||
|
+#define Key_parenleft 187
|
||||||
|
+#define Key_parenright 188
|
||||||
|
+#define Key_XF86New 189
|
||||||
|
+#define Key_Redo2 190
|
||||||
|
+#define Key_XF86Tools2 191
|
||||||
|
+#define Key_XF86Launch5 192
|
||||||
|
+#define Key_XF86Launch6 193
|
||||||
|
+#define Key_XF86Launch7 194
|
||||||
|
+#define Key_XF86Launch8 195
|
||||||
|
+#define Key_XF86Launch9 196
|
||||||
|
+#define Key_XF86AudioMicMute 198
|
||||||
|
+#define Key_XF86TouchpadToggle 199
|
||||||
|
+#define Key_XF86TouchpadOn 200
|
||||||
|
+#define Key_XF86TouchpadOff 201
|
||||||
|
+#define Key_Mode_switch 203
|
||||||
|
+#define Key_XF86AudioPlay2 208
|
||||||
|
+#define Key_XF86AudioPause 209
|
||||||
|
+#define Key_XF86Launch3 210
|
||||||
|
+#define Key_XF86Launch4 211
|
||||||
|
+#define Key_XF86LaunchB 212
|
||||||
|
+#define Key_XF86Suspend 213
|
||||||
|
+#define Key_XF86Close2 214
|
||||||
|
+#define Key_XF86AudioPlay3 215
|
||||||
|
+#define Key_XF86AudioForward 216
|
||||||
|
+#define Key_Print2 218
|
||||||
|
+#define Key_XF86WebCam 220
|
||||||
|
+#define Key_XF86AudioPreset 221
|
||||||
|
+#define Key_XF86Mail2 223
|
||||||
|
+#define Key_XF86Messenger 224
|
||||||
|
+#define Key_XF86Search 225
|
||||||
|
+#define Key_XF86Go 226
|
||||||
|
+#define Key_XF86Finance 227
|
||||||
|
+#define Key_XF86Game 228
|
||||||
|
+#define Key_XF86Shop 229
|
||||||
|
+#define Key_Cancel2 231
|
||||||
|
+#define Key_XF86MonBrightnessDown 232
|
||||||
|
+#define Key_XF86MonBrightnessUp 233
|
||||||
|
+#define Key_XF86AudioMedia 234
|
||||||
|
+#define Key_XF86Display 235
|
||||||
|
+#define Key_XF86KbdLightOnOff 236
|
||||||
|
+#define Key_XF86KbdBrightnessDown 237
|
||||||
|
+#define Key_XF86KbdBrightnessUp 238
|
||||||
|
+#define Key_XF86Send2 239
|
||||||
|
+#define Key_XF86Reply 240
|
||||||
|
+#define Key_XF86MailForward 241
|
||||||
|
+#define Key_XF86Save 242
|
||||||
|
+#define Key_XF86Documents 243
|
||||||
|
+#define Key_XF86Battery 244
|
||||||
|
+#define Key_XF86Bluetooth 245
|
||||||
|
+#define Key_XF86WLAN 246
|
||||||
|
+#define Key_XF86MonBrightnessCycle 251
|
||||||
|
+#define Key_XF86WWAN 254
|
||||||
|
+#define Key_XF86RFKill 255
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
|
|
||||||
|
From 9d24eaa9b2bd2c87c975882cd0b2adba978db564 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
|
<leohdz172@proton.me>
|
||||||
|
Date: Sun, 19 Mar 2023 15:50:07 -0600
|
||||||
|
Subject: [PATCH 2/2] add program to generate keys.h
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
|
---
|
||||||
|
generate-keys.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 82 insertions(+)
|
||||||
|
create mode 100644 generate-keys.c
|
||||||
|
|
||||||
|
diff --git a/generate-keys.c b/generate-keys.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..83458fb
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/generate-keys.c
|
||||||
|
@@ -0,0 +1,82 @@
|
||||||
|
+/******************************************************************
|
||||||
|
+ * Copyright 2023 Leonardo Hernández Hernández
|
||||||
|
+ *
|
||||||
|
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
+ * of this software and associated documentation files (the “Software”), to
|
||||||
|
+ * deal in the Software without restriction, including without limitation the
|
||||||
|
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
+ * sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
+ * furnished to do so, subject to the following conditions:
|
||||||
|
+ *
|
||||||
|
+ * The above copyright notice and this permission notice shall be included in
|
||||||
|
+ * all copies or substantial portions of the Software.
|
||||||
|
+ *
|
||||||
|
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
+ * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
+ *
|
||||||
|
+ ******************************************************************/
|
||||||
|
+
|
||||||
|
+/* cc -lxkbcommon -o generate-keys generate-keys.c */
|
||||||
|
+
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+
|
||||||
|
+#include <xkbcommon/xkbcommon.h>
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main(void)
|
||||||
|
+{
|
||||||
|
+ struct xkb_context *context;
|
||||||
|
+ /* Allow generate keys with a different layout and variant.
|
||||||
|
+ * You can also use XKB_DEFAULT_* environmental variables and let this as is */
|
||||||
|
+ struct xkb_rule_names rules = {
|
||||||
|
+ 0
|
||||||
|
+ };
|
||||||
|
+ struct xkb_keymap *keymap;
|
||||||
|
+ struct xkb_state *state;
|
||||||
|
+ xkb_keycode_t keycode, min_keycode, max_keycode;
|
||||||
|
+ int i, nsyms;
|
||||||
|
+ const xkb_keysym_t *syms;
|
||||||
|
+ char keyname[64];
|
||||||
|
+ FILE *f = fopen("keys.h", "w");
|
||||||
|
+ if (!f) {
|
||||||
|
+ perror("Couldn't open keys.h");
|
||||||
|
+ return EXIT_FAILURE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(context = xkb_context_new(XKB_CONTEXT_NO_FLAGS))) {
|
||||||
|
+ fputs("Couldn't create xkbcommon context\n", stderr);
|
||||||
|
+ return EXIT_FAILURE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(keymap = xkb_keymap_new_from_names(context, &rules,
|
||||||
|
+ XKB_KEYMAP_COMPILE_NO_FLAGS))) {
|
||||||
|
+ fputs("Couldn't create xkbcommon keymap\n", stderr);
|
||||||
|
+ return EXIT_FAILURE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(state = xkb_state_new(keymap))) {
|
||||||
|
+ fputs("Couldn't create xkbcommon state\n", stderr);
|
||||||
|
+ return EXIT_FAILURE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ min_keycode = xkb_keymap_min_keycode(keymap);
|
||||||
|
+ max_keycode = xkb_keymap_max_keycode(keymap);
|
||||||
|
+
|
||||||
|
+ for (keycode = min_keycode; keycode <= max_keycode; keycode++) {
|
||||||
|
+ nsyms = xkb_state_key_get_syms(state, keycode, &syms);
|
||||||
|
+ for (i = 0; i < nsyms; i++) {
|
||||||
|
+ xkb_keysym_get_name(syms[i], keyname, sizeof(keyname) / sizeof(keyname[0]));
|
||||||
|
+ fprintf(f, "#define Key_%-24s %d\n", keyname, keycode);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ xkb_state_unref(state);
|
||||||
|
+ xkb_keymap_unref(keymap);
|
||||||
|
+ xkb_context_unref(context);
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
+2
-43
@@ -1,7 +1,7 @@
|
|||||||
From adc8734017644f44443db30e976cf03147c7c3c4 Mon Sep 17 00:00:00 2001
|
From adc8734017644f44443db30e976cf03147c7c3c4 Mon Sep 17 00:00:00 2001
|
||||||
From: Micah N Gorrell <m@minego.net>
|
From: Micah N Gorrell <m@minego.net>
|
||||||
Date: Fri, 9 Feb 2024 17:08:20 -0700
|
Date: Fri, 9 Feb 2024 17:08:20 -0700
|
||||||
Subject: [PATCH 1/3] Add support for touch screen input devices, and send the
|
Subject: [PATCH 1/2] Add support for touch screen input devices, and send the
|
||||||
appropriate events to clients
|
appropriate events to clients
|
||||||
|
|
||||||
Send notification of touch motition events even if there is no client to focus. This is important for swiping on an OSK.
|
Send notification of touch motition events even if there is no client to focus. This is important for swiping on an OSK.
|
||||||
@@ -240,7 +240,7 @@ index 5867b0c..fe447fb 100644
|
|||||||
From c2e4ff7253f33c80552abe9126e3c57d0aa23560 Mon Sep 17 00:00:00 2001
|
From c2e4ff7253f33c80552abe9126e3c57d0aa23560 Mon Sep 17 00:00:00 2001
|
||||||
From: Micah N Gorrell <m@minego.net>
|
From: Micah N Gorrell <m@minego.net>
|
||||||
Date: Thu, 28 Mar 2024 11:25:59 -0600
|
Date: Thu, 28 Mar 2024 11:25:59 -0600
|
||||||
Subject: [PATCH 2/3] Removed debug
|
Subject: [PATCH 2/2] Removed debug
|
||||||
|
|
||||||
---
|
---
|
||||||
dwl.c | 1 -
|
dwl.c | 1 -
|
||||||
@@ -261,44 +261,3 @@ index fe447fb..c26c581 100644
|
|||||||
--
|
--
|
||||||
2.44.0
|
2.44.0
|
||||||
|
|
||||||
|
|
||||||
From ae64e0c3b51c8600de7c081034ea267c08134635 Mon Sep 17 00:00:00 2001
|
|
||||||
From: anabasis <anabasis@noreply.codeberg.org>
|
|
||||||
Date: Sat, 11 May 2024 20:19:18 -0400
|
|
||||||
Subject: [PATCH 3/3] fix bug and focus client according to sloppyfocus
|
|
||||||
|
|
||||||
---
|
|
||||||
dwl.c | 8 +++++++-
|
|
||||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index c26c581..75b44d7 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -2713,6 +2713,8 @@ touchdown(struct wl_listener *listener, void *data)
|
|
||||||
|
|
||||||
/* Find the client under the pointer and send the event along. */
|
|
||||||
xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
|
|
||||||
+ if (sloppyfocus)
|
|
||||||
+ focusclient(c, 0);
|
|
||||||
|
|
||||||
if (surface != NULL) {
|
|
||||||
serial = wlr_seat_touch_notify_down(seat, surface, event->time_msec, event->touch_id, sx, sy);
|
|
||||||
@@ -2780,9 +2782,13 @@ touchmotion(struct wl_listener *listener, void *data)
|
|
||||||
wlr_cursor_absolute_to_layout_coords(cursor, &event->touch->base, event->x, event->y, &lx, &ly);
|
|
||||||
xytonode(lx, ly, &surface, &c, NULL, &sx, &sy);
|
|
||||||
|
|
||||||
- if (c != NULL) {
|
|
||||||
+ if (c != NULL && surface != NULL) {
|
|
||||||
+ if (sloppyfocus)
|
|
||||||
+ focusclient(c, 0);
|
|
||||||
wlr_seat_touch_point_focus(seat, surface, event->time_msec, event->touch_id, sx, sy);
|
|
||||||
} else {
|
|
||||||
+ if (sloppyfocus)
|
|
||||||
+ focusclient(NULL, 0);
|
|
||||||
wlr_seat_touch_point_clear_focus(seat, event->time_msec, event->touch_id);
|
|
||||||
}
|
|
||||||
wlr_seat_touch_notify_motion(seat, event->time_msec, event->touch_id, sx, sy);
|
|
||||||
--
|
|
||||||
2.44.0
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 0afd0a98998dda20e4fe4f4d2b5fcdec49c448c3 Mon Sep 17 00:00:00 2001
|
From 4693a27d3c435883743f60dbe3c0c523bdc1a0cc Mon Sep 17 00:00:00 2001
|
||||||
From: Sevz17 <leohdz172@outlook.com>
|
From: Sevz17 <leohdz172@outlook.com>
|
||||||
Date: Fri, 25 Jun 2021 19:50:56 -0500
|
Date: Fri, 25 Jun 2021 19:50:56 -0500
|
||||||
Subject: [PATCH] show master area to the right
|
Subject: [PATCH] show master area to the right
|
||||||
@@ -12,10 +12,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
|||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 9021e442..2bd354a3 100644
|
index 10d5a5b..5ae2605 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -2670,11 +2670,12 @@ tile(Monitor *m)
|
@@ -2470,11 +2470,12 @@ tile(Monitor *m)
|
||||||
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
||||||
continue;
|
continue;
|
||||||
if (i < m->nmaster) {
|
if (i < m->nmaster) {
|
||||||
@@ -31,5 +31,5 @@ index 9021e442..2bd354a3 100644
|
|||||||
ty += c->geom.height;
|
ty += c->geom.height;
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.46.0
|
2.43.0
|
||||||
|
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
From ce0eb92fb100801f343fbe9b76639847a9e39160 Mon Sep 17 00:00:00 2001
|
From 225fcc26d1b0fd696a90817c996b670ced8964f2 Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Fri, 5 Jul 2024 11:22:57 -0500
|
Date: Thu, 11 Apr 2024 14:34:45 -0500
|
||||||
Subject: [PATCH] implement minimalborders
|
Subject: [PATCH] apply minimal borders
|
||||||
|
|
||||||
|
dynamically adjusts the borders between adjacent clients to make them visually merge
|
||||||
---
|
---
|
||||||
config.def.h | 1 +
|
config.def.h | 1 +
|
||||||
dwl.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++----
|
dwl.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++----
|
||||||
2 files changed, 72 insertions(+), 6 deletions(-)
|
2 files changed, 72 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..0322dbf 100644
|
index 8847e58..55d8796 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -7,6 +7,7 @@
|
@@ -7,6 +7,7 @@
|
||||||
@@ -21,10 +22,10 @@ index 22d2171..0322dbf 100644
|
|||||||
static const float bordercolor[] = COLOR(0x444444ff);
|
static const float bordercolor[] = COLOR(0x444444ff);
|
||||||
static const float focuscolor[] = COLOR(0x005577ff);
|
static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index dc0437e..198061b 100644
|
index bf763df..d581f31 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -106,6 +106,7 @@ typedef struct Monitor Monitor;
|
@@ -105,6 +105,7 @@ typedef struct Monitor Monitor;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Must keep these three elements in this order */
|
/* Must keep these three elements in this order */
|
||||||
unsigned int type; /* XDGShell or X11* */
|
unsigned int type; /* XDGShell or X11* */
|
||||||
@@ -32,7 +33,7 @@ index dc0437e..198061b 100644
|
|||||||
struct wlr_box geom; /* layout-relative, includes border */
|
struct wlr_box geom; /* layout-relative, includes border */
|
||||||
Monitor *mon;
|
Monitor *mon;
|
||||||
struct wlr_scene_tree *scene;
|
struct wlr_scene_tree *scene;
|
||||||
@@ -316,7 +317,8 @@ static void rendermon(struct wl_listener *listener, void *data);
|
@@ -312,7 +313,8 @@ static void rendermon(struct wl_listener *listener, void *data);
|
||||||
static void requestdecorationmode(struct wl_listener *listener, void *data);
|
static void requestdecorationmode(struct wl_listener *listener, void *data);
|
||||||
static void requeststartdrag(struct wl_listener *listener, void *data);
|
static void requeststartdrag(struct wl_listener *listener, void *data);
|
||||||
static void requestmonstate(struct wl_listener *listener, void *data);
|
static void requestmonstate(struct wl_listener *listener, void *data);
|
||||||
@@ -42,7 +43,7 @@ index dc0437e..198061b 100644
|
|||||||
static void run(char *startup_cmd);
|
static void run(char *startup_cmd);
|
||||||
static void setcursor(struct wl_listener *listener, void *data);
|
static void setcursor(struct wl_listener *listener, void *data);
|
||||||
static void setcursorshape(struct wl_listener *listener, void *data);
|
static void setcursorshape(struct wl_listener *listener, void *data);
|
||||||
@@ -408,6 +410,8 @@ static struct wlr_box sgeom;
|
@@ -405,6 +407,8 @@ static struct wlr_box sgeom;
|
||||||
static struct wl_list mons;
|
static struct wl_list mons;
|
||||||
static Monitor *selmon;
|
static Monitor *selmon;
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ index dc0437e..198061b 100644
|
|||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
static void activatex11(struct wl_listener *listener, void *data);
|
static void activatex11(struct wl_listener *listener, void *data);
|
||||||
static void associatex11(struct wl_listener *listener, void *data);
|
static void associatex11(struct wl_listener *listener, void *data);
|
||||||
@@ -476,6 +480,35 @@ applyrules(Client *c)
|
@@ -473,6 +477,35 @@ applyrules(Client *c)
|
||||||
setmon(c, mon, newtags);
|
setmon(c, mon, newtags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,9 +88,9 @@ index dc0437e..198061b 100644
|
|||||||
void
|
void
|
||||||
arrange(Monitor *m)
|
arrange(Monitor *m)
|
||||||
{
|
{
|
||||||
@@ -510,8 +543,28 @@ arrange(Monitor *m)
|
@@ -493,8 +526,28 @@ arrange(Monitor *m)
|
||||||
: c->scene->node.parent);
|
|
||||||
}
|
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
|
||||||
|
|
||||||
- if (m->lt[m->sellt]->arrange)
|
- if (m->lt[m->sellt]->arrange)
|
||||||
- m->lt[m->sellt]->arrange(m);
|
- m->lt[m->sellt]->arrange(m);
|
||||||
@@ -118,10 +119,10 @@ index dc0437e..198061b 100644
|
|||||||
motionnotify(0, NULL, 0, 0, 0, 0);
|
motionnotify(0, NULL, 0, 0, 0, 0);
|
||||||
checkidleinhibitor(NULL);
|
checkidleinhibitor(NULL);
|
||||||
}
|
}
|
||||||
@@ -1962,8 +2015,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
@@ -1883,8 +1936,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
if (surface != seat->pointer_state.focused_surface &&
|
if ((!active_constraint || active_constraint->surface != surface) &&
|
||||||
- sloppyfocus && time && c && !client_is_unmanaged(c))
|
- sloppyfocus && time && c && !client_is_unmanaged(c))
|
||||||
- focusclient(c, 0);
|
- focusclient(c, 0);
|
||||||
+ sloppyfocus && time && c && !client_is_unmanaged(c)) {
|
+ sloppyfocus && time && c && !client_is_unmanaged(c)) {
|
||||||
@@ -134,16 +135,16 @@ index dc0437e..198061b 100644
|
|||||||
|
|
||||||
/* If surface is NULL, clear pointer focus */
|
/* If surface is NULL, clear pointer focus */
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
@@ -2128,7 +2186,7 @@ requestmonstate(struct wl_listener *listener, void *data)
|
@@ -2032,7 +2090,7 @@ requestmonstate(struct wl_listener *listener, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
-resize(Client *c, struct wlr_box geo, int interact)
|
-resize(Client *c, struct wlr_box geo, int interact)
|
||||||
+resizeapply(Client *c, struct wlr_box geo, int interact)
|
+resizeapply(Client *c, struct wlr_box geo, int interact)
|
||||||
{
|
{
|
||||||
struct wlr_box *bbox;
|
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;
|
||||||
struct wlr_box clip;
|
struct wlr_box clip;
|
||||||
@@ -2160,6 +2218,13 @@ resize(Client *c, struct wlr_box geo, int interact)
|
@@ -2058,6 +2116,13 @@ resize(Client *c, struct wlr_box geo, int interact)
|
||||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,4 +159,4 @@ index dc0437e..198061b 100644
|
|||||||
run(char *startup_cmd)
|
run(char *startup_cmd)
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.45.1
|
2.43.2
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 73f70cd9d817a307030f360f6c8a2500046b8b76 Mon Sep 17 00:00:00 2001
|
From e7a8ee402ba7f03c621eab9df839aabd8aa5eb4c Mon Sep 17 00:00:00 2001
|
||||||
From: Palanix <palanixyt@gmail.com>
|
From: Palanix <palanixyt@gmail.com>
|
||||||
Date: Mon, 4 Apr 2022 16:08:29 +0200
|
Date: Mon, 4 Apr 2022 16:08:29 +0200
|
||||||
Subject: [PATCH] Updated patch now allowing setting x and y
|
Subject: [PATCH] Updated patch now allowing setting x and y
|
||||||
@@ -6,14 +6,14 @@ MIME-Version: 1.0
|
|||||||
Content-Type: text/plain; charset=UTF-8
|
Content-Type: text/plain; charset=UTF-8
|
||||||
Content-Transfer-Encoding: 8bit
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
Co-authored-by: Leonardo Hernández Hernández <leohdz172@proton.me
|
||||||
---
|
---
|
||||||
config.def.h | 11 +++++++----
|
config.def.h | 11 +++++++----
|
||||||
dwl.c | 25 +++++++++++++++++++------
|
dwl.c | 25 +++++++++++++++++++------
|
||||||
2 files changed, 26 insertions(+), 10 deletions(-)
|
2 files changed, 26 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 8f498d2..4ccacd2 100644
|
index 8847e58..a8860c4 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -38,12 +38,15 @@ static const Layout layouts[] = {
|
@@ -38,12 +38,15 @@ static const Layout layouts[] = {
|
||||||
@@ -26,18 +26,18 @@ index 8f498d2..4ccacd2 100644
|
|||||||
+ /* name mfact nmaster scale layout rotate/reflect x y resx resy rate mode adaptive*/
|
+ /* name mfact nmaster scale layout rotate/reflect x y resx resy rate mode adaptive*/
|
||||||
+ /* example of a HiDPI laptop monitor at 120Hz:
|
+ /* example of a HiDPI laptop monitor at 120Hz:
|
||||||
+ { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000f, 1, 1},
|
+ { "eDP-1", 0.5f, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 120.000f, 1, 1},
|
||||||
+ * mode let's the user decide on how dwl should implement the modes:
|
|
||||||
+ * -1 Sets a custom mode following the users choice
|
|
||||||
+ * All other number's set the mode at the index n, 0 is the standard mode; see wlr-randr
|
|
||||||
*/
|
*/
|
||||||
/* defaults */
|
/* defaults */
|
||||||
- { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
- { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1 },
|
||||||
+ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, -1, -1, 0, 0, 0.0f, 0 ,1},
|
+ { NULL, 0.55f, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL, 0, 0, 0, 0, 0.0f, 0 ,1},
|
||||||
|
+ // mode let's the user decide on how dwl should implement the modes:
|
||||||
|
+ // -1 Sets a custom mode following the users choice
|
||||||
|
+ // All other number's set the mode at the index n, 0 is the standard mode; see wlr-randr
|
||||||
};
|
};
|
||||||
|
|
||||||
/* keyboard */
|
/* keyboard */
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 52bfbc8..9609b6d 100644
|
index bf763df..fdd603b 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -215,6 +215,11 @@ typedef struct {
|
@@ -215,6 +215,11 @@ typedef struct {
|
||||||
@@ -91,5 +91,5 @@ index 52bfbc8..9609b6d 100644
|
|||||||
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
||||||
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
|
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
|
||||||
--
|
--
|
||||||
2.45.1
|
2.45.0
|
||||||
|
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
From bc5206882c71b32198dae5f1c85601a863a7c0a9 Mon Sep 17 00:00:00 2001
|
From f0d50d609a04cbcc1ae4d3cf27b68024f256207c Mon Sep 17 00:00:00 2001
|
||||||
From: wochap <gean.marroquin@gmail.com>
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
Date: Wed, 31 Jul 2024 07:43:10 -0500
|
Date: Tue, 5 Mar 2024 23:39:01 -0500
|
||||||
Subject: [PATCH] implement movecenter fn
|
Subject: [PATCH] implement keybinding to center focused windows
|
||||||
|
|
||||||
---
|
---
|
||||||
config.def.h | 2 ++
|
config.def.h | 2 ++
|
||||||
dwl.c | 31 +++++++++++++++++++++++++++++++
|
dwl.c | 23 +++++++++++++++++++++++
|
||||||
2 files changed, 33 insertions(+)
|
2 files changed, 25 insertions(+)
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
diff --git a/config.def.h b/config.def.h
|
||||||
index 22d2171..f5225d9 100644
|
index db0babc..71b01ab 100644
|
||||||
--- a/config.def.h
|
--- a/config.def.h
|
||||||
+++ b/config.def.h
|
+++ b/config.def.h
|
||||||
@@ -13,6 +13,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
@@ -12,6 +12,7 @@ static const float focuscolor[] = COLOR(0x005577ff);
|
||||||
static const float urgentcolor[] = COLOR(0xff0000ff);
|
static const float urgentcolor[] = COLOR(0xff0000ff);
|
||||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
|
||||||
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
|
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can also use glsl colors */
|
||||||
+static const int respect_monitor_reserved_area = 0; /* 1 to monitor center while respecting the monitor's reserved area, 0 to monitor center */
|
+static const int center_relative_to_monitor = 0; /* 0 means center floating relative to the window area */
|
||||||
|
|
||||||
/* tagging - TAGCOUNT must be no greater than 31 */
|
/* tagging - TAGCOUNT must be no greater than 31 */
|
||||||
#define TAGCOUNT (9)
|
#define TAGCOUNT (9)
|
||||||
@@ -142,6 +143,7 @@ static const Key keys[] = {
|
@@ -135,6 +136,7 @@ static const Key keys[] = {
|
||||||
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
{ MODKEY, XKB_KEY_space, setlayout, {0} },
|
||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
|
||||||
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} },
|
||||||
@@ -29,54 +29,45 @@ index 22d2171..f5225d9 100644
|
|||||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
|
||||||
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index 145fd01..791e598 100644
|
index ef27a1d..fb39d13 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -336,6 +336,8 @@ static void tagmon(const Arg *arg);
|
@@ -313,6 +313,7 @@ static void tagmon(const Arg *arg);
|
||||||
static void tile(Monitor *m);
|
static void tile(Monitor *m);
|
||||||
static void togglefloating(const Arg *arg);
|
static void togglefloating(const Arg *arg);
|
||||||
static void togglefullscreen(const Arg *arg);
|
static void togglefullscreen(const Arg *arg);
|
||||||
+static void _movecenter(Client *c, int interact);
|
|
||||||
+static void movecenter(const Arg *arg);
|
+static void movecenter(const Arg *arg);
|
||||||
static void toggletag(const Arg *arg);
|
static void toggletag(const Arg *arg);
|
||||||
static void toggleview(const Arg *arg);
|
static void toggleview(const Arg *arg);
|
||||||
static void unlocksession(struct wl_listener *listener, void *data);
|
static void unlocksession(struct wl_listener *listener, void *data);
|
||||||
@@ -2683,6 +2685,35 @@ togglefullscreen(const Arg *arg)
|
@@ -2454,6 +2455,28 @@ togglefullscreen(const Arg *arg)
|
||||||
setfullscreen(sel, !sel->isfullscreen);
|
setfullscreen(sel, !sel->isfullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
+void
|
+void
|
||||||
+_movecenter(Client *c, int interact)
|
+movecenter(const Arg *arg)
|
||||||
+{
|
+{
|
||||||
+ struct wlr_box b;
|
+ Client *c = focustop(selmon);
|
||||||
|
+ Monitor *m = selmon;
|
||||||
+
|
+
|
||||||
+ if (!c || !c->mon) {
|
+ if (!m) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (!c->isfloating) {
|
+ if (c) {
|
||||||
+ return;
|
+ // const int center_relative_to_monitor = arg->i;
|
||||||
+ }
|
+ struct wlr_box b = center_relative_to_monitor ? m->m : m->w;
|
||||||
+
|
|
||||||
+ b = respect_monitor_reserved_area ? c->mon->w : c->mon->m;
|
|
||||||
+ resize(c, (struct wlr_box){
|
+ resize(c, (struct wlr_box){
|
||||||
+ .x = (b.width - c->geom.width) / 2 + b.x,
|
+ .x = (b.width - c->geom.width) / 2 + b.x,
|
||||||
+ .y = (b.height - c->geom.height) / 2 + b.y,
|
+ .y = (b.height - c->geom.height) / 2 + b.y,
|
||||||
+ .width = c->geom.width,
|
+ .width = c->geom.width,
|
||||||
+ .height = c->geom.height,
|
+ .height = c->geom.height,
|
||||||
+ }, interact);
|
+ }, 1);
|
||||||
+}
|
+ }
|
||||||
+
|
|
||||||
+void
|
|
||||||
+movecenter(const Arg *arg)
|
|
||||||
+{
|
|
||||||
+ Client *c = focustop(selmon);
|
|
||||||
+ _movecenter(c, 1);
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
void
|
void
|
||||||
toggletag(const Arg *arg)
|
toggletag(const Arg *arg)
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.45.2
|
2.42.0
|
||||||
|
|
||||||
@@ -0,0 +1,421 @@
|
|||||||
|
From 0dc34efe899c9e6dca6eb8770f3dedd2afe5ee83 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 22 Nov 2023 18:55:15 -0500
|
||||||
|
Subject: [PATCH 1/6] apply main...loumray:namedscratchpads.patch
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 9 +++++++--
|
||||||
|
dwl.c | 39 +++++++++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 46 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index db0babc..157aee4 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -20,11 +20,12 @@ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; /* You can al
|
||||||
|
static int log_level = WLR_ERROR;
|
||||||
|
|
||||||
|
static const Rule rules[] = {
|
||||||
|
- /* app_id title tags mask isfloating monitor */
|
||||||
|
+ /* app_id title tags mask isfloating monitor scratchkey */
|
||||||
|
/* examples:
|
||||||
|
{ "Gimp", NULL, 0, 1, -1 },
|
||||||
|
*/
|
||||||
|
- { "firefox", NULL, 1 << 8, 0, -1 },
|
||||||
|
+ { "firefox", NULL, 1 << 8, 0, -1, 0 },
|
||||||
|
+ { NULL, "scratchpad", 0, 1, -1, 's' },
|
||||||
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
|
@@ -115,11 +116,15 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||||
|
static const char *termcmd[] = { "foot", NULL };
|
||||||
|
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||||
|
|
||||||
|
+/* named scratchpads - First arg only serves to match against key in rules*/
|
||||||
|
+static const char *scratchpadcmd[] = { "s", "alacritty", "-t", "scratchpad", NULL };
|
||||||
|
+
|
||||||
|
static const Key keys[] = {
|
||||||
|
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
|
||||||
|
/* modifier key function argument */
|
||||||
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
|
+ { MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
|
||||||
|
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index ef27a1d..81e5db8 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -130,6 +130,7 @@ typedef struct {
|
||||||
|
uint32_t tags;
|
||||||
|
int isfloating, isurgent, isfullscreen;
|
||||||
|
uint32_t resize; /* configure serial of a pending resize */
|
||||||
|
+ char scratchkey;
|
||||||
|
} Client;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
@@ -215,6 +216,7 @@ typedef struct {
|
||||||
|
uint32_t tags;
|
||||||
|
int isfloating;
|
||||||
|
int monitor;
|
||||||
|
+ const char scratchkey;
|
||||||
|
} Rule;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
@@ -307,12 +309,14 @@ static void setpsel(struct wl_listener *listener, void *data);
|
||||||
|
static void setsel(struct wl_listener *listener, void *data);
|
||||||
|
static void setup(void);
|
||||||
|
static void spawn(const Arg *arg);
|
||||||
|
+static void spawnscratch(const Arg *arg);
|
||||||
|
static void startdrag(struct wl_listener *listener, void *data);
|
||||||
|
static void tag(const Arg *arg);
|
||||||
|
static void tagmon(const Arg *arg);
|
||||||
|
static void tile(Monitor *m);
|
||||||
|
static void togglefloating(const Arg *arg);
|
||||||
|
static void togglefullscreen(const Arg *arg);
|
||||||
|
+static void togglescratch(const Arg *arg);
|
||||||
|
static void toggletag(const Arg *arg);
|
||||||
|
static void toggleview(const Arg *arg);
|
||||||
|
static void unlocksession(struct wl_listener *listener, void *data);
|
||||||
|
@@ -424,6 +428,7 @@ applyrules(Client *c)
|
||||||
|
Monitor *mon = selmon, *m;
|
||||||
|
|
||||||
|
c->isfloating = client_is_float_type(c);
|
||||||
|
+ c->scratchkey = 0;
|
||||||
|
if (!(appid = client_get_appid(c)))
|
||||||
|
appid = broken;
|
||||||
|
if (!(title = client_get_title(c)))
|
||||||
|
@@ -433,6 +438,7 @@ applyrules(Client *c)
|
||||||
|
if ((!r->title || strstr(title, r->title))
|
||||||
|
&& (!r->id || strstr(appid, r->id))) {
|
||||||
|
c->isfloating = r->isfloating;
|
||||||
|
+ c->scratchkey = r->scratchkey;
|
||||||
|
newtags |= r->tags;
|
||||||
|
i = 0;
|
||||||
|
wl_list_for_each(m, &mons, link)
|
||||||
|
@@ -2372,6 +2378,16 @@ spawn(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void spawnscratch(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ if (fork() == 0) {
|
||||||
|
+ dup2(STDERR_FILENO, STDOUT_FILENO);
|
||||||
|
+ setsid();
|
||||||
|
+ execvp(((char **)arg->v)[1], ((char **)arg->v)+1);
|
||||||
|
+ die("dwl: execvp %s failed:", ((char **)arg->v)[1]);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
startdrag(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
@@ -2454,6 +2470,29 @@ togglefullscreen(const Arg *arg)
|
||||||
|
setfullscreen(sel, !sel->isfullscreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+togglescratch(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ Client *c;
|
||||||
|
+ unsigned int found = 0;
|
||||||
|
+
|
||||||
|
+ /* search for first window that matches the scratchkey */
|
||||||
|
+ wl_list_for_each(c, &clients, link)
|
||||||
|
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
|
||||||
|
+ found = 1;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (found) {
|
||||||
|
+ c->tags = VISIBLEON(c, selmon) ? 0 : selmon->tagset[selmon->seltags];
|
||||||
|
+
|
||||||
|
+ focusclient(c->tags == 0 ? focustop(selmon) : c, 1);
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ } else{
|
||||||
|
+ spawnscratch(arg);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
toggletag(const Arg *arg)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From e750aa243a25ec78e611883b5e72314067326746 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 22 Nov 2023 18:58:57 -0500
|
||||||
|
Subject: [PATCH 2/6] add focusortogglescratch function
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 1 +
|
||||||
|
dwl.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 38 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 157aee4..0f672d4 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -125,6 +125,7 @@ static const Key keys[] = {
|
||||||
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
|
{ MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
|
||||||
|
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
|
||||||
|
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 81e5db8..83d771e 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -317,6 +317,7 @@ static void tile(Monitor *m);
|
||||||
|
static void togglefloating(const Arg *arg);
|
||||||
|
static void togglefullscreen(const Arg *arg);
|
||||||
|
static void togglescratch(const Arg *arg);
|
||||||
|
+static void focusortogglescratch(const Arg *arg);
|
||||||
|
static void toggletag(const Arg *arg);
|
||||||
|
static void toggleview(const Arg *arg);
|
||||||
|
static void unlocksession(struct wl_listener *listener, void *data);
|
||||||
|
@@ -2493,6 +2494,42 @@ togglescratch(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+focusortogglescratch(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ Client *c;
|
||||||
|
+ Client *cwithfocus;
|
||||||
|
+ unsigned int found = 0;
|
||||||
|
+
|
||||||
|
+ /* search for first window that matches the scratchkey */
|
||||||
|
+ wl_list_for_each(c, &clients, link)
|
||||||
|
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
|
||||||
|
+ found = 1;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (found) {
|
||||||
|
+ if (VISIBLEON(c, selmon)) {
|
||||||
|
+ cwithfocus = focustop(selmon);
|
||||||
|
+ if (cwithfocus == c) {
|
||||||
|
+ // hide
|
||||||
|
+ c->tags = 0;
|
||||||
|
+ focusclient(cwithfocus, 1);
|
||||||
|
+ } else {
|
||||||
|
+ // focus
|
||||||
|
+ focusclient(c, 1);
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ // show
|
||||||
|
+ c->tags = selmon->tagset[selmon->seltags];
|
||||||
|
+ focusclient(c, 1);
|
||||||
|
+ }
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ } else{
|
||||||
|
+ spawnscratch(arg);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
toggletag(const Arg *arg)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 5ee62daed7e4fb60d09ba72793bf872307697203 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 22 Nov 2023 20:42:20 -0500
|
||||||
|
Subject: [PATCH 3/6] fix focus after hiding
|
||||||
|
|
||||||
|
---
|
||||||
|
dwl.c | 6 ++----
|
||||||
|
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 83d771e..6b5d55d 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -2498,7 +2498,6 @@ void
|
||||||
|
focusortogglescratch(const Arg *arg)
|
||||||
|
{
|
||||||
|
Client *c;
|
||||||
|
- Client *cwithfocus;
|
||||||
|
unsigned int found = 0;
|
||||||
|
|
||||||
|
/* search for first window that matches the scratchkey */
|
||||||
|
@@ -2510,11 +2509,10 @@ focusortogglescratch(const Arg *arg)
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
if (VISIBLEON(c, selmon)) {
|
||||||
|
- cwithfocus = focustop(selmon);
|
||||||
|
- if (cwithfocus == c) {
|
||||||
|
+ if (focustop(selmon) == c) {
|
||||||
|
// hide
|
||||||
|
c->tags = 0;
|
||||||
|
- focusclient(cwithfocus, 1);
|
||||||
|
+ focusclient(focustop(selmon), 1);
|
||||||
|
} else {
|
||||||
|
// focus
|
||||||
|
focusclient(c, 1);
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 0b3d70706a0aca6d4414d20a3f2ac4928e70d04e Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 6 Mar 2024 14:36:48 -0500
|
||||||
|
Subject: [PATCH 4/6] add focusortogglematchingscratch
|
||||||
|
|
||||||
|
works like focusortoggle but it also hides all others scratchpads
|
||||||
|
---
|
||||||
|
dwl.c | 43 +++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 43 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 6b5d55d..e179940 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -318,6 +318,7 @@ static void togglefloating(const Arg *arg);
|
||||||
|
static void togglefullscreen(const Arg *arg);
|
||||||
|
static void togglescratch(const Arg *arg);
|
||||||
|
static void focusortogglescratch(const Arg *arg);
|
||||||
|
+static void focusortogglematchingscratch(const Arg *arg);
|
||||||
|
static void toggletag(const Arg *arg);
|
||||||
|
static void toggleview(const Arg *arg);
|
||||||
|
static void unlocksession(struct wl_listener *listener, void *data);
|
||||||
|
@@ -2528,6 +2529,48 @@ focusortogglescratch(const Arg *arg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+focusortogglematchingscratch(const Arg *arg)
|
||||||
|
+{
|
||||||
|
+ Client *c;
|
||||||
|
+ unsigned int found = 0;
|
||||||
|
+
|
||||||
|
+ wl_list_for_each(c, &clients, link) {
|
||||||
|
+ if (c->scratchkey == 0) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if (c->scratchkey == ((char**)arg->v)[0][0]) {
|
||||||
|
+ found = 1;
|
||||||
|
+ if (VISIBLEON(c, selmon)) {
|
||||||
|
+ if (focustop(selmon) == c) {
|
||||||
|
+ // hide
|
||||||
|
+ c->tags = 0;
|
||||||
|
+ focusclient(focustop(selmon), 1);
|
||||||
|
+ } else {
|
||||||
|
+ // focus
|
||||||
|
+ focusclient(c, 1);
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ // show
|
||||||
|
+ c->tags = selmon->tagset[selmon->seltags];
|
||||||
|
+ // focus
|
||||||
|
+ focusclient(c, 1);
|
||||||
|
+ }
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if (VISIBLEON(c, selmon)) {
|
||||||
|
+ // hide
|
||||||
|
+ c->tags = 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (found) {
|
||||||
|
+ arrange(selmon);
|
||||||
|
+ } else {
|
||||||
|
+ spawnscratch(arg);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void
|
||||||
|
toggletag(const Arg *arg)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From a14d6da36f1a77cd73daf751828224dd407e78f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 6 Mar 2024 15:20:45 -0500
|
||||||
|
Subject: [PATCH 5/6] fix: edge case where there are more than 1 window with
|
||||||
|
the same scratchkey
|
||||||
|
|
||||||
|
---
|
||||||
|
dwl.c | 11 ++++++++++-
|
||||||
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index e179940..4c40f86 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -2534,18 +2534,26 @@ focusortogglematchingscratch(const Arg *arg)
|
||||||
|
{
|
||||||
|
Client *c;
|
||||||
|
unsigned int found = 0;
|
||||||
|
+ unsigned int hide = 0;
|
||||||
|
|
||||||
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (c->scratchkey == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c->scratchkey == ((char**)arg->v)[0][0]) {
|
||||||
|
- found = 1;
|
||||||
|
if (VISIBLEON(c, selmon)) {
|
||||||
|
+ if (found == 1) {
|
||||||
|
+ if (hide == 1) {
|
||||||
|
+ c->tags = 0;
|
||||||
|
+ focusclient(focustop(selmon), 1);
|
||||||
|
+ }
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
if (focustop(selmon) == c) {
|
||||||
|
// hide
|
||||||
|
c->tags = 0;
|
||||||
|
focusclient(focustop(selmon), 1);
|
||||||
|
+ hide = 1;
|
||||||
|
} else {
|
||||||
|
// focus
|
||||||
|
focusclient(c, 1);
|
||||||
|
@@ -2556,6 +2564,7 @@ focusortogglematchingscratch(const Arg *arg)
|
||||||
|
// focus
|
||||||
|
focusclient(c, 1);
|
||||||
|
}
|
||||||
|
+ found = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (VISIBLEON(c, selmon)) {
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 8d86b275615f4f6242828d2ce4606380ba309c58 Mon Sep 17 00:00:00 2001
|
||||||
|
From: wochap <gean.marroquin@gmail.com>
|
||||||
|
Date: Wed, 6 Mar 2024 15:22:24 -0500
|
||||||
|
Subject: [PATCH 6/6] add examples
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 0f672d4..3205165 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -125,7 +125,8 @@ static const Key keys[] = {
|
||||||
|
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
|
||||||
|
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
|
||||||
|
{ MODKEY, XKB_KEY_grave, togglescratch, {.v = scratchpadcmd } },
|
||||||
|
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
|
||||||
|
+ // { MODKEY, XKB_KEY_grave, focusortogglescratch, {.v = scratchpadcmd } },
|
||||||
|
+ // { MODKEY, XKB_KEY_grave, focusortogglematchingscratch, {.v = scratchpadcmd } },
|
||||||
|
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
|
||||||
|
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||||
|
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
From f8761928cc1eb5c9c694cf43cf6442579ea40150 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||||
|
<leohdz172@protonmail.com>
|
||||||
|
Date: Sun, 4 Apr 2021 19:56:09 -0500
|
||||||
|
Subject: [PATCH] add option to enable numlock/capslock
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||||
|
---
|
||||||
|
config.def.h | 4 ++++
|
||||||
|
dwl.c | 31 ++++++++++++++++++++++++++-----
|
||||||
|
2 files changed, 30 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index a8ed61d..87f91d7 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -56,6 +56,10 @@ static const struct xkb_rule_names xkb_rules = {
|
||||||
|
.options = NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
+/* numlock and capslock */
|
||||||
|
+static const int numlock = 1;
|
||||||
|
+static const int capslock = 0;
|
||||||
|
+
|
||||||
|
static const int repeat_rate = 25;
|
||||||
|
static const int repeat_delay = 600;
|
||||||
|
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index 10d5a5b..962748b 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
#include <wayland-server-core.h>
|
||||||
|
#include <wlr/backend.h>
|
||||||
|
#include <wlr/backend/libinput.h>
|
||||||
|
+#include <wlr/interfaces/wlr_keyboard.h>
|
||||||
|
#include <wlr/render/allocator.h>
|
||||||
|
#include <wlr/render/wlr_renderer.h>
|
||||||
|
#include <wlr/types/wlr_compositor.h>
|
||||||
|
@@ -336,6 +337,7 @@ static void zoom(const Arg *arg);
|
||||||
|
static const char broken[] = "broken";
|
||||||
|
static pid_t child_pid = -1;
|
||||||
|
static int locked;
|
||||||
|
+static uint32_t locked_mods = 0;
|
||||||
|
static void *exclusive_focus;
|
||||||
|
static struct wl_display *dpy;
|
||||||
|
static struct wlr_backend *backend;
|
||||||
|
@@ -768,6 +770,8 @@ createkeyboard(struct wlr_keyboard *keyboard)
|
||||||
|
wlr_keyboard_set_keymap(keyboard, kb_group.wlr_group->keyboard.keymap);
|
||||||
|
wlr_keyboard_set_repeat_info(keyboard, repeat_rate, repeat_delay);
|
||||||
|
|
||||||
|
+ wlr_keyboard_notify_modifiers(keyboard, 0, 0, locked_mods, 0);
|
||||||
|
+
|
||||||
|
/* Add the new keyboard to the group */
|
||||||
|
wlr_keyboard_group_add_keyboard(kb_group.wlr_group, keyboard);
|
||||||
|
}
|
||||||
|
@@ -2354,13 +2358,9 @@ setup(void)
|
||||||
|
XKB_KEYMAP_COMPILE_NO_FLAGS)))
|
||||||
|
die("failed to compile keymap");
|
||||||
|
|
||||||
|
+ wlr_seat_set_keyboard(seat, &kb_group.wlr_group->keyboard);
|
||||||
|
wlr_keyboard_set_keymap(&kb_group.wlr_group->keyboard, keymap);
|
||||||
|
wlr_keyboard_set_keymap(&vkb_group.wlr_group->keyboard, keymap);
|
||||||
|
- xkb_keymap_unref(keymap);
|
||||||
|
- xkb_context_unref(context);
|
||||||
|
-
|
||||||
|
- wlr_keyboard_set_repeat_info(&kb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
|
||||||
|
- wlr_keyboard_set_repeat_info(&vkb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
|
||||||
|
|
||||||
|
/* Set up listeners for keyboard events */
|
||||||
|
LISTEN(&kb_group.wlr_group->keyboard.events.key, &kb_group.key, keypress);
|
||||||
|
@@ -2368,6 +2368,27 @@ setup(void)
|
||||||
|
LISTEN(&vkb_group.wlr_group->keyboard.events.key, &vkb_group.key, keypress);
|
||||||
|
LISTEN(&vkb_group.wlr_group->keyboard.events.modifiers, &vkb_group.modifiers, keypressmod);
|
||||||
|
|
||||||
|
+ if (numlock) {
|
||||||
|
+ xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_NUM);
|
||||||
|
+ if (mod_index != XKB_MOD_INVALID)
|
||||||
|
+ locked_mods |= (uint32_t)1 << mod_index;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (capslock) {
|
||||||
|
+ xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keymap, XKB_MOD_NAME_CAPS);
|
||||||
|
+ if (mod_index != XKB_MOD_INVALID)
|
||||||
|
+ locked_mods |= (uint32_t)1 << mod_index;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (locked_mods)
|
||||||
|
+ wlr_keyboard_notify_modifiers(&kb_group.wlr_group->keyboard, 0, 0, locked_mods, 0);
|
||||||
|
+
|
||||||
|
+ xkb_keymap_unref(keymap);
|
||||||
|
+ xkb_context_unref(context);
|
||||||
|
+
|
||||||
|
+ wlr_keyboard_set_repeat_info(&kb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
|
||||||
|
+ wlr_keyboard_set_repeat_info(&vkb_group.wlr_group->keyboard, repeat_rate, repeat_delay);
|
||||||
|
+
|
||||||
|
kb_group.key_repeat_source = wl_event_loop_add_timer(
|
||||||
|
wl_display_get_event_loop(dpy), keyrepeat, &kb_group);
|
||||||
|
vkb_group.key_repeat_source = wl_event_loop_add_timer(
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
### 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)
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
### 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)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
From 6616470ef135019ef4c767003a66df76df45f53e 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 | 8 ++++++++
|
|
||||||
1 file changed, 8 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index 6f041a0..79ace52 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -472,6 +472,10 @@ 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;
|
|
||||||
+ }
|
|
||||||
setmon(c, mon, newtags);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1677,6 +1681,10 @@ mapnotify(struct wl_listener *listener, void *data)
|
|
||||||
* try to apply rules for them */
|
|
||||||
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.45.1
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
### 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)
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
### 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.
|
|
||||||
|
|
||||||
Behavior feels very intuitive as it doesn't disrupt existing masters no matter the amount of them, it only pushes the clients in stack down.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [git branch](https://codeberg.org/nikitaivanov/dwl/src/branch/attachtop)
|
|
||||||
- [2024-04-23](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/attachtop/attachtop.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [Nikita Ivanov](https://codeberg.org/nikitaivanov)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
### 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)
|
|
||||||
- [2024-06-07](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,154 +0,0 @@
|
|||||||
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
|
|
||||||
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 | 59 +++++++++++++++++++++++++++++++++++++++++++++++-----
|
|
||||||
2 files changed, 61 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
|
||||||
index 22d2171..8dc6502 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 5bf995e..e8b8727 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -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);
|
|
||||||
+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);
|
|
||||||
@@ -432,6 +433,9 @@ static xcb_atom_t netatom[NetLast];
|
|
||||||
/* attempt to encapsulate suck into one file */
|
|
||||||
#include "client.h"
|
|
||||||
|
|
||||||
+static pid_t *autostart_pids;
|
|
||||||
+static size_t autostart_len;
|
|
||||||
+
|
|
||||||
/* function implementations */
|
|
||||||
void
|
|
||||||
applybounds(Client *c, struct wlr_box *bbox)
|
|
||||||
@@ -580,6 +584,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)
|
|
||||||
{
|
|
||||||
@@ -676,11 +701,21 @@ checkidleinhibitor(struct wlr_surface *exclude)
|
|
||||||
void
|
|
||||||
cleanup(void)
|
|
||||||
{
|
|
||||||
+ size_t i;
|
|
||||||
#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);
|
|
||||||
@@ -1497,18 +1532,31 @@ void
|
|
||||||
handlesig(int signo)
|
|
||||||
{
|
|
||||||
if (signo == SIGCHLD) {
|
|
||||||
-#ifdef XWAYLAND
|
|
||||||
siginfo_t in;
|
|
||||||
/* wlroots expects to reap the XWayland process itself, so we
|
|
||||||
* use WNOWAIT to keep the child waitable until we know it's not
|
|
||||||
* XWayland.
|
|
||||||
*/
|
|
||||||
while (!waitid(P_ALL, 0, &in, WEXITED|WNOHANG|WNOWAIT) && in.si_pid
|
|
||||||
- && (!xwayland || in.si_pid != xwayland->server->pid))
|
|
||||||
- waitpid(in.si_pid, NULL, 0);
|
|
||||||
-#else
|
|
||||||
- while (waitpid(-1, NULL, WNOHANG) > 0);
|
|
||||||
+#ifdef XWAYLAND
|
|
||||||
+ && (!xwayland || in.si_pid != xwayland->server->pid)
|
|
||||||
#endif
|
|
||||||
+ ) {
|
|
||||||
+ pid_t *p, *lim;
|
|
||||||
+ waitpid(in.si_pid, NULL, 0);
|
|
||||||
+ if (in.si_pid == child_pid)
|
|
||||||
+ child_pid = -1;
|
|
||||||
+ if (!(p = autostart_pids))
|
|
||||||
+ continue;
|
|
||||||
+ lim = &p[autostart_len];
|
|
||||||
+
|
|
||||||
+ for (; p < lim; p++) {
|
|
||||||
+ if (*p == in.si_pid) {
|
|
||||||
+ *p = -1;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
} else if (signo == SIGINT || signo == SIGTERM) {
|
|
||||||
quit(NULL);
|
|
||||||
}
|
|
||||||
@@ -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 */
|
|
||||||
+ autostartexec();
|
|
||||||
if (startup_cmd) {
|
|
||||||
int piperw[2];
|
|
||||||
if (pipe(piperw) < 0)
|
|
||||||
--
|
|
||||||
2.45.2
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
### Description
|
|
||||||
Add a system tray next to the [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar). Heed the warning, this is far from suckless ^^
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Dependencies
|
|
||||||
- GTK4
|
|
||||||
- [bar.patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) as mentioned.
|
|
||||||
- [gtk4-layer-shell](https://github.com/wmww/gtk4-layer-shell)
|
|
||||||
- [statusnotifier-systray-gtk4](https://codeberg.org/janetski/statusnotifier-systray-gtk4) built as a static library.
|
|
||||||
|
|
||||||
### Applying the patch
|
|
||||||
The patch applies on top of the bar patch. That needs to be applied first.
|
|
||||||
|
|
||||||
The patch creates subdirectories `lib` and `include`. After patching, but before `make`, install
|
|
||||||
`libstatusnotifier-systray-gtk4.a` and `snsystray.h` from statusnotifier-systray-gtk4 in the
|
|
||||||
directories. One possible way to do that:
|
|
||||||
|
|
||||||
1. Clone [https://codeberg.org/janetski/statusnotifier-systray-gtk4](https://codeberg.org/janetski/statusnotifier-systray-gtk4). Can clone to any location.
|
|
||||||
2. From statusnotifier-systray-gtk4 root:
|
|
||||||
1. `$ meson setup --default-library=static --prefix=/ -Dgir=false -Dvala=false -Ddocs=false build`
|
|
||||||
2. `$ meson compile -C build`
|
|
||||||
3. `$ DESTDIR=$DWLDIR meson install -C build`, where $DWLDIR is the path to dwl root.
|
|
||||||
3. Finally, from dwl root, run `make`.
|
|
||||||
|
|
||||||
### Download
|
|
||||||
- [git branch](/janetski/dwl/src/branch/0.7-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)
|
|
||||||
@@ -1,398 +0,0 @@
|
|||||||
From 71f7b97dca2d781668e826aae7e06544958534f6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Janne=20Vetel=C3=A4inen?= <janne.vetelainen@elisanet.fi>
|
|
||||||
Date: Fri, 23 Aug 2024 18:39:17 +0300
|
|
||||||
Subject: [PATCH 1/1] Add a system tray next to the sewn's bar
|
|
||||||
|
|
||||||
---
|
|
||||||
Makefile | 8 +-
|
|
||||||
config.def.h | 2 +
|
|
||||||
dwl.c | 222 ++++++++++++++++++++++++++++++++++++++++++++-
|
|
||||||
include/.gitignore | 1 +
|
|
||||||
lib/.gitignore | 1 +
|
|
||||||
5 files changed, 225 insertions(+), 9 deletions(-)
|
|
||||||
create mode 100644 include/.gitignore
|
|
||||||
create mode 100644 lib/.gitignore
|
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
|
||||||
index 9bc67db..853b04c 100644
|
|
||||||
--- a/Makefile
|
|
||||||
+++ b/Makefile
|
|
||||||
@@ -7,14 +7,14 @@ include config.mk
|
|
||||||
DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L \
|
|
||||||
-DVERSION=\"$(VERSION)\" $(XWAYLAND)
|
|
||||||
DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement \
|
|
||||||
- -Wno-unused-parameter -Wshadow -Wunused-macros -Werror=strict-prototypes \
|
|
||||||
+ -Wno-unused-parameter -Wshadow -Wunused-macros \
|
|
||||||
-Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types \
|
|
||||||
-Wfloat-conversion
|
|
||||||
|
|
||||||
# CFLAGS / LDFLAGS
|
|
||||||
-PKGS = wlroots-0.18 wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS)
|
|
||||||
-DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS)
|
|
||||||
-LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
|
||||||
+PKGS = wlroots-0.18 wayland-server xkbcommon libinput pixman-1 fcft $(XLIBS) gtk4 gtk4-layer-shell-0
|
|
||||||
+DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS) -Iinclude
|
|
||||||
+LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS) -Llib -lstatusnotifier-systray-gtk4
|
|
||||||
|
|
||||||
all: dwl
|
|
||||||
dwl: dwl.o util.o
|
|
||||||
diff --git a/config.def.h b/config.def.h
|
|
||||||
index 5d1dc2b..bb9366f 100644
|
|
||||||
--- a/config.def.h
|
|
||||||
+++ b/config.def.h
|
|
||||||
@@ -11,6 +11,8 @@ 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 float rootcolor[] = COLOR(0x000000ff);
|
|
||||||
+static const int trayspacing = 4; /* Spacing between icons in system tray */
|
|
||||||
+static const int traymargins = 4; /* System tray inner margins */
|
|
||||||
/* 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 uint32_t colors[][3] = {
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index ece537a..24f550a 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -72,9 +72,22 @@
|
|
||||||
#include "util.h"
|
|
||||||
#include "drwl.h"
|
|
||||||
|
|
||||||
+#include <snsystray.h>
|
|
||||||
+#include <gdk/gdk.h>
|
|
||||||
+#include <gio/gio.h>
|
|
||||||
+#include <glib-object.h>
|
|
||||||
+#include <glib.h>
|
|
||||||
+#include <gtk/gtk.h>
|
|
||||||
+#include <gtk4-layer-shell.h>
|
|
||||||
+#include <pthread.h>
|
|
||||||
+
|
|
||||||
/* macros */
|
|
||||||
+#ifndef MAX
|
|
||||||
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
|
||||||
+#endif /* MAX */
|
|
||||||
+#ifndef MIN
|
|
||||||
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
|
||||||
+#endif /* MIN */
|
|
||||||
#define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS)
|
|
||||||
#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
|
|
||||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
|
||||||
@@ -324,6 +337,15 @@ static void focusstack(const Arg *arg);
|
|
||||||
static Client *focustop(Monitor *m);
|
|
||||||
static void fullscreennotify(struct wl_listener *listener, void *data);
|
|
||||||
static void gpureset(struct wl_listener *listener, void *data);
|
|
||||||
+static void gtkactivate(GtkApplication *app, void *data);
|
|
||||||
+static void gtkclosewindows(void *data, void *udata);
|
|
||||||
+static void gtkhandletogglebarmsg(void *data);
|
|
||||||
+static void gtkhandlewidthnotify(SnSystray *systray, GParamSpec *pspec, void *data);
|
|
||||||
+static void* gtkinit(void *data);
|
|
||||||
+static void gtkspawnstray(Monitor *m, GtkApplication *app);
|
|
||||||
+static void gtkterminate(void *data);
|
|
||||||
+static void gtktoggletray(void *data, void *udata);
|
|
||||||
+static GdkMonitor* gtkwlrtogdkmon(Monitor *wlrmon);
|
|
||||||
static void handlesig(int signo);
|
|
||||||
static void incnmaster(const Arg *arg);
|
|
||||||
static void inputdevice(struct wl_listener *listener, void *data);
|
|
||||||
@@ -380,7 +402,7 @@ static void unlocksession(struct wl_listener *listener, void *data);
|
|
||||||
static void unmaplayersurfacenotify(struct wl_listener *listener, void *data);
|
|
||||||
static void unmapnotify(struct wl_listener *listener, void *data);
|
|
||||||
static void updatemons(struct wl_listener *listener, void *data);
|
|
||||||
-static void updatebar(Monitor *m);
|
|
||||||
+static void updatebar(Monitor *m, int traywidth);
|
|
||||||
static void updatetitle(struct wl_listener *listener, void *data);
|
|
||||||
static void urgent(struct wl_listener *listener, void *data);
|
|
||||||
static void view(const Arg *arg);
|
|
||||||
@@ -394,6 +416,8 @@ static void zoom(const Arg *arg);
|
|
||||||
/* variables */
|
|
||||||
static const char broken[] = "broken";
|
|
||||||
static pid_t child_pid = -1;
|
|
||||||
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
+static pthread_t gtkthread; /* Gtk functions are only allowed to be called from this thread */
|
|
||||||
static int locked;
|
|
||||||
static void *exclusive_focus;
|
|
||||||
static struct wl_display *dpy;
|
|
||||||
@@ -1187,7 +1211,7 @@ createmon(struct wl_listener *listener, void *data)
|
|
||||||
|
|
||||||
m->scene_buffer = wlr_scene_buffer_create(layers[LyrBottom], NULL);
|
|
||||||
m->scene_buffer->point_accepts_input = baracceptsinput;
|
|
||||||
- updatebar(m);
|
|
||||||
+ updatebar(m, 0);
|
|
||||||
|
|
||||||
wl_list_insert(&mons, &m->link);
|
|
||||||
drawbars();
|
|
||||||
@@ -1518,6 +1542,8 @@ drawbar(Monitor *m)
|
|
||||||
if (!(buf = bufmon(m)))
|
|
||||||
return;
|
|
||||||
|
|
||||||
+ pthread_mutex_lock(&mutex);
|
|
||||||
+
|
|
||||||
/* 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]);
|
|
||||||
@@ -1566,6 +1592,7 @@ drawbar(Monitor *m)
|
|
||||||
m->m.y + (topbar ? 0 : m->m.height - m->b.real_height));
|
|
||||||
wlr_scene_buffer_set_buffer(m->scene_buffer, &buf->base);
|
|
||||||
wlr_buffer_unlock(&buf->base);
|
|
||||||
+ pthread_mutex_unlock(&mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
@@ -1710,6 +1737,174 @@ fullscreennotify(struct wl_listener *listener, void *data)
|
|
||||||
setfullscreen(c, client_wants_fullscreen(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
+void
|
|
||||||
+gtkactivate(GtkApplication *app, void *data)
|
|
||||||
+{
|
|
||||||
+ GdkDisplay *display;
|
|
||||||
+ GtkCssProvider *cssp;
|
|
||||||
+ char csss[64];
|
|
||||||
+ Monitor *m;
|
|
||||||
+ uint32_t bgcolor;
|
|
||||||
+
|
|
||||||
+ bgcolor = colors[SchemeNorm][1] >> 8;
|
|
||||||
+ display = gdk_display_get_default();
|
|
||||||
+ cssp = gtk_css_provider_new();
|
|
||||||
+ sprintf(csss, "window{background-color:#%06x;}", bgcolor);
|
|
||||||
+ gtk_css_provider_load_from_string(cssp, csss);
|
|
||||||
+ gtk_style_context_add_provider_for_display(display,
|
|
||||||
+ GTK_STYLE_PROVIDER(cssp),
|
|
||||||
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
|
|
||||||
+
|
|
||||||
+ wl_list_for_each(m, &mons, link)
|
|
||||||
+ gtkspawnstray(m, app);
|
|
||||||
+
|
|
||||||
+ g_object_unref(cssp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtkclosewindows(void *data, void *udata)
|
|
||||||
+{
|
|
||||||
+ GtkWindow *window = GTK_WINDOW(data);
|
|
||||||
+
|
|
||||||
+ gtk_window_close(window);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtkhandletogglebarmsg(void *data)
|
|
||||||
+{
|
|
||||||
+ GtkApplication *app;
|
|
||||||
+ GList *windows;
|
|
||||||
+
|
|
||||||
+ app = GTK_APPLICATION(g_application_get_default());
|
|
||||||
+ windows = gtk_application_get_windows(app);
|
|
||||||
+ g_list_foreach(windows, gtktoggletray, data);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtkhandlewidthnotify(SnSystray *systray, GParamSpec *pspec, void *data)
|
|
||||||
+{
|
|
||||||
+ Monitor *m = (Monitor *)data;
|
|
||||||
+ int traywidth;
|
|
||||||
+
|
|
||||||
+ traywidth = sn_systray_get_width(systray);
|
|
||||||
+
|
|
||||||
+ updatebar(m, traywidth);
|
|
||||||
+ drawbar(m);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void*
|
|
||||||
+gtkinit(void *data)
|
|
||||||
+{
|
|
||||||
+ GtkApplication *app = gtk_application_new("org.dwl.systray",
|
|
||||||
+ G_APPLICATION_NON_UNIQUE);
|
|
||||||
+ g_signal_connect(app, "activate", G_CALLBACK(gtkactivate), NULL);
|
|
||||||
+ g_application_run(G_APPLICATION(app), 0, NULL);
|
|
||||||
+
|
|
||||||
+ g_object_unref(app);
|
|
||||||
+
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtkspawnstray(Monitor *m, GtkApplication *app)
|
|
||||||
+{
|
|
||||||
+ GdkMonitor *gdkmon;
|
|
||||||
+ GtkWindow *window;
|
|
||||||
+ SnSystray *systray;
|
|
||||||
+ const char *conn;
|
|
||||||
+ gboolean anchors[4];
|
|
||||||
+ int iconsize, tray_init_width, tray_height;
|
|
||||||
+
|
|
||||||
+ gdkmon = gtkwlrtogdkmon(m);
|
|
||||||
+ if (gdkmon == NULL)
|
|
||||||
+ die("Failed to get gdkmon");
|
|
||||||
+
|
|
||||||
+ conn = gdk_monitor_get_connector(gdkmon);
|
|
||||||
+ iconsize = m->b.real_height - 2 * traymargins;
|
|
||||||
+ tray_height = m->b.real_height;
|
|
||||||
+ tray_init_width = m->b.real_height;
|
|
||||||
+
|
|
||||||
+ if (topbar) {
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_LEFT] = false;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_RIGHT] = true;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_TOP] = true;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_BOTTOM] = false;
|
|
||||||
+ } else {
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_LEFT] = false;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_RIGHT] = true;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_TOP] = false;
|
|
||||||
+ anchors[GTK_LAYER_SHELL_EDGE_BOTTOM] = true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ systray = sn_systray_new(iconsize,
|
|
||||||
+ traymargins,
|
|
||||||
+ trayspacing,
|
|
||||||
+ conn);
|
|
||||||
+ window = GTK_WINDOW(gtk_window_new());
|
|
||||||
+
|
|
||||||
+ gtk_window_set_default_size(window, tray_init_width, tray_height);
|
|
||||||
+ gtk_window_set_child(window, GTK_WIDGET(systray));
|
|
||||||
+ gtk_window_set_application(window, app);
|
|
||||||
+ gtk_layer_init_for_window(window);
|
|
||||||
+ gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM);
|
|
||||||
+ gtk_layer_set_exclusive_zone(window, -1);
|
|
||||||
+ gtk_layer_set_monitor(window, gdkmon);
|
|
||||||
+
|
|
||||||
+ for (int j = 0; j < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; j++) {
|
|
||||||
+ gtk_layer_set_anchor(window, j, anchors[j]);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ updatebar(m, tray_init_width);
|
|
||||||
+ g_signal_connect(systray, "notify::curwidth", G_CALLBACK(gtkhandlewidthnotify), m);
|
|
||||||
+ gtk_window_present(window);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtkterminate(void *data)
|
|
||||||
+{
|
|
||||||
+ GtkApplication *app;
|
|
||||||
+ GList *windows;
|
|
||||||
+
|
|
||||||
+ app = GTK_APPLICATION(g_application_get_default());
|
|
||||||
+ windows = gtk_application_get_windows(app);
|
|
||||||
+ g_list_foreach(windows, gtkclosewindows, NULL);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+GdkMonitor*
|
|
||||||
+gtkwlrtogdkmon(Monitor *wlrmon)
|
|
||||||
+{
|
|
||||||
+ GdkMonitor *gdkmon = NULL;
|
|
||||||
+
|
|
||||||
+ GListModel *gdkmons;
|
|
||||||
+ GdkDisplay *display;
|
|
||||||
+ const char *gdkname;
|
|
||||||
+ const char *wlrname;
|
|
||||||
+ unsigned int i;
|
|
||||||
+
|
|
||||||
+ wlrname = wlrmon->wlr_output->name;
|
|
||||||
+ display = gdk_display_get_default();
|
|
||||||
+ gdkmons = gdk_display_get_monitors(display);
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < g_list_model_get_n_items(gdkmons); i++) {
|
|
||||||
+ GdkMonitor *mon = g_list_model_get_item(gdkmons, i);
|
|
||||||
+ gdkname = gdk_monitor_get_connector(mon);
|
|
||||||
+ if (strcmp(wlrname, gdkname) == 0)
|
|
||||||
+ gdkmon = mon;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return gdkmon;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+gtktoggletray(void *data, void *udata)
|
|
||||||
+{
|
|
||||||
+ GtkWidget *widget = GTK_WIDGET(data);
|
|
||||||
+ int *pbarvisible = (int *)udata;
|
|
||||||
+ int barvisible = GPOINTER_TO_INT(pbarvisible);
|
|
||||||
+
|
|
||||||
+ gtk_widget_set_visible(widget, barvisible);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void
|
|
||||||
gpureset(struct wl_listener *listener, void *data)
|
|
||||||
{
|
|
||||||
@@ -2293,6 +2488,8 @@ powermgrsetmode(struct wl_listener *listener, void *data)
|
|
||||||
void
|
|
||||||
quit(const Arg *arg)
|
|
||||||
{
|
|
||||||
+ g_idle_add_once(gtkterminate, NULL);
|
|
||||||
+ pthread_join(gtkthread, NULL);
|
|
||||||
wl_display_terminate(dpy);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2836,6 +3033,9 @@ setup(void)
|
|
||||||
fprintf(stderr, "failed to setup XWayland X server, continuing without it\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
+
|
|
||||||
+ // Gtk functions are only allowed to be called from this thread.
|
|
||||||
+ pthread_create(>kthread, NULL, >kinit, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
@@ -2943,9 +3143,21 @@ tile(Monitor *m)
|
|
||||||
void
|
|
||||||
togglebar(const Arg *arg)
|
|
||||||
{
|
|
||||||
+ int barvisible;
|
|
||||||
+ int *pbarvisible;
|
|
||||||
+
|
|
||||||
wlr_scene_node_set_enabled(&selmon->scene_buffer->node,
|
|
||||||
!selmon->scene_buffer->node.enabled);
|
|
||||||
arrangelayers(selmon);
|
|
||||||
+
|
|
||||||
+ // Notify gtkthread
|
|
||||||
+ if (selmon->scene_buffer->node.enabled)
|
|
||||||
+ barvisible = 1;
|
|
||||||
+ else
|
|
||||||
+ barvisible = 0;
|
|
||||||
+
|
|
||||||
+ pbarvisible = GINT_TO_POINTER(barvisible);
|
|
||||||
+ g_idle_add_once(gtkhandletogglebarmsg, pbarvisible);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
@@ -3140,7 +3352,7 @@ updatemons(struct wl_listener *listener, void *data)
|
|
||||||
if (stext[0] == '\0')
|
|
||||||
strncpy(stext, "dwl-"VERSION, sizeof(stext));
|
|
||||||
wl_list_for_each(m, &mons, link) {
|
|
||||||
- updatebar(m);
|
|
||||||
+ updatebar(m, 0);
|
|
||||||
drawbar(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3155,7 +3367,7 @@ updatemons(struct wl_listener *listener, void *data)
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
-updatebar(Monitor *m)
|
|
||||||
+updatebar(Monitor *m, int traywidth)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
int rw, rh;
|
|
||||||
@@ -3163,7 +3375,7 @@ updatebar(Monitor *m)
|
|
||||||
|
|
||||||
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.real_width = (int)((float)m->b.width / m->wlr_output->scale) - traywidth;
|
|
||||||
|
|
||||||
wlr_scene_node_set_enabled(&m->scene_buffer->node, m->wlr_output->enabled ? showbar : 0);
|
|
||||||
|
|
||||||
diff --git a/include/.gitignore b/include/.gitignore
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..424c745
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/include/.gitignore
|
|
||||||
@@ -0,0 +1 @@
|
|
||||||
+*.h
|
|
||||||
diff --git a/lib/.gitignore b/lib/.gitignore
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..10301e2
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/lib/.gitignore
|
|
||||||
@@ -0,0 +1 @@
|
|
||||||
+*.a
|
|
||||||
--
|
|
||||||
2.46.0
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,33 +0,0 @@
|
|||||||
### 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.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 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.
|
Before Width: | Height: | Size: 3.4 KiB |
@@ -1,10 +0,0 @@
|
|||||||
### 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)
|
|
||||||
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
### 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)
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
From 16f4f7cdc4ca9253a5bf97ee0e2ce5afd666fbbb 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] applied barcolors patch
|
|
||||||
|
|
||||||
---
|
|
||||||
dwl.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
|
|
||||||
1 file changed, 83 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dwl.c b/dwl.c
|
|
||||||
index ece537a..50d6ead 100644
|
|
||||||
--- a/dwl.c
|
|
||||||
+++ b/dwl.c
|
|
||||||
@@ -318,6 +318,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 +449,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 +1520,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 +1575,85 @@ 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 (*p == '^') {
|
|
||||||
+ p++;
|
|
||||||
+ if (!strncmp(p, "fg(", 3) || !strncmp(p, "bg(", 3)) {
|
|
||||||
+ argend = strchr(p, ')');
|
|
||||||
+ if (!argend)
|
|
||||||
+ argend = p + 2;
|
|
||||||
+ p = argend;
|
|
||||||
+ } else if (*p == '^') {
|
|
||||||
+ strncat(rstext, p, 1);
|
|
||||||
+ } else {
|
|
||||||
+ strncat(rstext, p - 1, 2);
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ strncat(rstext, p, 1);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ tw = TEXTW(m, rstext) - m->lrpad + 2; /* 2px right padding */
|
|
||||||
+
|
|
||||||
+ 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 (*p == '^') {
|
|
||||||
+ p++;
|
|
||||||
+ if (!strncmp(p, "fg(", 3) || !strncmp(p, "bg(", 3)) {
|
|
||||||
+ *(p - 1) = '\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 - 1) = '^';
|
|
||||||
+
|
|
||||||
+ argstart = p + 3;
|
|
||||||
+ argend = strchr(argstart, ')');
|
|
||||||
+ if (!argend) argend = argstart - 1;
|
|
||||||
+ itext = argend + 1;
|
|
||||||
+
|
|
||||||
+ if (!strncmp(p, "fg(", 3)) /* foreground */
|
|
||||||
+ color = &scheme[0];
|
|
||||||
+ else /* background */
|
|
||||||
+ color = &scheme[1];
|
|
||||||
+
|
|
||||||
+ if (argend - argstart > 0) {
|
|
||||||
+ *argend = '\0';
|
|
||||||
+ *color = strtoul(argstart, NULL, 16);
|
|
||||||
+ *color = *color << 8 | 0xff; /* add alpha channel */
|
|
||||||
+ *argend = ')';
|
|
||||||
+ } else {
|
|
||||||
+ *color = 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* 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];
|
|
||||||
+
|
|
||||||
+ 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.46.0
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
### 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)
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
### 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)
|
|
||||||
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
### 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,27 +0,0 @@
|
|||||||
### 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,106 +0,0 @@
|
|||||||
### 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.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Why btrtile
|
|
||||||
|
|
||||||
While dwl’s 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 client’s 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) you’re interacting with.
|
|
||||||
2. **Split Creation**
|
|
||||||
- If there’s 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 Doesn’t Handle
|
|
||||||
|
|
||||||
- **Multi-Tag client Management**
|
|
||||||
btrtile intentionally reverts clients to a single tag if they span multiple tags. This prevents potential inconsistencies or duplicate entries in its per-tag client tree.
|
|
||||||
- If you attempt to place a single client on multiple tags while using the btrtile layout, btrtile will enforce a single-tag assignment to maintain stability.
|
|
||||||
|
|
||||||
- **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
|
|
||||||
- [0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/btrtile/btrtile-v0.7.patch)
|
|
||||||
- [0.7 WITH gapps](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/btrtile/btrtile-v0.7-gapps.patch)
|
|
||||||
|
|
||||||
### Authors
|
|
||||||
- [julmajustus](https://codeberg.org/julmajustus)
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 13 MiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user