Skip to content

Combine some pages #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 211 additions & 5 deletions src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
1. [Keybinds](#keybinds)
1. [Unset Keybinds](#unset-keybinds)
2. [Common Keybinds](#common-keybinds)
3. [Keybind Forwarding](#keybind-forwarding)
2. [Theme](#theme)
1. [Server Side Decoration](#server-side-decoration)
3. [Mouse and Trackpads](#mouse-and-trackpads)
1. [Libinput](#libinput)
2. [Mousebinds](#mousebinds)
3. [Cursor](#cursor)
4. [XML](#xml)
1. [XML Nodenames](#xml-nodenames)
5. [Scripting](#scripting)
1. [Run or Raise](#run-or-raise)
6. [Environment Variables](#environment-variables)
7. [Nested XWayland](#nested-xwayland)
8. [Hardware](#hardware)
1. [Nvidia](#nvidia)
2. [Laptop Lid](#laptop-lid)

# 1. Keybinds {#keybinds}

Expand Down Expand Up @@ -66,18 +78,49 @@ In true `sway` style:
<keybind key="W-S-3"><action name="SendToDesktop" to="3" follow="false"/></keybind>
```

## 1.3 Keybind Forwarding {#keybind-forwarding}

The [ToggleKeybinds] action allows better control of Virtual Machines, VNC
clients, nested compositors or similar.

For example, to make alt-tab work in a nested compositor add the code below to
`~/.config/labwc/rc.xml` and then press F12 to disable all keybinds in the
parent compositor and thereby forward them to the nested instance.

```
<keybind key="F12">
<action name="ToggleKeybinds"/>
</keybind>
```

[ToggleKeybinds]: https://labwc.github.io/labwc-actions.5.html#entry_action_name=togglekeybinds

# 2. Theme {#theme}

## 2.1 Server Side Decoration {#server-side-decoration}

### Q: Is it possible to completely remove windows' title-bars?

Yes. Action `ToggleDecoration`, but it removes borders too.
Yes.

Action `SetDecorations` can be used for this. This action can be used with
key/mousebinds or with window rules like this:

```
<windowRules>
<windowRule identifier="*">
<action name="SetDecorations" decorations="border" />
</windowRule>
</windowRules>
```

With window rules it can be achieve more simply as in the example below, but
that will remove borders too:

```
<windowRule title="*" >
<action name="ToggleDecoration"/>
</windowRule>
<windowRules>
<windowRule identifier="*" serverDecoration="no" />
</windowRules>
```

### Q: I'd like to be able to remove the client-menu button. How can this be done?
Expand All @@ -97,7 +140,7 @@ window.inactive.button.menu.unpressed.image.color: #000000 0

Not yet implemented.

## 3.2 Mousebinds
## 3.2 Mousebinds {#mousebinds}

### Q: I'm used to MS Windows and would like all window to unfocus when I click the desktop. How can this be achieved?

Expand All @@ -112,4 +155,167 @@ Not yet implemented.
</mouse>
```

## 3.3 Cursor {#cursor}

### Q: I cannot see a cursor. What should I do?

If no cursor is showing (sometimes reported by people running vwmare), try
adding `WLR_NO_HARDWARE_CURSORS=1` to `~/.config/labwc/environment`.

If cursors do not update as expected, try installing a cursor theme (for
example `Adwaita`) and set `XCURSOR_THEME` in `~/.config/labwc/environment`
accordingly (for example `XCURSOR_THEME=Adwaita`). `labwc` handles missing
cursor themes by falling back on builtin old X11 cursors, but some applications
do not resulting in the wrong or no cursor being set.

# 4. XML {#xml}

## 4.1 XML Nodenames {#xml-nodenames}

### Q: My config file does not work. How can I debug it?

You a can a nested instance of labwc in a terminal to see the error messages
relating to bad XML syntax of missing elements/attributes.

For more fine-grained analysis you can see the config/menu file nodenames when
`labwc` starts, by setting the following environment variables:

```
LABWC_DEBUG_CONFIG_NODENAMES=1
LABWC_DEBUG_MENU_NODENAMES=1
```

With `labwc` a nodename is a way to refer to each element and attribute in an
XML tree. For example, the `<c>` element below would be assigned the nodename
`c.b.a`:

```
<a>
<b>
<c>foo</c>
</b>
</a>
```

Please note that `labwc` also parses the rc.xml configuration file in an
element/attribute agnostic way, which means that `<a><b>foo</b></a>` is
equivalent to `<a b="foo"/>`. Be careful though, because this does not apply to
some aspects of menu.xml (specifically the attributes id, label and execute).

In practical terms, this means that the following syntax could be used:

```
<keybind key="W-l" name.action="Execute" command.action="swaylock -c 000000"/>
```

...rather than then lengthier:

```
<keybind key="W-l">
<action name="Execute">
<command>swaylock -c 000000"</command>
</action>
</keybind>
```

See [labwc-config(5)-syntax] for more details.

[labwc-config(5)-syntax]: https://labwc.github.io/labwc-config.5.html#syntax

# 5. Scripting {#scripting}

## 5.1 Run or Raise {#run-or-raise}

The [wlr-foreign-toplevel-management] protocol provides clients with a list of
opened applications and lets them request certain actions on them, like
maximizing, focusing, etc. This can be used for scripting with clients such as
[wlrctl] and [lswt]. For example, the script below launches an application
if it is not already running, or focuses the application's most recently opened
window if it is already running:

```
#!/bin/sh

if test -z "$1"; then
echo "Usage: runraise app_id [executable]"
exit 1
fi

app_id=$1
executable=$2
test -z "$executable" && executable=$app_id

if ! wlrctl window focus "$app_id"; then
$executable &
disown
fi
```

As of labwc version 0.7.2 it is also possible to create a run or raise keybind
with the `ForEach` action:

```
<keybind key="W-F1">
<action name="ForEach">
<query identifier="foot" />
<then>
<action name="Raise" />
<action name="Focus" />
</then>
<none>
<action name="Execute" command="foot" />
</none>
</action>
</keybind>
```

[wlrctl]: https://git.sr.ht/~brocellous/wlrctl
[lswt]: https://sr.ht/~leon_plickat/lswt/
[wlr-foreign-toplevel-management]: https://wayland.app/protocols/wlr-foreign-toplevel-management-unstable-v1

# 6. Environment Variables {#environment-variables}

There are a number of advanced settings that can be invoked for `wlroots` by
setting some environment variables.

For example `labwc` can be run nested on Wayland with multiple outputs using
the following: `WLR_WL_OUTPUTS=2 labwc`

See the wlroots repo [env_vars.md] file for details.

[env_vars.md]: https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/docs/env_vars.md

# 7. Nested XWayland {#nested-xwayland}

To run a nested instance of openbox on labwc:

```
Xwayland -decorate -noreset :55
DISPLAY=:55 dbus-run-session openbox-session

```

# 8. [Hardware]{#hardware}

## 8.1 [Nvidia]{#nvidia}

If Electron clients are glitchy or lagging try setting these environment
variables:

```
GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
```

## 8.2 [Laptop Lid]{#laptop-lid}

When using a laptop with an external monitor and the built-in monitor is closed,
the system may go into hibernation when disconnecting. To avoid this, edit the
configuration file `etc/systemd/logind.conf' and set following to ignore (see
logind.conf(5) manual for more info):

```
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
```

2 changes: 0 additions & 2 deletions src/more.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
- [hidpi scaling](hidpi-scaling.html)
- [links](links.html)
- [obligatory screenshot](obligatory-screenshot.html)
- [tips and tricks](tips-and-tricks.html)
- [troubleshooting](troubleshooting.html)

Loading