doc/python/hooks.txt (raw)
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
******************************************************************************* ******************************************************************************* ** CAUTION: changing any value in the hook for that value changing is ** ** dangerous, as this can easily lead to an infinate loop of updating! ** ******************************************************************************* ******************************************************************************* hooks ---- This document describes the 'Hook' class, exposed by Openbox's 'hooks' module to its python scripts, and the standard hooks exposed in the 'hooks' module. ---- hooks.Hook ---- Methods ---- __call__(args) Fires the hook, passing the given arguments on to all functions registered with the hook. Functions are called in the order in which they were added. If any function defined as a hook returns any value other than None, the hook will not fire any more functions. args: Any number of function arguments, which are passed on to the hook's registered functions. ---- append(func) Appends a function to the hook. func: The function to add to the hook. ---- remove(func) Removes the function from the hook. func: The function to remove from the hook. ---- hooks ---- Hooks The following standard hooks are defined by Openbox. After each name comes the expected format of a function added to the hook. Adding a function of another format will lead to an exception when the hook is fired. ---- startup - function() When Openbox is starting, just before it begins managing clients. ---- shutdown - function() When Openbox is shutting down, after releasing all clients. ---- visibledesktop - function(new, old) When the current desktop changes. new: An integer containing the new desktop. old: An integer containing the old desktop. ---- numdesktops - function(desktops) When the number of desktops changes. desktops: An integer containing the number of available desktops. ---- desktopnames - function() When the desktops' names have been changed. ---- showdesktop - function(showing) When Openbox enters or leaves 'showing the desktop' mode. Called after the desktop is shown/hidden. showing: True if entering 'showing the desktop' mode, False if leaving. ---- screenconfiguration - function(size) When the screen's size (ob.Openbox.physicalSize()) has changed. size: The new size of the screen, as returned by ob.Openbox.physicalSize(). ---- screenarea - function() When the screen's area (ob.Openbox.screenArea()) has changed. ---- managed - function(client) When a client is managed. client: The Client being managed. ---- closed - function(client) When a client is being closed/destroyed/released. client: The Client which has been closed. ---- bell - function(client) When the system bell is fired. client: The Client the bell is associated with, or None. Clients can only be associated with bells through the XKB extension. ---- urgent - function(client) When a window enters/leaves urgent status. client: The client which has become/stopped being urgent. ---- pointerenter - function(client) When the pointer moves above a client. client: The Client that the pointer has move above. ---- pointerleave - function(client) When the pointer moves off of a client. client: The Client that the pointer has moved off of. ---- focused - function(client) When focus changes. client: The Client which has recieved input focus, or None if no client is focused. ---- requestactivate - function(client) When a request is made to activate a client. client: The Client who has been requested to be made active. ---- title - function(client) When a client's title or icon title changes. client: The Client whose title changed. ---- desktop - function(client, new, old) When a client's desktop changes. client: The Client that changed desktops. new: An integer containing the client's new desktop. old: An integer containing the client's old desktop. ---- iconic - function(client) When a client's iconic status changes. client: The Client that has been (un)iconified. ---- shaded - function(client) When a client's shaded status changes. client: The Client that has been (un)shaded. ---- maximized - function(client) When a client's maximized status changes. client: The Client that has been (un)maximized. ---- fullscreen - function(client) When a client's fullscreen status changes. client: The Client which as been (un)fullscreened. ---- visible - function(client) When a client becomes visible or hidden, but not for desktop changes. client: The Client which has been shown/hidden. ---- configuration - function(client) When a client's configuration (area/position/size) changes. client: The Client which has moved or resized. |