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.
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.
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%.
...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>
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.
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>
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
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.)
...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>
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]">.
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.
...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.
...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