Sepp Tannhuber | 16 Sep 16:43 2014
Picon

trigger xmonad commands with shell script

Dear all,

I would like to raise a certain window from within a shell script.
Is it possible to trigger xmonad to execute something like
  raiseMaybe (runInTerm "-title myWindow" "myWindow") (title =? "myWindow")
with a shell script? Or do you know any other possibility to raise a window
from a shell?
Carsten Mattner | 13 Sep 15:02 2014
Picon

update: chromium slow redraw

Due to my local xmonad --recompile breakage I had to fall back to dwm and
was surprised to see that the very slow non-floating Chromium window
redraw evident in XMonad since Chromium switched to Aura does NOT
happen in dwm.

Any idea what's different in the dwm X11 code that doesn't make Chromium
window (content) redraws super visible (slow)?
Carsten Mattner | 12 Sep 21:02 2014
Picon

xmonad --recompile breakage

xmonad --recompile stopped working here this week and fails with scope errors
in stuff from xmonadcontrib. Anyone else see this?
Mike Sullivan | 3 Sep 04:18 2014
Picon

What happened to ScreenWorkspaces?

Does anybody know what happened to the ScreenWorkspaces module, mentioned briefly here?


It sounds useful, as it seems like it would extend Xmonad.Layout.IndependentScreens to also allow for a more polished experience (notably, perhaps it would fix CycleWS behavior as discussed at http://www.haskell.org/pipermail/xmonad/2009-December/009466.html). Also, it would allow for a more Gnome-like multi-head experience (as mentioned at http://article.gmane.org/gmane.comp.lang.haskell.xmonad/7774).

Mike
<div><div dir="ltr">Does anybody know what happened to the&nbsp;<span>ScreenWorkspaces module, mentioned briefly here?</span><div><br></div>
<div>
<a href="http://article.gmane.org/gmane.comp.lang.haskell.xmonad/7223">http://article.gmane.org/gmane.comp.lang.haskell.xmonad/7223</a><br>
</div>
<div><br></div>
<div>It sounds useful, as it seems like it would extend Xmonad.Layout.IndependentScreens to also&nbsp;allow for a more polished experience (notably, perhaps it would fix CycleWS behavior as discussed at&nbsp;<a href="http://www.haskell.org/pipermail/xmonad/2009-December/009466.html">http://www.haskell.org/pipermail/xmonad/2009-December/009466.html</a>). Also, it would allow for a more<span>&nbsp;Gnome-like multi-head experience (as mentioned at&nbsp;<a href="http://article.gmane.org/gmane.comp.lang.haskell.xmonad/7774">http://article.gmane.org/gmane.comp.lang.haskell.xmonad/7774</a>).</span>
</div>

<div><br></div>
<div><span>Mike</span></div>
</div></div>
Anton Vorontsov | 1 Sep 10:02 2014

darcs patch: Add Stoppable layout for power saving (and 1 more)

In this version I addressed further comments by Paul Fertser, plus
implemented the remote/local clients identification scheme that I was
talking about: it is in XMonad.Util.RemoteWindows module with
documentation and all.

I split the work into two logical changes, for easier review and so that
the first patch won't depend on the second.

Thanks,

Anton

2 patches for repository http://code.haskell.org/XMonadContrib:

Mon Sep  1 00:21:41 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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

Mon Sep  1 00:21:58 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Implement proper handling of dynamically changing hostname

  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.

Attachment (patch-preview.txt): text/x-darcs-patch, 13 KiB
In this version I addressed further comments by Paul Fertser, plus
implemented the remote/local clients identification scheme that I was
talking about: it is in XMonad.Util.RemoteWindows module with
documentation and all.

I split the work into two logical changes, for easier review and so that
the first patch won't depend on the second.

Thanks,

Anton

2 patches for repository http://code.haskell.org/XMonadContrib:

Mon Sep  1 00:21:41 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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

Mon Sep  1 00:21:58 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Implement proper handling of dynamically changing hostname

  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.

Paul Fertser | 30 Aug 17:22 2014
Picon

Re: darcs patch: Add Stoppable layout for power saving

Hi,

On Fri, Aug 29, 2014 at 06:41:14PM -0700, Anton Vorontsov wrote:
> +signalLocalWindow :: Signal -> Window -> X ()
> +signalLocalWindow s w  = do
> +    host <- io $ getEnvDefault "HOSTNAME" ""
> +    hasProperty (Machine host) w >>= flip when (signalWindow s w)

HOSTNAME is a bash-specific variable and it's not exported by default,
so neither XMonad nor ghci sees it (even though I actually use bash on
this machine):

Prelude System.Posix.Env> getEnv "HOSTNAME" 
Nothing

As the result, this version doesn't work as expected.

I've noticed another unpleasant side-effect of this: urxvtd is a
single process that can have many windows (each spawned with
urxvtc). So if the stoppable workspace has a urxvtd window, all the
other terminal windows get frozen too. Should an optional filtering
facility be added?

On an unrelated note, where do you get opportunities to apply your
Haskell skills?

--

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@...
Anton Vorontsov | 30 Aug 03:41 2014

darcs patch: Add Stoppable layout for power saving

Changes:

- Per Brandon Allbery's suggestion the module now checks
  WM_CLIENT_MACHINE, and thus no longer tries to stop remote clients.

- Per Paul Fertser's suggestion improved documentation, and also
  implemented a delay to make X11 clipboard limitations less noticeable.

1 patch for repository http://code.haskell.org/XMonadContrib:

Fri Aug 29 18:03:14 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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

Attachment (patch-preview.txt): text/x-darcs-patch, 6907 bytes
Changes:

- Per Brandon Allbery's suggestion the module now checks
  WM_CLIENT_MACHINE, and thus no longer tries to stop remote clients.

- Per Paul Fertser's suggestion improved documentation, and also
  implemented a delay to make X11 clipboard limitations less noticeable.

1 patch for repository http://code.haskell.org/XMonadContrib:

Fri Aug 29 18:03:14 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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

Paul Fertser | 29 Aug 19:10 2014
Picon

Re: darcs patch: Add Stoppable layout for power saving

On Thu, Aug 28, 2014 at 01:12:31PM -0700, Anton Vorontsov wrote:
> On Thu, Aug 28, 2014 at 11:00:28PM +0400, Paul Fertser wrote:
> > Handy for the shit-sites that make firefox spin violently even when
> > it's not visible!
> 
> Exactly. :) Extends laptop on-battery time drastically.

This has an unpleasant side-effect though, I'm usually having firefox
(duh, should be using emacs-w3m more but it sucks in its own ways)
fullscreen and when I copy a link from it or just select some text,
and switch to a different workspace, the pasting from X selection
doesn't happen until I switch back to unfreeze the
shit-browser. That's less annoying than wasting cpu cycles but as a
known limitation should better be documented.

--

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@...
Paul Fertser | 28 Aug 21:00 2014
Picon

Re: darcs patch: Add Stoppable layout for power saving

Great idea, Anton!

Handy for the shit-sites that make firefox spin violently even when
it's not visible!

On Thu, Aug 28, 2014 at 06:07:24PM +0000, Anton Vorontsov wrote:
> +-- > main = xmonad def
> +-- >    { layoutHook = layoutHook def ||| stoppable (layoutHook def) }
> +--
> +-- For more detailed instructions on editing the logHook see:
> +--
> +-- "XMonad.Doc.Extending#The_log_hook_and_external_status_bars"

Why is that you're talking about modifying the logHook when tweaking
layoutHook, is this a typo?

--

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@...
Brandon Allbery | 28 Aug 20:14 2014
Picon

Re: darcs patch: Add Stoppable layout for power saving

On Thu, Aug 28, 2014 at 2:07 PM, Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org> wrote:
To stop the process we use signals, which works for most cases.

Please check WM_CLIENT_MACHINE so you don't try to kill a process not running on the same machine xmonad is (ssh forwarding, TCP X server connections, etc.)

--
brandon s allbery kf8nh                               sine nomine associates
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
<div><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">On Thu, Aug 28, 2014 at 2:07 PM, Anton Vorontsov <span dir="ltr">&lt;<a href="mailto:anton@..." target="_blank">anton@...</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">To stop the process we use signals, which works for most cases.</blockquote>
</div>
<br>Please check WM_CLIENT_MACHINE so you don't try to kill a process not running on the same machine xmonad is (ssh forwarding, TCP X server connections, etc.)<br clear="all"><div><br></div>-- <br><div dir="ltr">
<div>brandon s allbery kf8nh &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sine nomine associates</div>
<div>
<a href="mailto:allbery.b@..." target="_blank">allbery.b@...</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:ballbery@..." target="_blank">ballbery@...</a>
</div>
<div>unix, openafs, kerberos, infrastructure, xmonad &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a>
</div>
</div>
</div></div></div>
Anton Vorontsov | 28 Aug 20:07 2014

darcs patch: Add Stoppable layout for power saving

It seems that my last email got silently eaten by spam filters. It's been
a whole day, so let's try it again with a different smtp...

1 patch for repository http://code.haskell.org/XMonadContrib:

Wed Aug 27 15:02:19 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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, as soon as the
  workspace is hidden the web browser will be stopped.

  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

Attachment (patch-preview.txt): text/x-darcs-patch, 5526 bytes
It seems that my last email got silently eaten by spam filters. It's been
a whole day, so let's try it again with a different smtp...

1 patch for repository http://code.haskell.org/XMonadContrib:

Wed Aug 27 15:02:19 PDT 2014  Anton Vorontsov <anton <at> enomsg.org>
  * Add Stoppable layout for power saving

  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, as soon as the
  workspace is hidden the web browser will be stopped.

  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


Gmane