Allen S. Rout | 6 Feb 20:53
Picon

Delays in focus update...


I'm running xmonad now on a 4-monitor setup which is slowly approaching 
perfect-for-me.  Yay, and thanks!

But I've noticed a certain lack of responsiveness when I make sweeping 
motions with the mouse, and I've now done a bit of an experiment  that 
seems to narrow it down.

To observe this behavior:

+ open up a lot of shells.  Mod-shift-enter 15 or 20 times on an empty 
workspace will do.

+ Pick a side of the screen which is an edge, not adjacent to another screen

+ Move your mouse to that screen, on the -opposite- side from the edge.

+ Swiftly move your mouse to the edge,  like _fast_.  10th of a second 
or so.  You're crossing many terminals.

+ Watch the successive terminals momentarily get focus;  count the time 
(seconds if you go nuts on the count) it takes for focus to get where 
your mouse is.

.... So it seems it takes constant, substantial subsecond time between 
window X gets focus, and when xmonad is willing to consider that it 
might have lost it.

Is there some timing loop in there?  Or is there something fundamental 
and X-y happening that limits this?    In other WMs, I'm accustomed to 
(Continue reading)

Thomas Løcke | 6 Feb 09:02
Picon
Gravatar

Learning how to do proper keybindings (and a little bit about xmobar)

Hey all,


The other day I got my new Thinkpad T420 laptop, and I decided that it was time to put some pressure on my 40 year old brain. I've used KDE on Slackware for what feels like an eternity, so I feel comfortable and at home with KDE. This is both good and bad. Good because I know my way around KDE, bad because over the years I've sorta become a bit of a mouse-junkie (Ack!).

So naturally I had to find something completely different: Enter xmonad. 

I've been fascinated with Haskell for a while now, but never really managed to get started with it. I'm guessing xmonad would be as good a place to start as any.

Its been a rocky start for me, I must admit. The whole functional paradigm is both mesmerizing and scary. My first real stumble block has been how to do proper keybindings in xmonad.sh, specifically to be able to adjust the volume using the T420 volume buttons.

This is what I've currently got:

----------
import XMonad
import XMonad.Actions.CycleWS     
import XMonad.Hooks.DynamicLog   
import XMonad.Hooks.ManageDocks    
import XMonad.Util.EZConfig        
import XMonad.Util.Run(spawnPipe) 
import System.IO

myLogHook dest = dynamicLogWithPP defaultPP { ppOutput = hPutStrLn dest
                                            ,ppVisible = wrap "(" ")"
   }                     

myKeys = [ ("M-b", sendMessage ToggleStruts ) 
         , ("M-<Right>", nextWS) 
         , ("M-<Left>", prevWS) 
         , ("M-p", spawn "gmrun") 
         , ("M-r", spawn "xmonad --restart") 
         , ("M-g", spawn "google-chrome") 
         , ("M-f", spawn "firefox") 
         , ("M-s", spawn "sudo /usr/sbin/pm-suspend") 
         , ("C-M-h", spawn "sudo /usr/sbin/pm-hibernate") 
         , ("C-M-r", spawn "sudo /sbin/shutdown -r now") 
         , ("C-M-s", spawn "sudo /sbin/shutdown -h now") 
         ]

-- This is where it all goes haywire! I found these online, but with no direction on how
-- to add them to myKeys.
-- volKeys = \c -> mkKeymap c $
--       [ ("<XF86AudioRaiseVolume>", spawn "amixer -c 0 set Master 1+ unmute")
--       , ("<XF86AudioLowerVolume>", spawn "amixer -c 0 set Master 1-")
--       ]

main = do
    xmproc <- spawnPipe "/usr/bin/xmobar /home/thomas/.xmobarrc"
    xmonad $ defaultConfig
        { manageHook = manageDocks <+> manageHook defaultConfig
        , layoutHook = avoidStruts  $  layoutHook defaultConfig
, terminal = "urxvt"
, focusFollowsMouse = False
        , logHook = myLogHook xmproc
        , modMask = mod4Mask     -- Rebind Mod to the Windows key
        }
`additionalKeysP` myKeys
----------

The commented block below myKeys is where everything falls apart for me. I cannot for the life of me figure out how to add those two keys to myKeys. Any and all advice is more than welcome!

Oh, and one final question: I've chosen xmobar as my status bar and so far I'm loving the slimness completely, but I've noticed that most people seem to be using dzen - is dzen considered the "better" choice? I just want something simple that tells me what workspace I'm on, has a small tray for wicd and some basic cpu/mem/battery info. xmobar does all these things (with a minor glitch in the battery department, but that's for another post), but I'd rather not bet on something that isn't being broadly used by the xmonad community. So, is it OK for me to stick with xmobar?

:o)
Thomas Løcke

Takafumi Arakaki | 5 Feb 05:46
Picon

How do you test ManageHook using QuickCheck?

Hi,

I asked the same question in StackOverflow [1] but since I haven't
gotten an answer, let me ask here once again.  I guess this mailing
list is more appropriate place to ask.

I want to test ManageHooks in my xmonad.hs and I've heard there is
nice testing library called QuickCheck, so I am trying it.  I worte
the following code but could not make it work because XConf and XState
doesn't have required field.  I am not a haskell programmer, so maybe
I am doing something wrong.  I guess filling everything in XConf and
XState means connecting to the X server which is rather heavy for a
quick test.  It would be better if I can write something like
`StackSet i l a s sd -> ManageHook -> Bool`.

import XMonad.Core
import XMonad.ManageHook (doIgnore)
import XMonad.Config (defaultConfig)
import qualified XMonad.StackSet as W

import Test.QuickCheck (Property, quickCheck)
import Test.QuickCheck.Monadic (assert, monadicIO, run)

prop_manage_hook :: XConf -> XState -> ManageHook -> Property
prop_manage_hook c st mh = monadicIO $ do
  (_, newst) <- run $ runX c st $ runQuery mh $ theRoot c
  assert $ length (W.currentTag $ windowset newst) > 0

main :: IO ()
main = do
  quickCheck $ prop_manage_hook xc st doIgnore
  where
    xc = XConf { config = defaultConfig }
    st = XState {}

I once experienced xmonad halted because of a zero-division error I
had in my ManageHooks.  That's why I want to test it before putting in
my xmonad.hs.

[1] http://stackoverflow.com/questions/8552627/how-do-you-test-managehook-using-quickcheck

Thanks,
Takafumi

codesite | 4 Feb 20:46
Picon
Favicon

Issue 493 in xmonad: spawnPipe opens another instance of the applicatioon

Status: New
Owner: ----

New issue 493 by argu...@...: spawnPipe opens another instance
of the  
applicatioon
http://code.google.com/p/xmonad/issues/detail?id=493

What steps will reproduce the problem?
1. Have a spawnPipe on xmonad.hs
2. Hit Mod+Q
3. See a duplicate xmobar running.

What is the expected output? What do you see instead?
When pressing Mod+Q it should kill my xmobar instance and open another one.

When pressing Mod+Q it start another xmobar instance.

What version of the product are you using? On what operating system?

xmonad-darcs 20111213-1

3.2.2-1-ARCH

Are you using an xmonad.hs?  Please attach it and the output of "xmonad
--recompile".

No output on "xmonad --recompile"

Please provide any additional information below.

Attachments:
	xmonad.hs  14.1 KB

Norbert Zeh | 4 Feb 20:09
Picon
Picon
Favicon

Toggle window decoration

Hi folks,

I'm currently experimenting with using window decorations (NoFrillsDecoration at
this point).  While I normally want decorations on my windows, there are
situations where I would like to remove the decoration from individual windows
and latter restore the decoration.  Is there already a layout modifier or other
mechanism that does this?  If there isn't, that's no biggie because I have an
idea of how to implement this using a layout modifier that stores undecorated
windows using ExtensibleState, but I'd hate to implement it only to find out
that this functionality is already there.

Cheers,
Norbert

--

-- 

()  ascii ribbon campaign  -  against html e-mail
/\  www.asciiribbon.org    -  against proprietary attachments

Bas van Dijk | 2 Feb 12:30
Picon
Gravatar

xmonad.org down

xmonad.org seems to be down:

http://www.downforeveryoneorjustme.com/xmonad.org

Bas

Jacek Generowicz | 31 Jan 11:50
Picon
Picon

Debugging X events

Hello,

I've got a rich set of keybindings in my XMonad configuration, which
includes multiple-modifier combinations such as M-C-S-. It all works
beautifully on my main machine, but there are problems when running
the same configuration on a netbook.

I've used xev to analyse the problem and made the following
observations:

+ M-S-≤any normal key> works the first time, but SHIFT must be
  released (and may be pressed again) if <any normal key> is to be
  detected again.

+ with M-C-S- held down, <any normal key> is not detected at all,
  though it you keep pressing it repeatedly it will eventually be
  deteted after some seemingly random number of presses.

Any ideas how to go about trying to understand why this is happening
and how to fix it?

Thanks.

Eyal Erez | 28 Jan 19:55
Picon
Gravatar

Windows Extending to Both Monitors in a Dual Monitor Setup

Hi,

I've been using xmonad for some time, and I've never seen this problem before.
I'm using it on my laptop, which I sometimes connect to a projector or
to a monitor
using a dock.  This has always worked fine.  However, a few days ago,
it suddenly
started stretching my windows across both monitors instead of keeping
them tiled on
one or the other.  It's as if xmonad thinks I actually have one really
wide monitor instead
of two.  I'm not sure where to start looking to fix this, since I
didn't really change
anything significant of late.

If anyone can point me in any useful direction, I would really appreciate it.

Thank you,

--

-- 
There are 10 types of people, those who know binary and those who don't.

Tom Davis | 24 Jan 21:42
Gravatar

Automatic switch to external monitor?

Hey all,

I have a dock at work where I plop my laptop each day; used to be that
as soon as I woke it, it would switch to using the external monitor only
and never turn on the laptop screen. Now it turns on both even though
the laptop is closed, and it takes me opening it and running my "dock"
script (uses xrandr to turn off laptop display and enable external),
shutting the laptop (which sleeps it), then waking it again. Quite
irritating! Until recently this seemed to be automatic for me, but since
switching monitors it isn't. 

I'm sure there's some way to do this via ACPI or whatever, but I'm not
familiar enough with it to know. Basically i need an action for "docked"
that will try running "dock on" and see what happens. Any thoughts?

Nicolas Dudebout | 23 Jan 22:49
Picon
Favicon
Gravatar

NamedScratchpad use case patch

Hi,

This is a patch to make easier use of NamedScratchpad with the
DynamicLog pretty printing capabilities.

It took me a little while to figure out why the examples given in
IndependentScreens were not working when using NamedScratchpad. I knew
I had to use namedScratchpadFilterOutWorkspace but it was not obvious
how to d'o so.

Hopefully this patch helps.

Regards,
Nicolas
Attachment (namedScratchpad_use_case.dpatch): application/octet-stream, 5745 bytes
Jochen Keil | 23 Jan 19:57
Picon

darcs patch: This patch exposes the root window Event... (and 1 more)

Hello,

attached you'll find two patches which the EventMasks for the root and client
windows in XConfig. The intention is to enable people to write hooks (or in
general modules) which make use of e.g. keyPress/keyRelease Events.

I've written some hooks/modules myself which rely on some non-default Events and
it works well so far.

Since the patches themselves do not change the default behaviour of xmonad nor
cause any harm, I'd like to request that they get applied. :)

Many thanks in advance and best wishes,

Jochen

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

Mon Jan 23 11:07:25 CET 2012  Jochen Keil <jrk@...>
  * This patch exposes the root window EventMask to XConfig

  This is helpful for writing Hooks which should act on certain Events as for
  example keyPress or keyRelease.

Mon Jan 23 11:10:26 CET 2012  Jochen Keil <jrk@...>
  * This patch exposes the client window EventMask to XConfig

  This is helpful for writing Hooks which should act on certain Events as for
  example keyPress or keyRelease.


Gmane