简体   繁体   English

还记得xmonad工作区布局吗?

[英]Remember xmonad workspace layout?

Using XMonad.Layout.PerWorkspace, you can setup independent layouts for each workspace and tweak them for your applications. 使用XMonad.Layout.PerWorkspace,您可以为每个工作区设置独立布局,并为您的应用程序调整它们。 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. 例如,如果我使用Tall布局在Workspace 2上点击Mod-h,我希望工作区2上的Tall布局在下次启动时(或重新启动X)也会有一个略小的主窗格。

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. 理想情况下,这将存储在一些~/.xmonad/persistentLayouts/workspace*/layout*.conf文件中,您可以根据需要手动擦除/编辑这些文件。 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. 如果它不存在,我可以自己实现它,但我的文件I / O haskell有点古怪,所以也许有人可以提供一些指示。

xmonad already preserves its state across executable restarts (eg mod+q and similar), so why not steal that mechanism? xmonad已经在可执行重启(例如mod + q和类似)中保留了它的状态,那么为什么不窃取那个机制呢? I think it just uses read and show, so you shouldn't need especially strong IO skills; 我认为它只是使用读取和显示,所以你不需要特别强大的IO技能; readFile and writeFile should be sufficient. readFilewriteFile应该足够了。 You can steal some code from xmonad itself. 你可以从xmonad本身窃取一些代码。 The serialization code comes from restart , and the deserialization code comes from xmonad . 序列化代码来自重新启动 ,反序列化代码来自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. 您需要稍微修改它 - 您不希望保留窗口ID信息,因为新的X会话将使其无效 - 但其中大部分可能是批量处理的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM