Using XMonad.Layout.PerWorkspace, you can setup independent layouts for each workspace and tweak them for your applications. However, I would like some workspaces to keep track of my settings. Eg if I hit Mod-h on Workspace 2 using the Tall layout, I want the Tall layout on workspace 2 to have a slightly smaller master-pane the next time I boot (or restart X, for that matter) as well.
This is a frequently required feature, but I cannot find a solution anywhere.
Ideally, this would we stored on some ~/.xmonad/persistentLayouts/workspace*/layout*.conf
files which you could erase/edit manually if required. But that would just be a bonus.
I could live with implementing this myself if it doesn't exist, but my file-I/O haskell is a bit rookyish, so maybe somebody can provide some pointers.
xmonad already preserves its state across executable restarts (eg mod+q and similar), so why not steal that mechanism? I think it just uses read and show, so you shouldn't need especially strong IO skills; readFile
and writeFile
should be sufficient. You can steal some code from xmonad itself. The serialization code comes from restart , and the deserialization code comes from xmonad . You'll need to modify it slightly -- you don't want to preserve the window ID information, as that will be invalidated by the new X session -- but much of it can probably be taken wholesale.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.