mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-12-17 02:13:21 +00:00
update riverctl patch to make clear-binds and clear-rules functions part of func list rather then special cases
This commit is contained in:
parent
a23d17409d
commit
efde7ce68e
@ -1,4 +1,4 @@
|
|||||||
From b00dde5efc0c13a9cc0637bcb8ccca91a78c747a Mon Sep 17 00:00:00 2001
|
From ba4bc854ec0e39030cde295e5019e56f598472b2 Mon Sep 17 00:00:00 2001
|
||||||
From: Zuki Air <zukirust@gmail.com>
|
From: Zuki Air <zukirust@gmail.com>
|
||||||
Date: Sun, 27 Jul 2025 11:30:32 +0100
|
Date: Sun, 27 Jul 2025 11:30:32 +0100
|
||||||
Subject: [PATCH] river-ctl patch
|
Subject: [PATCH] river-ctl patch
|
||||||
@ -11,8 +11,8 @@ remove func argument and use the root argument instead
|
|||||||
dwl.c | 20 +-
|
dwl.c | 20 +-
|
||||||
dwlctl.c | 132 +++++
|
dwlctl.c | 132 +++++
|
||||||
protocols/river-control-unstable-v1.xml | 85 +++
|
protocols/river-control-unstable-v1.xml | 85 +++
|
||||||
river-control.h | 717 ++++++++++++++++++++++++
|
river-control.h | 715 ++++++++++++++++++++++++
|
||||||
7 files changed, 996 insertions(+), 15 deletions(-)
|
7 files changed, 994 insertions(+), 15 deletions(-)
|
||||||
create mode 100644 dwlctl.c
|
create mode 100644 dwlctl.c
|
||||||
create mode 100644 protocols/river-control-unstable-v1.xml
|
create mode 100644 protocols/river-control-unstable-v1.xml
|
||||||
create mode 100644 river-control.h
|
create mode 100644 river-control.h
|
||||||
@ -437,15 +437,17 @@ index 0000000..aa5fc4d
|
|||||||
+</protocol>
|
+</protocol>
|
||||||
diff --git a/river-control.h b/river-control.h
|
diff --git a/river-control.h b/river-control.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..a2ec549
|
index 0000000..297a47e
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/river-control.h
|
+++ b/river-control.h
|
||||||
@@ -0,0 +1,717 @@
|
@@ -0,0 +1,715 @@
|
||||||
+#include "river-control-unstable-v1-private-protocol.c"
|
+#include "river-control-unstable-v1-private-protocol.c"
|
||||||
+#include "river-control-unstable-v1-protocol.h"
|
+#include "river-control-unstable-v1-protocol.h"
|
||||||
+#ifdef KEYS_USED
|
+#ifdef KEYS_USED
|
||||||
+void default_binds(void);
|
+void default_binds(void);
|
||||||
+#endif
|
+#endif
|
||||||
|
+void clear_rules(const Arg*);
|
||||||
|
+void clear_binds(const Arg*);
|
||||||
+// TODO add dynamic rules then its fully complete!
|
+// TODO add dynamic rules then its fully complete!
|
||||||
+struct wl_list arg_str_store;
|
+struct wl_list arg_str_store;
|
||||||
+struct wl_list rule_str_store;
|
+struct wl_list rule_str_store;
|
||||||
@ -490,6 +492,8 @@ index 0000000..a2ec549
|
|||||||
+#define STR(a,b) \
|
+#define STR(a,b) \
|
||||||
+ { a, b, #a }
|
+ { a, b, #a }
|
||||||
+struct Func_str_type_pair Func_str_type_pair_list[] = {
|
+struct Func_str_type_pair Func_str_type_pair_list[] = {
|
||||||
|
+ { clear_binds, FUNC_STR_ARG_TYPE_NONE, "clear-binds" },
|
||||||
|
+ { clear_rules, FUNC_STR_ARG_TYPE_NONE, "clear-rules" },
|
||||||
+ STR(setlayout,FUNC_STR_ARG_TYPE_LAYOUT),
|
+ STR(setlayout,FUNC_STR_ARG_TYPE_LAYOUT),
|
||||||
+ STR(spawn,FUNC_STR_ARG_TYPE_STRING_ARRAY),
|
+ STR(spawn,FUNC_STR_ARG_TYPE_STRING_ARRAY),
|
||||||
+ STR(focusstack,FUNC_STR_ARG_TYPE_INT),
|
+ STR(focusstack,FUNC_STR_ARG_TYPE_INT),
|
||||||
@ -744,7 +748,7 @@ index 0000000..a2ec549
|
|||||||
+ wl_list_init(&rule_str_store);
|
+ wl_list_init(&rule_str_store);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
+void clear_rules(void) {
|
+void clear_rules(const Arg* arg) {
|
||||||
+ Rule_linked *rl,*tmp_rl;
|
+ Rule_linked *rl,*tmp_rl;
|
||||||
+
|
+
|
||||||
+ wl_list_for_each_safe(rl,tmp_rl,&rules_list,link) {
|
+ wl_list_for_each_safe(rl,tmp_rl,&rules_list,link) {
|
||||||
@ -756,7 +760,6 @@ index 0000000..a2ec549
|
|||||||
+ free(rl);
|
+ free(rl);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ clear_str_store(&rule_str_store);
|
|
||||||
+}
|
+}
|
||||||
+void setup_binds(void) {
|
+void setup_binds(void) {
|
||||||
+ Key *k;
|
+ Key *k;
|
||||||
@ -794,7 +797,7 @@ index 0000000..a2ec549
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
+#endif
|
+#endif
|
||||||
+void clear_binds(void) {
|
+void clear_binds(const Arg* arg) {
|
||||||
+ Key_linked *kl,*tmp_kl;
|
+ Key_linked *kl,*tmp_kl;
|
||||||
+
|
+
|
||||||
+ wl_list_for_each_safe(kl,tmp_kl,&keys_list,link) {
|
+ wl_list_for_each_safe(kl,tmp_kl,&keys_list,link) {
|
||||||
@ -806,7 +809,6 @@ index 0000000..a2ec549
|
|||||||
+ free(kl);
|
+ free(kl);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ clear_str_store(&arg_str_store);
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+void zriver_control_add_argument(struct wl_client *client,
|
+void zriver_control_add_argument(struct wl_client *client,
|
||||||
@ -855,10 +857,6 @@ index 0000000..a2ec549
|
|||||||
+ args->error = true;
|
+ args->error = true;
|
||||||
+ args->error_msg = zriver_error_alloc;
|
+ args->error_msg = zriver_error_alloc;
|
||||||
+ }
|
+ }
|
||||||
+ } else if (strcmp("clear-binds",argument) == 0 ) {
|
|
||||||
+ clear_binds();
|
|
||||||
+ } else if (strcmp("clear-rules",argument) == 0 ) {
|
|
||||||
+ clear_rules();
|
|
||||||
+ } else {
|
+ } else {
|
||||||
+ for (fst = Func_str_type_pair_list; fst < END(Func_str_type_pair_list); fst++) {
|
+ for (fst = Func_str_type_pair_list; fst < END(Func_str_type_pair_list); fst++) {
|
||||||
+ if (strcmp(argument,fst->func_str) == 0) {
|
+ if (strcmp(argument,fst->func_str) == 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user