-
Notifications
You must be signed in to change notification settings - Fork 7
/
event_type.go
executable file
·134 lines (115 loc) · 3.57 KB
/
event_type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package client
// EventHandler Hyprland will write to each connected ipc live events like this:
type EventHandler interface {
// Workspace emitted on workspace change. Is emitted ONLY when a user requests a workspace change, and is not emitted on mouse movements (see activemon)
Workspace(w WorkspaceName)
// FocusedMonitor emitted on the active monitor being changed.
FocusedMonitor(m FocusedMonitor)
// ActiveWindow emitted on the active window being changed.
ActiveWindow(w ActiveWindow)
// Fullscreen emitted when a fullscreen status of a window changes.
Fullscreen(f bool)
// MonitorRemoved emitted when a monitor is removed (disconnected)
MonitorRemoved(m MonitorName)
// MonitorAdded emitted when a monitor is added (connected)
MonitorAdded(m MonitorName)
// CreateWorkspace emitted when a workspace is created
CreateWorkspace(w WorkspaceName)
// DestroyWorkspace emitted when a workspace is destroyed
DestroyWorkspace(w WorkspaceName)
// MoveWorkspace emitted when a workspace is moved to a different monitor
MoveWorkspace(w MoveWorkspace)
// ActiveLayout emitted on a layout change of the active keyboard
ActiveLayout(l ActiveLayout)
// OpenWindow emitted when a window is opened
OpenWindow(o OpenWindow)
// CloseWindow emitted when a window is closed
CloseWindow(c CloseWindow)
// MoveWindow emitted when a window is moved to a workspace
MoveWindow(m MoveWindow)
// OpenLayer emitted when a layerSurface is mapped
OpenLayer(l OpenLayer)
// CloseLayer emitted when a layerSurface is unmapped
CloseLayer(c CloseLayer)
// SubMap emitted when a keybind submap changes. Empty means default.
SubMap(s SubMap)
Screencast(s Screencast)
}
type EventType string
const (
EventWorkspace EventType = "workspace"
EventFocusedMonitor EventType = "focusedmon"
EventActiveWindow EventType = "activewindow"
EventFullscreen EventType = "fullscreen"
EventMonitorRemoved EventType = "monitorremoved"
EventMonitorAdded EventType = "monitoradded"
EventCreateWorkspace EventType = "createworkspace"
EventDestroyWorkspace EventType = "destroyworkspace"
EventMoveWorkspace EventType = "moveworkspace"
EventActiveLayout EventType = "activelayout"
EventOpenWindow EventType = "openwindow"
EventCloseWindow EventType = "closewindow"
EventMoveWindow EventType = "movewindow"
EventOpenLayer EventType = "openlayer"
EventCloseLayer EventType = "closelayer"
EventSubMap EventType = "submap"
EventScreencast EventType = "screencast"
)
func GetAllEvents() []EventType {
return []EventType{
EventWorkspace,
EventFocusedMonitor,
EventActiveWindow,
EventFullscreen,
EventMonitorRemoved,
EventMonitorAdded,
EventCreateWorkspace,
EventDestroyWorkspace,
EventMoveWorkspace,
EventActiveLayout,
EventOpenWindow,
EventCloseWindow,
EventMoveWindow,
EventOpenLayer,
EventCloseLayer,
EventSubMap,
EventScreencast,
}
}
type MoveWorkspace struct {
WorkspaceName
MonitorName
}
type MonitorName string
type FocusedMonitor struct {
MonitorName
WorkspaceName
}
type WorkspaceName string
type SubMap string
type CloseLayer string
type OpenLayer string
type MoveWindow struct {
Address string
WorkspaceName
}
type CloseWindow struct {
Address string
}
type OpenWindow struct {
Address, Class, Title string
WorkspaceName
}
type ActiveLayout struct {
Type, Name string
}
type ActiveWindow struct {
Name, Title string
}
type ActiveWorkspace WorkspaceName
type Screencast struct {
// True if a screen or window is being shared.
Sharing bool
// "0" if monitor is shared, "1" if window is shared.
Owner string
}