commit 0d61ae7

wf  ·  2026-05-12 10:54:04 +0000 UTC
parent 13ef4c7
Add modes to list_windows, fix fullscreen
4 files changed,  +112, -66
+62, -60
  1@@ -1,6 +1,6 @@
  2 .\" generated with Ronn-NG/v0.10.1
  3 .\" http://github.com/apjanke/ronn-ng/tree/0.10.1
  4-.TH "HOWLC" "1" "April 2026" ""
  5+.TH "HOWLC" "1" "May 2026" ""
  6 .SH "NAME"
  7 \fBhowlc\fR \- client to control the howl compositor
  8 .SH "SYNOPSIS"
  9@@ -8,91 +8,80 @@
 10 .SH "DESCRIPTION"
 11 \fBhowlc\fR is a client that controls the howl(1) compositor\.
 12 .SH "COMMANDS"
 13-.TP
 14-\fBmove\fR, \fBmove_absolute\fR
 15-Will move the window relative to either its current position or to the top left corner of the screen\. Arguments are in the form of pairs of x and y integer coordinates\.
 16+.IP "\(bu" 4
 17+\fBmove\fR, \fBmove_absolute\fR: Will move the window relative to either its current position or to the top left corner of the screen\. Arguments are in the form of pairs of x and y integer coordinates\.
 18 .IP
 19 Example:
 20 .IP
 21 $ howlc move 20 \-40
 22 .IP
 23 $ howlc move_absolute 300 300
 24-.TP
 25-\fBresize\fR, \fBresize_absolute\fR
 26-Will resize the window relative to either its current position or the top left corner of the screen\. Arguments are in the form of pairs of w and h integers\.
 27+.IP "\(bu" 4
 28+\fBresize\fR, \fBresize_absolute\fR: Will resize the window relative to either its current position or the top left corner of the screen\. Arguments are in the form of pairs of w and h integers\.
 29 .IP
 30 Example:
 31 .IP
 32 $ howlc resize 20 \-40
 33 .IP
 34 $ howlc resize_absolute 300 300
 35-.TP
 36-\fBteleport\fR
 37-Will "teleport" (move and resize) the window to the coordinates specified, in the format of x, y, w and h\.
 38+.IP "\(bu" 4
 39+\fBteleport\fR: Will "teleport" (move and resize) the window to the coordinates specified, in the format of x, y, w and h\.
 40 .IP
 41 Example:
 42 .IP
 43 $ howlc teleport 50 25 200 250
 44-.TP
 45-\fBcenter\fR
 46-Will position the window in the center of the screen\.
 47+.IP "\(bu" 4
 48+\fBcenter\fR: Will position the window in the center of the screen\.
 49 .IP
 50 Example:
 51 .IP
 52 $ howlc center
 53-.TP
 54-\fBfullscreen\fR
 55-Will resize the window to the screen size\.
 56+.IP "\(bu" 4
 57+\fBfullscreen\fR: Will resize the window to the screen size\.
 58 .IP
 59 Example:
 60 .IP
 61 $ howlc fullscreen
 62-.TP
 63-\fBhide\fR, \fBshow\fR
 64-Hide/show the current window\. Currently these don't have much use\.
 65+.IP "\(bu" 4
 66+\fBhide\fR, \fBshow\fR: Hide/show the current window\. Currently these don't have much use\.
 67 .IP
 68 Example:
 69 .IP
 70 $ howlc hide
 71 .IP
 72 $ howlc show
 73-.TP
 74-\fBfocus_prev\fR, \fBfocus_next\fR
 75-Focus the previous/next window\.
 76+.IP "\(bu" 4
 77+\fBfocus_prev\fR, \fBfocus_next\fR: Focus the previous/next window\.
 78 .IP
 79 Example:
 80 .IP
 81 $ howlc focus_prev
 82 .IP
 83 $ howlc focus_next
 84-.TP
 85-\fBlower\fR, \fBraise\fR
 86-Lower/raise the window's stack order\.
 87+.IP "\(bu" 4
 88+\fBlower\fR, \fBraise\fR: Lower/raise the window's stack order\.
 89 .IP
 90 Example:
 91 .IP
 92 $ howlc lower
 93 .IP
 94 $ howlc raise
 95-.TP
 96-\fBclose\fR
 97-Closes the window\.
 98+.IP "\(bu" 4
 99+\fBclose\fR: Closes the window\.
100 .IP
101 Example:
102 .IP
103 $ howlc close
104-.TP
105-\fBworkspace\fR, \fBmove_workspace\fR
106-Switch, or move the current window, to the specified workspace\. Argument is a single integer representing the workspace number\.
107+.IP "\(bu" 4
108+\fBworkspace\fR, \fBmove_workspace\fR: Switch, or move the current window, to the specified workspace\. Argument is a single integer representing the workspace number\.
109 .IP
110 Example:
111 .IP
112 $ howlc workspace 3
113 .IP
114 $ howlc move_workspace 6
115-.TP
116-\fBget_geometry\fR, \fBget_pid\fR, \fBget_title\fR, \fBget_app_id\fR
117-Print the current window's geometry (in x, y, w and h), process ID, title or app ID\.
118+.IP "\(bu" 4
119+\fBget_geometry\fR, \fBget_pid\fR, \fBget_title\fR, \fBget_app_id\fR: Print the current window's geometry (in x, y, w and h), process ID, title or app ID\.
120 .IP
121 Example:
122 .IP
123@@ -111,31 +100,28 @@ Example
124 $ howlc get_app_id
125 .br
126 example
127-.TP
128-\fBget_screen_geometry\fR
129-Print the current screen's width and height\.
130+.IP "\(bu" 4
131+\fBget_screen_geometry\fR: Print the current screen's width and height\.
132 .IP
133 Example:
134 .IP
135 $ howlc get_screen_geometry
136 .br
137 1920 1080
138-.TP
139-\fBlist_windows\fR
140-Print a list of currently open windows (both visible and invisible)\.
141+.IP "\(bu" 4
142+\fBlist_windows\fR: Print a list of currently open windows\. By default only mapped windows are listed, but \fB\-u\fR can be specified as an option to list only unmapped windows, and \fB\-a\fR can be specified to list all windows\.
143 .IP
144 Example:
145 .IP
146-$ howlc list_windows
147+$ howlc list_windows \-u
148 .br
149 0
150 .br
151 21
152 .br
153 25
154-.TP
155-\fBbind\fR
156-Create a key binding\. Arguments are in the form of a list of keys and the command to execute, see the \fIBINDINGS\fR section for more info\.
157+.IP "\(bu" 4
158+\fBbind\fR: Create a key binding\. Arguments are in the form of a list of keys and the command to execute, see the \fIBINDINGS\fR section for more info\.
159 .IP
160 Example:
161 .IP
162@@ -146,40 +132,56 @@ $ howlc bind mod+shift+g "example_command"
163 # Bind Win+4 to switch to the 4th workspace
164 .br
165 $ howlc bind win+4 "howlc workspace 4"
166-.TP
167-\fBmodkey\fR
168-Configure the modifier key\. This can be then used as an alias in keybindings, like so: \fBmod+key\fR\. See the \fIBINDINGS\fR section for allowed values\.
169+.IP "\(bu" 4
170+\fBmodkey\fR: Configure the modifier key\. This can be then used as an alias in keybindings, like so: \fBmod+key\fR\. See the \fIBINDINGS\fR section for allowed values\.
171 .IP
172 Example:
173 .IP
174 $ howlc modkey alt
175 .IP
176 $ howlc modkey win+ctrl
177-.TP
178-\fBfocus_color\fR, \fBunfocus_color\fR
179-Set the focused and unfocused colors of the window borders\. Arguments are in the format of #RRGGBB, where the leading pound sign is optional\. Note that in the format of #RRGGBB, the argument needs to be quoted, since the pound sign (#) is a special one in most shells\.
180+.IP "\(bu" 4
181+\fBinner_focus_color\fR, \fBinner_unfocus_color\fR, \fBinner_unfocus_color\fR, \fBouter_unfocus_color\fR: Set the inner/outer focused and unfocused colors of the window borders\. Arguments are in the format of #RRGGBB, where the leading pound sign is optional\. Note that in the format of #RRGGBB, the argument needs to be quoted, since the pound sign (#) is a special one in most shells\.
182 .IP
183 Example:
184 .IP
185-$ howlc focus_color "#f03937"
186+$ howlc outer_focus_color "#f03937"
187 .IP
188-$ howlc unfocus_color eeeeee
189-.TP
190-\fBborder_width\fR
191-Set the window's border width\. Argument is a single integer representing the new border width\.
192+$ howlc inner_unfocus_color eeeeee
193+.IP "\(bu" 4
194+\fBinner_border_width\fR, \fBouter_border_width\fR: Set the window's inner/outer border width\. Argument is a single integer representing the new border width\.
195 .IP
196 Example:
197 .IP
198-$ howlc border_width 4
199+$ howlc inner_border_width 4
200 .IP
201-$ howlc border_width 0
202-.TP
203-\fBquit\fR
204-Quit the compositor\.
205+$ howlc outer_border_width 0
206+.IP "\(bu" 4
207+\fBtitle_format\fR: Set the format for the text displayed in window titlebars\. Currently accepted specifiers are:
208+.IP "\(bu" 4
209+\fB%t\fR \- window title
210+.IP "\(bu" 4
211+\fB%a\fR \- window app ID
212+.IP "\(bu" 4
213+\fB%p\fR \- window PID
214+.IP "" 0
215+.IP
216+Example:
217+.IP
218+$ howlc title_format '%t %p'
219+.IP "\(bu" 4
220+\fBset_decor\fR: Set the current window decoration theme\. Argument is a path (absolute or relative) to the directory containing the theme\. See decor\.c on the format of themes\.
221+.IP
222+Example:
223+.IP
224+$ howlc set_decor ~/etc/decorations/theme
225+.IP "\(bu" 4
226+\fBquit\fR: Quit the compositor\.
227 .IP
228 Example:
229 .IP
230 $ howlc quit
231+.IP "" 0
232 .SH "BINDINGS"
233 The format for keybindings is the following:
234 .P
+2, -2
 1@@ -125,11 +125,11 @@ howlc(1) -- client to control the howl compositor
 2     1920 1080
 3 
 4   * `list_windows`:
 5-    Print a list of currently open windows (both visible and invisible).
 6+    Print a list of currently open windows. By default only mapped windows are listed, but `-u` can be specified as an option to list only unmapped windows, and `-a` can be specified to list all windows.
 7 
 8     Example:
 9 
10-    $ howlc list_windows<br>
11+    $ howlc list_windows -u<br>
12     0<br>
13     21<br>
14     25
+1, -1
1@@ -642,7 +642,7 @@ new_window(struct swc_window *win) {
2 
3 	c->win        = win;
4 	c->scr        = wm.scr;
5-	c->visible    = false;
6+	c->visible    = true;
7 	c->fullscreen = false;
8 	c->ws         = wm.ws;
9 	c->x          = 0;
+47, -3
 1@@ -198,11 +198,11 @@ ipc_fullscreen(char **arg) {
 2 
 3 	struct swc_rectangle geom;
 4 
 5-	if (wm.cur->fullscreen) {
 6+	if (c->fullscreen) {
 7 		c->fullscreen = false;
 8 		swc_window_set_stacked(c->win);
 9 
10-		if (c->width > 0 & c->height > 0) {
11+		if (c->width > 0 && c->height > 0) {
12 			geom.x = c->x;
13 			geom.y = c->y;
14 			geom.width = c->width;
15@@ -233,6 +233,7 @@ ipc_hide(char **arg) {
16 	ARG_CLIENT(arg[1]);
17 
18 	swc_window_hide(c->win);
19+	c->visible = false;
20 
21 	return (status){ true, "" };
22 }
23@@ -242,6 +243,7 @@ ipc_show(char **arg) {
24 	ARG_CLIENT(arg[1]);
25 
26 	swc_window_show(c->win);
27+	c->visible = true;
28 
29 	return (status){ true, "" };
30 }
31@@ -392,11 +394,53 @@ status
32 ipc_list_windows(char **arg) {
33 	status s = {0};
34 
35+	enum {
36+		LIST_MAPPED,
37+		LIST_UNMAPPED,
38+		LIST_ALL
39+	} mode = LIST_MAPPED;
40+
41+	if (arg[1]) {
42+		if ((strcmp(arg[1], "-m")) == 0)
43+			mode = LIST_MAPPED;
44+		else if ((strcmp(arg[1], "-u")) == 0)
45+			mode = LIST_UNMAPPED;
46+		else if ((strcmp(arg[1], "-a")) == 0)
47+			mode = LIST_ALL;
48+	}
49+
50 	if (!wl_list_empty(&wm.clients)) {
51 		size_t o = 0;
52 		struct client *c;
53-		wl_list_for_each(c, &wm.clients, link)
54+
55+		// o += snprintf(s.msg + o, sizeof(s.msg) - o, "%" PRIu32 "\n", c->id);
56+
57+		wl_list_for_each(c, &wm.clients, link) {
58+			bool list = false;
59+			switch (mode) {
60+				case LIST_MAPPED: {
61+					_inf("mapped");
62+					list = c->visible;
63+					break;
64+				}
65+				case LIST_UNMAPPED: {
66+					_inf("unmapped");
67+					list = !c->visible;
68+					break;
69+				}
70+				case LIST_ALL: {
71+					_inf("all");
72+					list = true;
73+					break;
74+				}
75+			}
76+			if (!list)
77+				continue;
78+
79+			_inf("yo we finna print bra. id=%" PRIu32, c->id);
80 			o += snprintf(s.msg + o, sizeof(s.msg) - o, "%" PRIu32 "\n", c->id);
81+			_inf("yo we done bra. id=%" PRIu32, c->id);
82+		}
83 	}
84 
85 	s.ok = true;