riverctl patch: change README.md to try to match the README standards.

This commit is contained in:
Zuki Air 2025-07-29 12:26:02 +01:00
parent b46762bb3f
commit 89880aeefa
2 changed files with 42 additions and 40 deletions

View File

@ -0,0 +1,42 @@
### Description
This patch adds river-control-unstable-v1 support to dwl.
This protocol allows sending args to dwl to execute functions via the included dwlctl.
This is used to allow changing rules and binds, at runtime via dwlctl.
Most of this patch is stored in river-control.h, It contains a list of functions which can be called via dwlctl so adding support for new functions is as simple as adding them to the list.
Also Note this is also the case for keys in keybinds so you may need to modify that list as well if you use a layout that uses a diffrent keycode, or just a key not included in that list.
This patches main intended use case is to have a startup script that calls dwlctl a bunch to add all the binds/rules you want, without the need of restarting dwl if you make any changes to the list of binds/rules.
### dwlctl syntax example
```
dwlctl clear-binds
dwlctl bind super,shift Return spawn kitty tmux
dwlctl bind supershift q killclient
dwlctl clear-rules
dwlctl rule-add -appid steam -title steam float tags $((1 << 2))
dwlctl rule-add -appid kitty float
dwlctl rule-add -title firefox float
dwlctl spawn kitty tmux
dwlctl setlayout 2
dwlctl togglefullscreen
```
### Download
- [git branch](/zuki/dwl-ctl/src/main)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/riverctl/riverctl.patch)
- [main 2025-07-29](/dwl/dwl-patches/raw/branch/main/patches/riverctl/riverctl.patch)
### Authors - latest at top [Codeberg nick is mandatory; other contact methods optional]
- [zuki](https://codeberg.org/zuki)
zukirust@gmail.com
zuki at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl)
#zukigay at [dwl Discord](https://discord.gg/jJxZnrGPWN)

View File

@ -1,40 +0,0 @@
build for dwl-git commit 15bfffd8
This patch adds river-control-unstable-v1 support to dwl, allowing changing dwl settings on the fly via dwlctl.
dwlctl is a small wayland program included with this patch that can sends arguments to dwl which then passes those to functions allowing the user to run any function they define in the horrably named `Func_str_type_pair_list` array.
This patch also changes binds and rules to use a linked list internally and adds functionality for dwlctl to create new binds and rules at runtime and clear all rules/binds that were added at runtime. (syntax examples bellow)
I use this dynamic bind/rule functionality to have almost all of my keybinds and rules defined in a shell script run at dwl's startup that calls dwlctl a bunch.
I recommend that if you do the same to have `dwlctl clear-binds` and `dwlctl clear-rules` at the start of your script since binds with the same mod and key don't fully replace each other, although rules with the EXACT same appid and title will by defualt.
Also Note that for keybinds only keys listed in `Keysym_str_pair_list` are supported so if a setting a keybind via dwlctl isn't worked check if the key is in there, if not add it.
example commands for using dwlctl with dwl:
Remember that support for any function can be added by just adding that function to the `Func_str_type_pair_list` array.
```
dwlctl clear-binds
dwlctl bind super,shift Return spawn kitty tmux
dwlctl bind supershift q killclient
dwlctl clear-rules
dwlctl rule-add -appid steam -title steam float tags $((1 << 2))
dwlctl rule-add -appid kitty float
dwlctl rule-add -title firefox float
dwlctl spawn kitty tmux
dwlctl setlayout 2
dwlctl togglefullscreen
```