Commit graph

521 commits

Author SHA1 Message Date
Johan Malm
df8e3d819c docs/: remove XML declarations in .xml files
...because we don't like them anymore and libxml2 does not consider them
mandatory.
2025-10-21 12:30:32 +09:00
Johan Malm
1e406dd649 labnag: use overlay layer by default
Some checks failed
labwc.github.io / notify (push) Has been cancelled
...so that the dialog is still visible when some client is using
fullscreen mode.
2025-10-20 01:24:31 +02:00
Tomi Ollila
c78a0fe1b4 windowswitcher: show 's' as "state" for shaded views
While at it sorted the code to show 'm' before 's' and 's' before 'M'
- from the least visible to the most visible state.
2025-10-13 22:57:23 +02:00
tokyo4j
953249249c rcxml: call labnag with --keyboard-focus on-demand by default
Some checks are pending
labwc.github.io / notify (push) Waiting to run
2025-10-13 19:03:43 +01:00
tokyo4j
ef73431367 labnag: add --keyboard-focus option
The new `--keyboard-focus [none|on-demand|exclusive]` option (default:
`none`) allows to some keyboard controls in labnag:

  Right-arrow or Tab: move the button selection to the right
  Left-arrow or Shift-Tab: move the button selection to the left
  Enter: press the selected button
  Escape: close labnag

The selected button is highlighted with the inner 1px border. Maybe we can
instead use different colors for the selected button, but I prefer the
inner border for now because it doesn't require us to add new color
options or make them inherit labwc's theme.
2025-10-13 19:03:43 +01:00
Consolatis
364a1d5207 osd: allow window switcher to temporary unshade windows
This can be configured with a new unshade="yes|no"
argument for windowSwitcher in rc.xml

Fixes: #3111
2025-10-13 19:45:46 +02:00
tokyo4j
5e8df27f84 osd-classic: add theme options for selected window item
This commit adds new theme options:
- osd.window-switcher.style-classic.item.active.border.color
- osd.window-switcher.style-classic.item.active.bg.color

These theme options configures the border/background of selected window
item in the `classic` style window switcher. Their default values are
identical to `thumbnail` style window switcher, which means the default
border color is now `osd.label.text.color` with 50% opacity and the
default background color is now `osd.label.text.color` with 15% opacity.
2025-10-13 01:46:43 +09:00
tokyo4j
6cdfe32af0 rcxml: move <maximizedDecoration> from <core> to <theme> 2025-10-09 22:01:05 +01:00
tokyo4j
998ff9e7b5 osd-thumbnail: update default colors of selected window item
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Previously, the default values of
`osd.window-switcher.style-thumbnail.item.active.{bg,border}.color`
were blue. But they caused the selected window title in the window
switcher to be unreadable due to duplicated colors of the text and
background with Openbox themes like Numix.

Instead, this commit updates them to follow other themes configurations.
The default border color of the selected window item is now
`osd.label.text.color` with 50% opacity and the background is
`osd.label.text.color` with 15% opacity.

For subpixel antialiasing to work, the background color is calculated by
manually blending `osd.label.text.color` and `osd.bg.color`, rather than
just updating the alpha with 50% or 15%.
2025-10-07 19:47:50 +01:00
tokyo4j
e558d0d619 labnag: rename options for color 2025-10-01 20:10:33 +01:00
Johan Malm
5fdebedcd9 labwc-config(5): document <promptCommand>
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-09-24 20:13:51 +01:00
Johan Malm
5765586636 config: add <core><promptCommand>
...to enable configuration of the action prompt command.

Also set some better defaults for labnag.

The new default command is:

    labnag \
        --message '%m' \
        --button-dismiss '%n' \
        --button-dismiss '%y' \
        --background '%b' \
        --text '%t' \
        --border '%t' \
        --border-bottom '%t' \
        --button-background '%b' \
        --button-text '%t' \
        --border-bottom-size 1 \
        --button-border-size 3 \
        --timeout 0

...where the conversion specifiers are defined as follows:

    %m: the `<prompt>` message option
    %n: _("No")
    %y: _("Yes")
    %b: osd.bg.color
    %t: osd.label.text.color

This config options also enables the use of a different dialog client, for
example like this:

    <core>
      <promptCommand>zenity --question --text="%m"</promptCommand>
    </core>
2025-09-24 20:13:51 +01:00
tokyo4j
24f39e3a41 default-bindings.h: set combine="yes" for SnapToEdge keybinds
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-09-19 16:23:23 +09:00
tokyo4j
2ac48116e1 action: allow SnapToEdge to combine two cardinal directions
This patch adds `combine` argument to (Toggle)SnapToEdge actions.
This allows to snap a window to e.g. up-left by running two actions:
- `<action name="SnapToEdge" direction="left" combine="yes" />`
- `<action name="SnapToEdge" direction="up" combine="yes" />`

Then running `<action name="SnapToEdge" direction="down" combine="yes" />`
snaps it to left again. This behavior is almost the same as KWin, except
that snapping a up-right-tiled window to right doesn't move it to the
right-adjacent output, but makes it right-tiled first.
2025-09-19 16:23:23 +09:00
cunlem
c6503e299f Update labwc-actions.5.scd
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-09-16 20:27:02 +01:00
Johan Malm
f2639226c7 labwc-config(5): add example for autoEnableOutputs
Some checks failed
labwc.github.io / notify (push) Has been cancelled
...with inspiration from example in #3059 by @jlindgren90
2025-09-09 21:34:22 +01:00
Johan Malm
a9f927047a default-bindings.h: focus & raise on border press
...because it is probably what most people expect and it makes the
behavior consistent with that of Openbox.

Fixes: #3039
2025-09-04 15:54:37 +09:00
tokyo4j
02be24bf59 mousebind: support Border context
This new context includes `Top`...`BRCorner` and makes it easier to modify
the mousebinds bound to them.
2025-09-02 21:29:10 +01:00
01micko
d1a9529239 docs/labnag.1.scd: fix missed escape
Some checks failed
labwc.github.io / notify (push) Has been cancelled
2025-08-30 21:27:46 +09:00
01micko
f0ccbfed18 docs/labnag.1.scd: add a labnag example 2025-08-30 12:38:05 +01:00
tokyo4j
2e9292b7a3 osd: support window switcher with thumbnails
The new-style window switcher can be enabled with
<windowSwitcher style="thumbnail">.

New theme entries:

osd.window-switcher.style-thumbnail.width.max: 80%
osd.window-switcher.style-thumbnail.padding: 4
osd.window-switcher.style-thumbnail.item.width: 300
osd.window-switcher.style-thumbnail.item.height: 250
osd.window-switcher.style-thumbnail.item.padding: 10
osd.window-switcher.style-thumbnail.item.active.border.width: 2
osd.window-switcher.style-thumbnail.item.active.border.color: #589bda
osd.window-switcher.style-thumbnail.item.active.bg.color: #c7e2fc
osd.window-switcher.style-thumbnail.item.icon.size: 60
2025-08-29 20:42:01 +01:00
tokyo4j
6e2805f692 theme: move osd.window-switcher.* to osd.window-switcher.style-classic.*
Backward compatibility is preserved.
2025-08-29 20:42:01 +01:00
Rainer Kuemmerle
657c08aaa1 action: add toggle for GoToDesktop
Adds an option "toogle" to GoToDesktop.
In case the target is already where we are, we go back to the last desktop
instead.

Example of rc.xml

<keybind key="C-F1">
  <action name="GoToDesktop">
    <to>1</to>
    <toggle>yes</toggle>
  </action>
</keybind>
2025-08-26 21:03:06 +01:00
tokyo4j
888dbedeed ssd: allow hiding titlebar on maximization
<core disableMaximizedServerDecor="yes"> hides the titlebar when a window
is maximized.

Co-authored-by: @CosmicFusion
2025-08-24 12:41:41 +01:00
01micko
1b575ce816 docs/labnag.1.scd: fix typo 2025-08-21 21:05:04 +01:00
01micko
35ec696bd9 docs/rc.xml.all: clean up libinput section.
- add alternative accepted values for [yes|no]
- re #3006
2025-08-20 02:47:33 +09:00
Johan Malm
8d60fb27cd labwc-menu(5): reflect use of client-send-to-menu in client menu 2025-08-16 14:54:48 +01:00
Narrat
e05b924e4d docs/menu.xml: adjust labnag example
It was missing the respective closing tag
2025-08-12 22:35:19 +01:00
Johan Malm
8a5a04cc1a labwc-action(5): describe If action <prompt> 2025-08-09 10:44:03 +01:00
Johan Malm
c63d35c942 Add labnag
Based on swaynag (https://github.com/swaywm/sway/tree/master/swaynag)

Copied at commit:
03483ff370

Contains the following modifiations:

- Some functional changes including:
  - Disable exclusive-zone by default (Written-by: @Consolatis) and add
    command line option -x|--exclusive-zone
  - Add close timeout (Written-by: @Consolatis) and -t|--timeout option
  - Use index of button (from right-to-left) for exit code
  - Disable reading from config file and remove associated --type option
- Refactoring including:
  - Use wlr_log() instead of the log.{c,h} functions
  - Use wl_list instead of sway's list.c implementation
  - In the pango wrapper functions, use glib's g_strdup_vprintf() rather
    than the original stringop.c functions
- Align with labwc coding style to pass checkpatch.pl
- Re-licenced from MIT to GPL-2.0, and add Copyright notices for original
  authors

v2

- Remove option -s|--dismiss-button and the default "X" button. To get
  such a button, "-Z X :"
- Remove options -b and -z because there is no requirement to run
  in a terminal.
- Remove *-no-terminal from options --button and --button-dismiss because
  commands are now always run directly without a terminal.

v3

- Allow -B/-Z options without action-argument
- Invert button order of -B/-Z so that `labnag -m foo -Z x -Z y -Z z`
  results in three buttons with "x" furthest to the left, and "z" on the
  right (rather than the other way around).
- Use signalfd() to prevent race conditions on SIGTERM

v4

- Limit number of stdin lines to 200 to avoid hogging CPU

Co-Authored-by: tokyo4j
2025-08-09 10:44:03 +01:00
Johan Malm
6fd14987dd build: refactor in preparation for man page not beginning with 'labwc-'
No functional change intended.
2025-08-09 10:44:03 +01:00
John Lindgren
bc34461977 output: make autoEnableOutputs=no apply only to drm outputs
It is not really useful for other output backends and just results
in no outputs being enabled at all. (This is mainly an annoyance for
developers normally running with drm but occasionally nested.)
2025-08-05 04:18:43 +02:00
tokyo4j
17d66e5603 menu: refactor parser
...with the same approach as rcxml.c

- `If` actions now works for menus
- `name` argument no longer have to be the first argument of <action>
- `label` argument no longer have to be the first argument of <item>
2025-08-04 21:41:14 +01:00
tokyo4j
2f183cdcb6 interactive: allow snapping to corner edges
In addition to <snapping><range>, <snapping><cornerRange> configures the
distance from the screen corner to trigger quater window snapping.

Also, new values "up-left", "up-right", "down-left" and "down-right" are
allowed for <action name="(Toggle)SnapToEdge" direction="[value]"> and
<query tiled="[value]">.
2025-08-04 21:24:12 +01:00
tokyo4j
024ab280a0 cursor: also toggle mousebinds with ToggleKeybinds
Mousebinds can still be applied when the cursor is over their decoration
2025-07-28 00:06:52 +09:00
lynxy
13ff64f6e4 actions: added query tiled=any comparison for rc.xml simplification 2025-07-19 12:29:55 +09:00
tokyo4j
3aab0c3b91 Replace alacritty in default keybind with lab-sensible-terminal 2025-07-06 14:11:27 +01:00
Johan Malm
76c954fcc9 docs/menu.xml: remove Poweroff to align with builtin menu 2025-07-01 22:27:33 +01:00
Johan Malm
c749a11517 menu: add Terminal to default root-menu 2025-07-01 22:27:33 +01:00
tokyo4j
d7fd23e52d rcxml: revise drag-lock behavior and option names
This revises the changes done in 22d319c:
- Cancel defaulting to <dragLock>sticky<dragLock>. So labwc now disables
  drag-lock by default, as libinput does.
- Update the options from [yes|no|sticky] to [timeout|no|yes] to
  emphasize that the "sticky" mode (now "yes") is recommended when using
  drag-lock.
2025-07-01 03:00:55 +09:00
Consolatis
acd2a23f1b scaled-icon-buffer: add icon priority
Co-Authored-By: tokyo4j <hrak1529@gmail.com>
2025-06-27 14:05:42 +02:00
Johan Malm
db7c72ef39 labwc-theme(5): document x11-color-names 2025-06-24 01:09:30 -04:00
Johan Malm
fda63058b2 config: use Super modifier instead of Alt for default mousebinds
...A-Left and A-Right (for move and resize) to avoid interfering with some
clients like CAD programs and games.
2025-06-22 20:43:30 +01:00
Johan Malm
e62f403f56 config: deprecate A-F3
...because A-F3 is too close to A-F4 and it is better to be agnostic to
choice of launcher.
2025-06-22 20:43:30 +01:00
Johan Malm
26a9c637d8 config: deprecate A-<arrow> keybinds
...because Alt- keybinds should be for clients to use and the A-<arrow>
default combination is a frequent user complaint because it prevents some
common usage patterns like alt-left/right in web browers.
2025-06-22 20:43:30 +01:00
Johan Malm
84858967e4 docs: document gradients
(v2: small fixes)
2025-06-18 15:48:24 -04:00
Johan Malm
145de91932 config: add <core><primarySelection>
...to enable/disable primary selection clipboard support. This only works
on launch.

The reason it is useful to be able to disable this is that some clients
(like browsers) support middle-button-click to start scrolling up/down.

With some clients can be disabled via

   gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false

...but for others (like chromium and electron based programs) a compositor
setting is required.

Fixes: #2815
2025-06-13 20:27:49 +01:00
Jens Peters
a73b866129 config: support tablet tool mouse buttons
Those are regular mouse buttons, but attached
to a tablet tool (which looks like a mouse).
2025-06-08 05:31:23 +09:00
may
e96b5af42d libinput: implement threeFingerDrag feature 2025-06-07 21:30:07 +09:00
tokyo4j
22d319cce8 libinput: support <dragLock>sticky<dragLock> and enable it by default
It is recommended by libinput:
https://lists.freedesktop.org/archives/wayland-devel/2024-November/043860.html
2025-06-07 12:46:53 +01:00