</font>
</theme>
- <!--
- Just as for window-rules, 'identifier' relates to app_id for native Wayland
- windows and WM_CLASS for XWayland clients.
- -->
<windowSwitcher show="yes" preview="yes" outlines="yes" allWorkspaces="no">
<fields>
- <field content="type" width="25%" />
- <field content="trimmed_identifier" width="25%" />
- <!-- <field content="identifier" width="25%" /> -->
- <field content="title" width="50%" />
+ <field content="icon" width="5%" />
+ <field content="desktop_entry_name" width="30%" />
+ <field content="title" width="65%" />
+ <!--
+ Just as for window-rules, you can use 'identifier' or
+ 'trimmed_identifier' to show the app_id for native wayland clients or
+ WM_CLASS for XWayland clients.
+
+ <field content="trimmed_identifier" width="65%" />
+ -->
</fields>
</windowSwitcher>
<!--
- When using all workspaces option of window switcher, there are extra fields
- that can be used, workspace (variable length), state (single space),
- type_short (3 spaces), output (variable length), and can be set up
- like this. Note: output only shows if more than one output available.
+ We support many other kinds of contents in the window switcher like below.
+ Some contents are fixed-length and others are variable-length.
+ See "man 5 labwc" for details.
<windowSwitcher show="yes" preview="no" outlines="no" allWorkspaces="yes">
<fields>
custom format - (introduced in 0.7.2)
It allows one to replace all the above "fields" with one line, using a
- printf style format. For field explanations, "man 5 labwc-config".
+ printf style format. For field explanations, see "man 5 labwc-config".
- The example below would print "foobar",then type of window (wayland, X),
+ The example below would print "foobar", then type of window (wayland, X),
then state of window (M/m/F), then output (shows if more than 1 active),
then workspace name, then identifier/app-id, then the window title.
- Uses 100% of OSD window width.
+ It uses 100% of OSD window width.
<windowSwitcher show="yes" preview="no" outlines="no" allWorkspaces="yes">
<fields>
}
}
-static struct {
- enum window_switcher_field_content content;
- int width;
-} fields[] = {
- { LAB_FIELD_TYPE, 25 },
- { LAB_FIELD_TRIMMED_IDENTIFIER, 25 },
- { LAB_FIELD_TITLE, 50 },
- { LAB_FIELD_NONE, 0 },
-};
-
static void
load_default_window_switcher_fields(void)
{
- struct window_switcher_field *field;
+ static const struct {
+ enum window_switcher_field_content content;
+ int width;
+ } fields[] = {
+#if HAVE_LIBSFDO
+ { LAB_FIELD_ICON, 5 },
+ { LAB_FIELD_DESKTOP_ENTRY_NAME, 30 },
+ { LAB_FIELD_TITLE, 65 },
+#else
+ { LAB_FIELD_DESKTOP_ENTRY_NAME, 30 },
+ { LAB_FIELD_TITLE, 70 },
+#endif
+ };
- for (int i = 0; fields[i].content != LAB_FIELD_NONE; i++) {
+ struct window_switcher_field *field;
+ for (size_t i = 0; i < ARRAY_SIZE(fields); i++) {
field = znew(*field);
field->content = fields[i].content;
field->width = fields[i].width;