xmonad / xmonad-contrib

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

Could not find module `XMonad.Hooks.WindowSwallowing` #698

Closed sebasijan closed 2 years ago

sebasijan commented 2 years ago

Problem Description

When I try to import into my xmonad.hs

import XMonad.Hooks.WindowSwallowing

I get this error

Could not find module XMonad.Hooks.WindowSwallowing

Steps to Reproduce

Give detailed step-by-step instructions on how to reproduce the problem.

Configuration File

Simply try to import XMonad.Hooks.WindowSwallowing in xmonad.hs

Checklist

geekosaur commented 2 years ago

Sorry, I see you filled the versions in (it's not in 0.16 which is still packaged by most distros).

How do you have your xmonad config set up for building? Are you using stack or cabal? Do other xmonad-contrib modules work?

sebasijan commented 2 years ago

@geekosaur Actually I have not checked xmonad-contrib - perhaps this issue belongs in the other repo?

geekosaur commented 2 years ago

It definitely belongs here. But if other modules are also missing then we need to figure out if you have xmonad-contrib installed correctly.

sebasijan commented 2 years ago

@geekosaur Okay, this is what I am importing to my config atm, and don't seem to have any other issues - what else can I provide?

import XMonad

-- import XMonad.Hooks.WindowSwallowing

import qualified XMonad.StackSet as W

import XMonad.Config.Desktop

import XMonad.Util.EZConfig
import XMonad.Util.Run
import XMonad.Util.SpawnOnce
import XMonad.Util.Cursor
import XMonad.Util.NamedScratchpad

import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat)

import XMonad.Layout.Decoration
import XMonad.Layout.NoBorders
import XMonad.Layout.Renamed
import XMonad.Layout.ResizableTile
import XMonad.Layout.Spacing
import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Gaps
import XMonad.Layout.NoBorders
import XMonad.Layout.LayoutModifier (ModifiedLayout)

import qualified Data.Map as M
import Data.Maybe (fromJust)
import Data.Monoid

import Colors.MyScheme
slotThe commented 2 years ago

What does xmonad --version return? I still get the feeling that you are not on 0.17.0.

sebasijan commented 2 years ago

@slotThe

$ xmonad --version

Outputs

xmonad 0.17.0.9
slotThe commented 2 years ago

@sebasijan That's really curious; the xmonad version in $PATH is responsible for recompiling, so my guess was that you forgot to upgrade that one. I don't really know what to tell you other than "have you tried uninstalling and installing it again?" :)

Just to double check; all of the error messages you posted mention Monad.Hooks.WindowSwallowing; I assume that's a typo?

geekosaur commented 2 years ago

In my experience the two can get out of sync really easily. In particular, we've had more than one case of someone having both /usr/bin/xmonad and ~/.local/bin/xmonad (or ~/.cabal/bin, etc.) and the result being rather confused.

slotThe commented 2 years ago

On Tue, Apr 05 2022 03:41, brandon s allbery kf8nh wrote:

In my experience the two can get out of sync really easily. In particular, we've had more than one case of someone having both /usr/bin/xmonad and ~/.local/bin/xmonad (or ~/.cabal/bin, etc.) and the result being rather confused.

Oh, right, the xmonad executable in $PATH when a shell is already loaded may not be the one that xmonad uses when it was started by e.g. a display manager.

sebasijan commented 2 years ago

@geekosaur I think you are definitely on to something:

bassie@Skoot-Top:~$ /usr/bin/xmonad --version
xmonad 0.15
bassie@Skoot-Top:~$ ~/.local/bin/xmonad --version
xmonad 0.17.0.9

Not quite sure how to verify from here which one is actually being executed on launch/recompile though

geekosaur commented 2 years ago

I'd just remove the one you don't want, make sure your session can find the other one (this may require adding a like like source ~/.bash_profile to your ~/.xsession), and xmonad --restart.

sebasijan commented 2 years ago

@geekosaur after deleting /usr/bin/xmonad I could no longer log into the DE, so it must be using that one

I'm not sure what you mean by "adding a like like source ~/.bash_profile to your ~/.xsession" - is there any resource you can point me towards? I guess I need to tell xmonad to use my preferred executable somehow?

geekosaur commented 2 years ago

You're having exactly the problem that was supposed to fix: your DE was using /usr/bin/xmonad and that's why it couldn't find the module.

How is your desktop manager configured? Do you have a file ~/.xsession which runs xmonad, or does it use a file like /usr/share/applications/xmonad.desktop?

sebasijan commented 2 years ago

@geekosaur I can see /usr/share/applications/Xmonad and ~/.xsession but not sure which one is being used

I will delete each one and see what happens

geekosaur commented 2 years ago

That's probably a mistake since you'll need to put back the one that's being used.

sebasijan commented 2 years ago

@geekosaur I deleted /usr/share/applications/Xmonad and everything seems fine (except that the window swallowing error still occurs)

I don't mind just moving them around/deleting as I have another DE installed which I can log into, or can timeshift back

slotThe commented 2 years ago

@sebasijan where do we stand on this? did you manage to solve it?

sebasijan commented 2 years ago

@slotThe Unfortunately not - I'm not sure what steps to take next

slotThe commented 2 years ago

@sebasijan Your DM somehow needs to be aware of ~/.local/bin, so you can either source the file where you set your $PATH in .xsession, add a .desktop file like here or even just symlink ~/.local/bin/xmonad to /usr/bin/xmonad

TheMC47 commented 2 years ago

Any updates? This isn't really an issue with xmonad/xmonad-contrib. Maybe open a discussion and let's close this issue

slotThe commented 2 years ago

Agreed