Difference between revisions of "Xmonad/Notable changes since 0.9"
(description of X.A.OnScreen changes) |
(set up subsections for more detailed change log -- move detailed examples to subsection to retain over view) |
||
Line 1: | Line 1: | ||
This page is for keeping a record of significant changes in darcs xmonad and xmonad-contrib since the 0.9 release. See 'darcs changes' for more details about miscellaneous feature enhancements, and documentation and bug fixes not noted here. | This page is for keeping a record of significant changes in darcs xmonad and xmonad-contrib since the 0.9 release. See 'darcs changes' for more details about miscellaneous feature enhancements, and documentation and bug fixes not noted here. | ||
− | The idea is to put here a list of things which a user upgrading from 0.9 to the current darcs version might like to know, so that they are sure to be included in the | + | The idea is to put here a list of things which a user upgrading from 0.9 to the current darcs version might like to know, so that they are sure to be included in the next release change log. |
__TOC__ | __TOC__ | ||
+ | == Updates that require changes in xmonad.hs == | ||
=== Simplified interface for X.A.SpawnOn and X.H.DynamicHooks === | === Simplified interface for X.A.SpawnOn and X.H.DynamicHooks === | ||
+ | Since contrib modules can now store custom state in XState, the additional IORef parameters are no longer required: Users have to remove the first parameter to the respective functions. The functions <code>mkSpawner</code> and <code>initDynamicHooks</code> are also no longer necessary and have been removed. The same applies to XMonad.Hooks.DynamicHooks. See [[#XState details|below]] for examples. | ||
+ | |||
+ | === X.A.OnScreen changes === | ||
+ | The type of <code>onScreen</code> has been changed to allow more general onScreen functions. The new <code>onScreen</code> takes any function that modifies the stack and runs it on the given screen. Since XMonad can not guess what you'd like to do with the focus after running this function, <code>onScreen</code> also accepts a code>Focus</code> data which tells XMonad how to act. See [[#OnScreen details|below]] for detailed examples. The more common "end user" functions like <code>viewOnScreen</code> and <code>greedyViewOnScreen</code> didn't change in their interface though. | ||
+ | |||
+ | == Changes to the xmonad core == | ||
+ | |||
+ | == Changes to xmonad-contrib == | ||
+ | === Updated modules === | ||
+ | ====Actions==== | ||
+ | ====Config==== | ||
+ | ====Hooks==== | ||
+ | ====Layout==== | ||
+ | ====Prompt==== | ||
+ | ====Util==== | ||
+ | === New contrib modules === | ||
+ | ====Actions==== | ||
+ | ====Hooks==== | ||
+ | ====Layout==== | ||
+ | ====Util==== | ||
+ | === Deleted modules === | ||
+ | |||
+ | == Detailed examples regarding changes to xmonad.hs == | ||
+ | === XState details === | ||
Since contrib modules can now store custom state in XState, the additional IORef parameters are no longer required: Users have to remove the first paramter to the respective functions. The functions <code>mkSpawner</code> and <code>initDynamicHooks</code> are also no longer necessary and have been removed. | Since contrib modules can now store custom state in XState, the additional IORef parameters are no longer required: Users have to remove the first paramter to the respective functions. The functions <code>mkSpawner</code> and <code>initDynamicHooks</code> are also no longer necessary and have been removed. | ||
Line 25: | Line 50: | ||
The same applies to XMonad.Hooks.DynamicHooks. | The same applies to XMonad.Hooks.DynamicHooks. | ||
− | === | + | === OnScreen details === |
The type of <code>onScreen</code> has been changed to allow more general onScreen functions. The old <code>onScreen</code> was very limited. Basicly the only working function derived from onScreen was <code>viewOnScreen</code>, since the <code>greedyViewOnScreen</code> never worked as supposed to, and any other function wouldn't work either. | The type of <code>onScreen</code> has been changed to allow more general onScreen functions. The old <code>onScreen</code> was very limited. Basicly the only working function derived from onScreen was <code>viewOnScreen</code>, since the <code>greedyViewOnScreen</code> never worked as supposed to, and any other function wouldn't work either. | ||
Line 68: | Line 93: | ||
greedyViewOnScreen sc i = onScreen (greedyView i) FocusCurrent sc | greedyViewOnScreen sc i = onScreen (greedyView i) FocusCurrent sc | ||
</haskell> | </haskell> | ||
− | |||
− | |||
[[Category:XMonad]] | [[Category:XMonad]] |
Revision as of 16:58, 10 December 2009
This page is for keeping a record of significant changes in darcs xmonad and xmonad-contrib since the 0.9 release. See 'darcs changes' for more details about miscellaneous feature enhancements, and documentation and bug fixes not noted here.
The idea is to put here a list of things which a user upgrading from 0.9 to the current darcs version might like to know, so that they are sure to be included in the next release change log.
Contents
Updates that require changes in xmonad.hs
Simplified interface for X.A.SpawnOn and X.H.DynamicHooks
Since contrib modules can now store custom state in XState, the additional IORef parameters are no longer required: Users have to remove the first parameter to the respective functions. The functions mkSpawner
and initDynamicHooks
are also no longer necessary and have been removed. The same applies to XMonad.Hooks.DynamicHooks. See below for examples.
X.A.OnScreen changes
The type of onScreen
has been changed to allow more general onScreen functions. The new onScreen
takes any function that modifies the stack and runs it on the given screen. Since XMonad can not guess what you'd like to do with the focus after running this function, onScreen
also accepts a code>Focus data which tells XMonad how to act. See below for detailed examples. The more common "end user" functions like viewOnScreen
and greedyViewOnScreen
didn't change in their interface though.
Changes to the xmonad core
Changes to xmonad-contrib
Updated modules
Actions
Config
Hooks
Layout
Prompt
Util
New contrib modules
Actions
Hooks
Layout
Util
Deleted modules
Detailed examples regarding changes to xmonad.hs
XState details
Since contrib modules can now store custom state in XState, the additional IORef parameters are no longer required: Users have to remove the first paramter to the respective functions. The functions mkSpawner
and initDynamicHooks
are also no longer necessary and have been removed.
Example:
-- Old code:
sp <- mkSpawner
..
[((mod1Mask,xK_k), shellPromptHere sp defaultXPConfig
..]
The above has to be changed to:
-- no mkSpawner line
..
[((mod1Mask,xK_k), shellPromptHere defaultXPConfig)
..]
The same applies to XMonad.Hooks.DynamicHooks.
OnScreen details
The type of onScreen
has been changed to allow more general onScreen functions. The old onScreen
was very limited. Basicly the only working function derived from onScreen was viewOnScreen
, since the greedyViewOnScreen
never worked as supposed to, and any other function wouldn't work either.
The new onScreen
takes any function that modifies the stack and runs it on the given screen. Since XMonad can not guess what you'd like to do with the focus after running this function, onScreen
also accepts a Focus
data which tells XMonad how to act.
Comparison:
---- Old version ----
-- Old type of onScreen:
onScreen :: (WorkspaceId -> WindowSet -> WindowSet) -- ^ default action
-> ScreenId -- ^ screen id
-> WorkspaceId -- ^ index of the workspace
-> WindowSet -- ^ current stack
-> WindowSet
-- The old implementation of viewOnScreen was:
viewOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
viewOnScreen sc i = onScreen view sc i
---- New version ----
-- The new Focus data:
data Focus = FocusNew -- ^ always focus the new screen
| FocusCurrent -- ^ always keep the focus on the current screen
| FocusTag WorkspaceId -- ^ always focus tag i on the new stack
| FocusTagVisible WorkspaceId -- ^ focus tag i only if workspace with tag i is visible on the old stack
-- New type of onScreen:
onScreen :: (WindowSet -> WindowSet) -- ^ function to run
-> Focus -- ^ what to do with the focus
-> ScreenId -- ^ screen id
-> WindowSet -- ^ current stack
-> WindowSet
-- A few example implementations (don't worry - they're already built in):
viewOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
viewOnScreen sc i = onScreen (view i) (FocusTag i) sc
greedyViewOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
greedyViewOnScreen sc i = onScreen (greedyView i) FocusCurrent sc