Provides two new kinds of ManageHooks that can be defined at runtime.
- One-shot ManageHooks that are deleted after they execute.
- Permanent ManageHooks (unless you want to destroy them)
Note that you will lose all dynamically defined ManageHooks when you mod+q!
If you want them to last, you should create them as normal in your xmonad.hs.
First, you must execute initDynamicHooks from main in your xmonad.hs:
dynHooksRef <- initDynamicHooks
and then pass this value to the other functions in this module.
You also need to add the base ManageHook:
xmonad { manageHook = myManageHook <+> dynamicMasterHook dynHooksRef }
You must include this dynHooksRef value when using the functions in this
module:
xmonad { keys = myKeys `Data.Map.union` Data.Map.fromList
[((modMask conf, xK_i), oneShotHook dynHooksRef
"FFlaunchHook" (className =? "firefox") (doShift "3")
>> spawn "firefox")
,((modMask conf, xK_u), addDynamicHook dynHooksRef
(className =? "example" --> doFloat))
,((modMask conf, xK_y), updatePermanentHook dynHooksRef
(const idHook))) ] -- resets the permanent hook.
|