xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 274 forks source link

NamedScratchpads Freezes Xmobar #782

Closed M1ndo closed 1 year ago

M1ndo commented 1 year ago

Problem Description

So recently i have updated my xmonad/xmonad-contrib (0.17.1) i noticed toggling on/off any of my scratchpads causes xmobar to freeze, upon restarting xmobar it doesn't behave as it should until (Restarting The Session).

Steps to Reproduce

Configuration File

Please include the smallest full configuration file that reproduces the problem you are experiencing:

import XMonad.Util.NamedScratchpad

myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm ]
 where
  spawnTerm  = myTerminal2 ++ " -class 'Term' -fn 'Cascadia Code' -fa 'Cascadia Code'"
  findTerm   = (className =? "Term")
  manageTerm = customFloating $ W.RationalRect l t w h
             where
               h = 0.5
               w = 0.5
               t = 0.2
               l = 0.2
-- Hook 
 manageHook = namedScratchpadManageHook myScratchPads

-- Shortcut
 , ("M-C-<Return>", namedScratchpadAction myScratchPads "terminal")

Full configuration: https://0x0.st/o0ZQ.hs

Demo Video

https://0x0.st/o0Zm.mkv

Checklist

liskin commented 1 year ago

Please include the smallest full configuration file that reproduces

upon restarting xmobar it doesn't behave as it should until (Restarting The Session).

How do you restart xmobar? Your full config uses the deprecated piping method of passing data to xmobar, so this is probably expected? Can you perhaps try using https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Hooks-StatusBar.html instead?

M1ndo commented 1 year ago

Please include the smallest full configuration file that reproduces

upon restarting xmobar it doesn't behave as it should until (Restarting The Session).

How do you restart xmobar? Your full config uses the deprecated piping method of passing data to xmobar, so this is probably expected? Can you perhaps try using https://xmonad.github.io/xmonad-docs/xmonad-contrib/XMonad-Hooks-StatusBar.html instead?

Thanks for mentioning the depracated piping method switching to StatusBarHook fixed the issue.