Skip to content

Editing gestures

Daniel Kondor edited this page Mar 11, 2024 · 6 revisions

The standalone program wstroke-config can be used to edit gestures and corresponding actions. The interface should be familiar to users of Easystroke.

Each row corresponds to a configured gesture, along with the necessary information about it:

  • Stroke: this is the gesture shape; this can be edited by double clicking on the image or by clicking on the "Record stroke" button (see below for more details)
  • Name: this is a display name for the gesture (it can be anything)
  • Type: this is the type of action carried out (see below for an explanation for action types)
  • Details: this is any additional information needed to carry out the action (e.g. detailed action, or keypress combination)

Editing gestures

Double clicking on the gesture image or clicking on the "Record stroke" button brings up a separate dialog that allows recording a new gesture shape. This can be done by drawing on the white canvas in the dialog. By default, this should be done by a different button than the one configured for gestures, so that the drawing attempt is not interpreted as a gesture itself if wstroke is enabled. (Adding wstroke-config to the list of exceptions can be used to allow recording with the real gesture button.)

Action types

  • Command: a program name can be given in the Details field or selected from the list of installed applications; the gesture triggers this program to be run
  • Key: a keypress (or combination) is emulated. Key combinations can be recorded by clicking in the Details column.
  • Ignore: Pressing and holding a modifier key (Ctrl, Alt, Shift or Super / Win) is emulated until the next mouse click. Note that this currently only works with mouse clicks and not with other keyboard keys (any idea to fix this is welcome). To record the modifier, press it together with any regular key.
  • Button: a mouse button click is emulated (possibly together with a modifier key).
  • Global Action: an action on the desktop is triggered (specified in Details). Currently supported actions are starting Scale and Expo (if these plugins are enabled), showing the desktop (from the "WM Actions" plugin) and opening wstroke-config.
  • WM Action: an action is triggered on the currently active view (the view under the pointer when starting the gesture in the default configuration). Possible actions include moving, closing, minimizing, maximizing or resizing the view, along with toggling additional window states provided by the "WM Actions" Wayfire plugin (if enabled).
  • Custom Plugin: triggers the activator of another Wayfire plugin, given by the Details column. Activator names can be found in the plugin's XML metadata (e.g. here or under /usr/local/share/wayfire/metadata/ on a typical installation). E.g. grid/slot_r will tile the currently active view to the right. Note that this only works for plugins that implement the new IPC interface. Beyond the interactions already available as Global or WM Actions, this currently means the Grid and the Cube plugins. Two examples are given in the example config for tiling views on the left or right.
  • Touchpad Gesture: this emulates multi-touch gestures based on the movement of the mouse. This includes scrolling, pinching (zooming) and swipes. For this to work, the target app needs to support the given gesture. Scrolling works everywhere, but zooming only in some apps (e.g. Firefox), and swipes usually don't do anything (but e.g. Wayfire's "Viewport Swipe" plugin works with them). The action is started at the end of a gesture and lasts until the next click; in this time, normal mouse movement is supressed and the corresponding touchpad events are generated instead. The type of gesture, along with the number of fingers and any modifier keys to be used in combination can be configured in a pop-up dialog

App-specific gestures and actions

It is possible to customize gestures and actions based on the target app (i.e. the app under the pointer or the currently active app, based on the settings). These can be accessed by the "Application" selection on the top of the configuration window. Beyond settings for any specific app, apps can be grouped together to use the same settings. Groups and apps are organized in a tree, where lower levels inherit gestures and actions from upper levels, but can also override some of them. The root of the tree is a group called "Default" that contains gestures shared by all apps. Actions that are overridden for a specific app are shown in bold in the list. E.g. in the example configuration, the gestures for changing tabs are overridden for "gedit", since it uses a different key combination than usual.

The "Add Application" button on the right hand side creates a new app item that inherits its settings from the currently selected group. Clicking it brings up a popup and the target app can be selected by clicking on its window (or alternatively, press "Cancel" to enter its ID manually). The "Add Group" button creates a new group. If this is used while an app is selected, it will create the group as the parent of the currently selected app, sharing all of its overrides. This can be useful if overrides for one app need to be applied to more.

Overridden actions can be reset by clicking the "Reset Action(s)" button at the bottom of the window. Individual gestures can be disabled for specific apps by using the "Delete Action(s)" button at the bottom after selecting the app. To enable them again, select the "Show deleted rows" toggle and use the "Reset Action(s)" button.

Actions can be moved or copied between apps by dragging them from the actions list to the target app or group in the top list.

See also the "Application and Groups" section of the original Easystroke documentation for more details.

Exceptions

On a separate tab, apps can be added for which gestures are completely disabled. This can be useful e.g. if an app already interprets dragging with the gesture button.

Importing and exporting settings

The "Import" and "Export" buttons on the top of the settings window can be used to load or save settings. This can be used for backing up, moving settings between computers, and also for importing settings from Easystroke. Note that the import dialog offers the option to replace the current settings or to import any actions from the given file.

Clone this wiki locally