3

I have a pretty small laptop screen, and I normally use my applications in a fullscreen/monocle layout. However this makes it difficult to remember where exactly my applications are in the stack, since I cant see them.

To solve this problem, I would like to have xmonad automatically make a window go to the top of the stack after I have focused it for a certain amount of time. Kind of like how Android manages its applications.

I am trying my best to accomplish this with the following hook. However I just don't know enough about haskell to make this work.

hook :: Event -> X All
hook (AnyEvent {ev_event_type = et}) = do
  when (et == focusIn) $
        withWindowSet(\ws -> 
           let focused = W.peek ws
           timeout 1000000
           if (focused == W.peek ws) then promote else ws 
        )
  return (All True)
hook _ = return (All True)

I am a newbie at this, and I would really appreciate some suggestions, this has been bugging me for a while, and you'd really be doing me a favor. :D

user2350374
  • 85
  • 2
  • 6
  • 1
    What issues do you have with the code posted? Are there errors? If it's just the sleep function itself, there is already a previous question about this: https://stackoverflow.com/questions/47816174/how-to-sleep-or-delay-the-thread-in-haskell – Chris Stryczynski Oct 29 '20 at 11:44

0 Answers0