aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/Stoppable.hs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement proper handling of dynamically changing hostnameAnton Vorontsov2014-09-011-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Ignore-this: 2aeac6d2161e666d40cda6a09f78b208 The module implements a proper way of finding out whether the window is remote or local. Just checking for a hostname and WM_CLIENT_MACHINE being equal is often not enough because the hostname is a changing subject (without any established notification mechanisms), and thus WM_CLIENT_MACHINE and the hostname can diverge even for a local window. This module solves the problem. As soon as there is a new window created, we check the hostname and WM_CLIENT_MACHINE, and then we cache the result into the XMONAD_REMOTE property. Notice that XMonad itself does not know anything about hostnames, nor does it have any dependency on Network.* modules. For this module it is not a problem: you can provide a mean to get the hostname through your config file (see usage). Or, if you don't like the hassle of handling dynamic hostnames (suppose your hostname never changes), it is also fine: this module will fallback to using environment variables. darcs-hash:20140901072158-1836e-fa2b05c79ec3217d5024b7e050b2239dcf7de4b4.gz
* Add Stoppable layout for power savingAnton Vorontsov2014-09-011-0/+130
Ignore-this: a52805d9f3095cd7af48507847ed2fe3 This module implements a special kind of layout modifier, which when applied to a layout, causes xmonad to stop all non-visible processes. In a way, this is a sledge-hammer for applications that drain power. For example, given a web browser on a stoppable workspace, once the workspace is hidden the web browser will be stopped. Note that the stopped application won't be able to communicate with X11 clipboard. For this, the module actually stops applications after a certain delay, giving a chance for a user to complete copy-paste sequence. By default, the delay equals to 15 seconds, it is configurable via 'Stoppable' constructor. The stoppable modifier prepends a mark (by default equals to "Stoppable") to the layout description (alternatively, you can choose your own mark and use it with 'Stoppable' constructor). The stoppable layout (identified by a mark) spans to multiple workspaces, letting you to create groups of stoppable workspaces that only stop processes when none of the workspaces are visible, and conversely, unfreezing all processes even if one of the stoppable workspaces are visible. To stop the process we use signals, which works for most cases. For processes that tinker with signal handling (debuggers), another (Linux-centric) approach may be used. See https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt darcs-hash:20140901072141-1836e-f65c7bdad9b87883e41a526f496d93f0171ed149.gz