summaryrefslogtreecommitdiff
path: root/dwl/dwl-patches/patches/modes/README.md
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwl/dwl-patches/patches/modes/README.md
Diffstat (limited to 'dwl/dwl-patches/patches/modes/README.md')
-rwxr-xr-xdwl/dwl-patches/patches/modes/README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/dwl/dwl-patches/patches/modes/README.md b/dwl/dwl-patches/patches/modes/README.md
new file mode 100755
index 0000000..c855af9
--- /dev/null
+++ b/dwl/dwl-patches/patches/modes/README.md
@@ -0,0 +1,35 @@
+### Description
+Implement modes, that way each mapping is associated with a mode and is only active while in that mode, default mode is `NORMAL`
+
+### Example
+
+In the example below, you declare a mode: `BROWSER`, which is activated when you press <kbd>modkey</kbd> + <kbd>b</kbd>. Then, you can press <kbd>f</kbd> to launch `Firefox` and return to the default `NORMAL` mode.
+
+```c
+enum {
+ BROWSER,
+};
+const char *modes_labels[] = {
+ "browser",
+};
+
+static const Key keys[] = {
+ // ...
+ { MODKEY, XKB_KEY_b, entermode, {.i = BROWSER} },
+ // ...
+};
+
+static const Modekey modekeys[] = {
+ /* mode modifier key function argument */
+ { BROWSER, { 0, XKB_KEY_f, spawn, SHCMD("firefox") } },
+ { BROWSER, { 0, XKB_KEY_f, entermode, {.i = NORMAL} } },
+ { BROWSER, { 0, XKB_KEY_Escape, entermode, {.i = NORMAL} } },
+};
+```
+
+### Download
+- [git branch](https://codeberg.org/wochap/dwl/src/branch/v0.5/modes)
+- [v0.5](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/modes/modes.patch)
+
+### Authors
+- [wochap](https://codeberg.org/wochap)