xmonad: toggle a window between floating and tiled

痞子三分冷 提交于 2020-01-03 03:04:48

问题


Sometimes I launch a window tiled. Maybe as a scratchpad (using NamedScratchpad) or as in this question.

Now I want to be able to zoom (either fullscreen or tile) this floating window, and then toggle back to the previous tiled size & position.

What is a good way to accomplish that?

Also, if I hit the hotkey for a scratchpad, I want it to open according to the specification in my config file --- not according to the current state (e.g. tiled).


回答1:


If i understand your (zooming) question correctly, XMonad.Layout.Maximize provides what you're looking for. Please note that maximize affects the naming of your Layout - if you use XMonad.Layout.Named you may want to define the name before maximize like

myLayout = named "myName"
           $ maximize
           $ someLayout

with a keybinding like

((modm, xK_backslash), withFocused (sendMessage . maximizeRestore))

described in the linked documentation.

Currently this module maximizes not completely, but leaves a bit of border. If it bugs you, you can modify the module and place your version at ~/.xmonad/lib/modifiedMaximize from where you can import it with

import modifiedMaximize

in your xmonad.hs.



来源:https://stackoverflow.com/questions/19975180/xmonad-toggle-a-window-between-floating-and-tiled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!