1SIMPLESTROKE(1) - FreeBSD General Commands Manual
2
3# NAME
4
5**simplestroke** - detect mouse gestures
6
7# SYNOPSIS
8
9**simplestroke**
10
11# DESCRIPTION
12
13**simplestroke**
14detects mouse gestures.  There are twelve pre-defined mouse gestures
15you can choose from.
16
17With no arguments
18**simplestroke**
19starts in gesture detection mode.  Draw your gesture and then confirm by
20clicking any mouse button.
21
22**simplestroke**
23reacts on the release of mouse buttons.  This makes it possible to
24start
25**simplestroke**
26from your window manager while pressing down a mouse button and start
27gesture analysis after releasing it.
28
29**simplestroke**
30prints the name of the detected gesture, if any.  The output can then
31be used in a simple shell script to execute commands.
32
33# GESTURES
34
35The following gestures are supported.  The names are derived from the
36direction you would draw them in.
37
38## STRAIGHT LINE GESTURES
39
40	TopDown
41	DownTop
42	LeftRight
43	RightLeft
44
45## DIAGONAL GESTURES
46
47	TopLeftDown
48	TopRightDown
49	DownLeftTop
50	DownRightTop
51
52## Z GESTURES
53
54	LeftZ
55	RightZ
56
57## SQUARE GESTURES
58
59	SquareLeft
60	SquareRight
61
62# EXAMPLES
63
64The following examples assume that
65*simplestroke.sh*
66is the shell script you call
67**simplestroke**
68from:
69
70	#!/bin/sh
71	case $(simplestroke) in
72	    TopDown)
73	    ;;
74	    DownTop)
75	    ;;
76	    LeftRight)
77	    ;;
78	    RightLeft)
79	    ;;
80	    TopLeftDown)
81	    ;;
82	    TopRightDown)
83	    ;;
84	    DownLeftTop)
85	    ;;
86	    DownRightTop)
87	    ;;
88	    LeftZ)
89	    ;;
90	    RightZ)
91	    ;;
92	    SquareLeft)
93	    ;;
94	    SquareRight)
95	    ;;
96	    *)
97	        exit 1
98	esac
99
100To start detection under i3 while holding down the 9th mouse button
101add this to your
102*~/.config/i3/config:*
103
104	bindsym --whole-window button9 exec simplestroke.sh
105
106The right mouse button can be determined via
107xev(1).
108
109For Sway add this to your
110*~/.config/sway/config*:
111
112	bindsym --whole-window BTN_EXTRA exec simplestroke.sh
113
114The right BTN\_\* values can be determined via
115libinput-debug-events(1).
116
117Hold the mouse button and after you are finished drawing your gesture,
118release it.
119
120# AUTHORS
121
122Tobias Kortkamp <[tobik@FreeBSD.org](mailto:tobik@FreeBSD.org)>
123
124**simplestroke**
125is inspired and based on **easystroke** 0.6.0 written by Thomas Jaeger
126<[https://github.com/thjaeger/easystroke](https://github.com/thjaeger/easystroke)>.
127
128FreeBSD 13.0-CURRENT - April 10, 2020
129