/r/xmonad

Photograph via snooOG

/r/xmonad

5,257 Subscribers

0

Could not load module ‘XMonad’

Hi

II have installed XMonad window manager using cabal in user mode. I am able to load XMonad using command "startx ./.cabal/bin/xmonad". But on trying

"muraj1@void-live ~]$ .cabal/bin/xmonad --recompile" I get the following :-

[muraj1@void-live ~]$ .cabal/bin/xmonad --recompile

XMonad will not use build script, because "/home/muraj1/.xmonad/build" is not executable.

Suggested resolution to use it: chmod u+x "/home/muraj1/.xmonad/build"

XMonad will use ghc to recompile, because none of "/home/muraj1/.xmonad/build", "/home/muraj1/.xmonad/stack.yaml", "/home/muraj1/.xmonad/flake.nix", "/home/muraj1/.xmonad/default.nix" exist.

XMonad recompiling (forced).

Errors detected while compiling xmonad config: /home/muraj1/.xmonad/xmonad.hs

$ ghc --make xmonad.hs -i -ilib -fforce-recomp -main-is main -v0 -outputdir /home/muraj1/.xmonad/build-x86_64-linux -o /home/muraj1/.xmonad/xmonad-x86_64-linux

xmonad.hs:9:1: error:

Could not load module ‘XMonad’

It is a member of the hidden package ‘xmonad-0.18.0’.

You can run ‘:set -package xmonad’ to expose it.

(Note: this unloads all the modules in the current scope.)

Use -v (or `:set -v` in ghci) to see a list of the files searched for.

|

9 | import XMonad

| ^^^^^^^^^^^^^

xmonad.hs:12:1: error:

Could not load module ‘XMonad.StackSet’

It is a member of the hidden package ‘xmonad-0.18.0’.

You can run ‘:set -package xmonad’ to expose it.

(Note: this unloads all the modules in the current scope.)

Use -v (or `:set -v` in ghci) to see a list of the files searched for.

|

12 | import qualified XMonad.StackSet as W

| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please check the file for errors.

xmonad: xmessage: executeFile: does not exist (No such file or directory)

I tried the ghci command line and able to load XMonad, which works though.

muraj1@void-live Desktop]$ ghci

Loaded package environment from /home/muraj1/.ghc/x86_64-linux-9.0.2/environments/default

GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help

ghci> import XMonad

<no location info>: error:

Could not load module ‘XMonad’

It is a member of the hidden package ‘xmonad-0.18.0’.

You can run ‘:set -package xmonad’ to expose it.

(Note: this unloads all the modules in the current scope.)

ghci> :set -package xmonad

package flags have changed, resetting and loading new packages...

ghci> import XMonad

ghci>

May I have some help on how to recompile xmonad.hs?

1 Comment
2024/12/02
04:40 UTC

1

How to spawn xmobar only on first window of layout?

Hello, somebody. I have trouble with xmobar. I want to spawn xmobar only on first window of layout, i have 9 workspaces and one of them i want with xmobar

3 Comments
2024/11/29
13:16 UTC

2

togglestruts not hiding xmobar

here's my config:

import XMonad

import XMonad.Hooks.ManageHelpers (doFullFloat,isFullscreen)

import XMonad.Hooks.EwmhDesktops

import XMonad.Hooks.DynamicLog

import XMonad.Hooks.StatusBar

import XMonad.Hooks.StatusBar.PP

import XMonad.Hooks.InsertPosition

import XMonad.Hooks.ManageDocks

import XMonad.Layout.Fullscreen

import XMonad.Util.Loggers

import XMonad.Util.Run

import XMonad.Util.SpawnOnce (spawnOnce)

import XMonad.Util.EZConfig

import XMonad.Prompt

import XMonad.Prompt.Shell

import XMonad.Prompt.FuzzyMatch (fuzzyMatch)

import XMonad.Actions.ToggleFullFloat (toggleFullFloat)

import XMonad.Layout.Gaps

import XMonad.Layout.Spacing

import XMonad.Layout.LayoutModifier

import XMonad.Layout.CenterMainFluid

import XMonad.Layout.DwmStyle

import XMonad.Layout.ThreeColumns (ThreeCol(ThreeColMid))

import XMonad.Layout.Reflect (reflectHoriz)

import XMonad.Layout.MultiToggle

import XMonad.Layout.MultiToggle.Instances

import XMonad.Layout.ToggleLayouts hiding (Toggle)

import qualified XMonad.Layout.MultiToggle as MT (Toggle(..))

import qualified XMonad.StackSet as W

import Control.Monad

import Data.Maybe

import Data.List

import XMonad.Layout.NoBorders (noBorders)

main :: IO ()

main = do

xmonad

. ewmhFullscreen

. ewmh

. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey

$ myconfig

setFullscreenSupported :: X ()

setFullscreenSupported = addSupported ["_NET_WM_STATE", "_NET_WM_STATE_FULLSCREEN"]

addSupported :: [String] -> X ()

addSupported props = withDisplay $ \dpy -> do

r <- asks theRoot

a <- getAtom "_NET_SUPPORTED"

newSupportedList <- mapM (fmap fromIntegral . getAtom) props

io $ do

supportedList <- join . maybeToList <$> getWindowProperty32 dpy a r

changeProperty32 dpy r a aTOM propModeReplace (nub $ newSupportedList ++ supportedList)

myManageHook :: ManageHook

myManageHook = manageDocks <+> composeAll

[ insertPosition Below Newer

, isFullscreen --> doFullFloat

, className =? "firefox" --> viewShift "www"

, className =? "Google-chrome" --> viewShift "www"

, className =? "kitty" --> viewShift "dev"

, className =? "discord" --> viewShift "chat"

, className =? "mpv" --> viewShift "vid"

, className =? "vlc" --> viewShift "vid"

, className =? "Pcmanfm" --> viewShift "sys"

, className =? "Virt-manager" --> viewShift "qemu"

, className =? "libreoffice-startcenter" --> viewShift "doc"

, className =? "Spotify" --> viewShift "mus"

, className =? "Ryujinx" --> viewShift "game"

]

where viewShift = doF . liftM2 (.) W.greedyView W.shift

myconfig = def

{ modMask = mod4Mask

, manageHook = myManageHook

, workspaces = myWorkspaces

, layoutHook = myLayout

, startupHook = myStartupHook

}

\additionalKeysP``

[ ("M-<Return>", spawn "kitty")

, ("M-a", spawn "alacritty")

, ("M-r", spawn "xmonad --restart")

, ("M-w", kill)

, ("<XF86MonBrightnessUp>", spawn "light -A 5")

, ("<XF86MonBrightnessDown>", spawn "light -U 5")

, ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle")

, ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%")

, ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%")

, ("<XF86AudioPlay>", spawn "playerctl play-pause")

, ("M1-p", spawn "flameshot full -p ~/Pictures/Screenshots")

, ("M-<Space>", shellPrompt myPromptConfig )

, ("M-p", spawn "~/scripts/powermenu.sh")

]

myStartupHook :: X ()

myStartupHook = do

setFullscreenSupported

spawnOnce "picom"

spawnOnce "/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &"

spawnOnce "feh --bg-fill ~/Pictures/wallpapers/dsw.png"

spawnOnce "mpd"

spawnOnce "light -S 5"

spawnOnce "nm-applet"

spawnOnce "xsetroot -cursor_name left_ptr"

myPromptConfig = def

{

position = Top

, bgColor = "#000000"

, promptBorderWidth = 1

, searchPredicate = isPrefixOf

, defaultText = ""

, alwaysHighlight = True

, height = 27

, font = "xft:DejaVu Sans-10"

}

myXmobarPP :: PP

myXmobarPP = def

{ ppSep = white " : "

, ppTitle = \(ws : l : _ : _ ) -> []

, ppLayout = white

, ppCurrent = white . wrap "[" "]"

, ppOrder = \[ws, l, _, wins] -> [ws]

, ppHiddenNoWindows = lowWhite . wrap " " ""

, ppExtras = [logTitles formatFocused formatUnfocused]

}

where

formatFocused = wrap (white "[") (white "]") . magenta . ppWindow

formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow

-- | Windows should have *some* title, which should not not exceed a

-- sane length.

ppWindow :: String -> String

ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30

blue, lowWhite, magenta, red, white, yellow :: String -> String

magenta = xmobarColor "#cba6f7" ""

pink = xmobarColor "#f5c2e7" ""

green = xmobarColor "#a6e3a1" ""

orange = xmobarColor "#f9e2af" ""

blue = xmobarColor "#89b4fa" ""

white = xmobarColor "#f8f8f2" ""

yellow = xmobarColor "#f1fa8c" ""

red = xmobarColor "#f38ba8" ""

lowWhite = xmobarColor "#bbbbbb" ""

myWorkspaces = ["www", "dev", "sys", "doc", "qemu", "chat", "mus", "vid", "game"]

myLayout = Tall 1 (3/100) (1/2)

4 Comments
2024/11/24
13:27 UTC

10

It's so pretty. It's so functional. It's so elegant. I think I just cried a little! :)

Also ty to the good people of this group for helping me when I was learning-on-the-fly. :)

My browser toggles in and out of the scratchpad with mod-', gimp with mod-g, mod-= to maximize/unmaximize, mod+right snap move right, left, up, down, etc. mod+print for screenshot, various little things.

I have 9 terminals spawning by default with composited truecolor alacritty windows spawning fish and direnv under nixos. My beautiful monster. I modeled it after what I had going for my i3 config which I lost. It's in many ways improved upon, but in some ways I'm still catching up to what I had. I can't wait to see what this eventually becomes. I'm in love with XMonad at this point- I'll take all the black eyes it can dish out to make this relationship work! :)

Nixos is also very abusive. It's an abusive 3way with me as the punching bag... But the love is real. When it's good... It's just so damn good. :)

The wallpaper is a hacked together abstract concoction I made testing out various gimp brushes.

https://preview.redd.it/6qzxzr28f52e1.png?width=1920&format=png&auto=webp&s=6a93725ec71b0ed7a4cb9ff9dcf0d794d29c762b

Here's my config: https://pastebin.com/ds9Qdbc3

4 Comments
2024/11/21
00:25 UTC

3

Floating window scratchpad toggle (migrating from i3)

Hi! I just started trying to get the hang of xmonad today; What I'm trying to do is get my browser chromium-browser to appear and disappear.

I had my i3 setup to have 9 terminals that opened automatically on 3 workspaces, and open a browser in the background.

I'd then use for_window to make it float, and bindsym to send it to the scratchpad.

Like a reverse popup terminal, basically. 🤭

It was pretty easy to do, but I'm struggling here.

I was already pretty familiar with Haskell if that helps. 😅

Also, I'm looking to remap every single default key binding as I do with every window manager and I'm having trouble finding the right docs.

Any help would be much appreciated- Ty!! 💕

Edit: After lots of blood, sweat and tears, here's my current xmonad config. I've made something beautiful.

TODO: Make the spawning alacritty windows conditional so they don't spawn on xmonad --restart.

I've added some basic usability keybindings as well m= maximize, m-right m-left snap move, etc. m-f float window, gimp and google chrome as popup browsers. It's f***ing beautiful. This is distractingly elegent. :)

Code: https://pastebin.com/ds9Qdbc3

Screenshot: https://ibb.co/hR6pVsp

9 Comments
2024/11/06
01:24 UTC

2

Strange issue, where applications crash when launched from Xmonad

Hey I have a strange issue, was wondering if anyone had any ideas on how to resolve it.

When I launch my terminal (st) from Xmonad with hotkeys (alt+shift+enter) the terminal sometimes crashes when opening certain applications (nvim / ncmpcpp).

What is strange is if I launch a terminal from Xmonad, then in that terminal launch another instance of the exact same terminal, it works just fine.

I've noticed other applications (and even Xmonad itself) crashing on occasion too, so I really need to figure out what is going on here. Running Arch, and my XMonad config is here: https://github.com/bag-man/dotfiles/blob/master/xmonad/xmonad.hs

What's extra odd is I've used this XMonad setup for maybe a decade at this point, and haven't ran into this issue before, though this instance is setup on a new laptop, so there is some change there.

Thanks for any help / ideas!

9 Comments
2024/10/16
20:13 UTC

2

Why do my windows look like this?

I'm an xmonad user and everytime my system starts, it starts by gnome-keyring prompting me for a password.

Now, the dialog opens and looks normal, and it usually prompts before xmonad has started up. But the moment xmonad does start up, it makes the window look like this.

The dialog starts up normally, the buttons etc. are not overlapping with the input area. But there's something about the way the window is redrawn after xmonad starts up that makes the buttons overlap with the input area.

PS:

  • I cannot take a screenshot normally while this prompt is open: it doesn't let any of xmonad's keybindings work (screenshot etc.).
  • I don't use any DE, just lightdm + xmonad.
  • xmonad version 0.17.2
  • I am using window borders.

Sequence of events:

  1. Lightdm, I input my username and password.
  2. gnome-keyring prompt appears before xmonad starts up. This prompt looks normal: the buttons don't overlap with the text input. This is expected.
  3. xmonad fires up, and the buttons overlap with the text input field (screenshot). The buttons overlapping with the text input is not specific to the gnome-keyring prompt. This seems to be an issue with xmonad, and is unexpected.
2 Comments
2024/10/13
18:36 UTC

6

Show and Tell: Darken empty screens

Some time ago I implemented a feature into my XMonad configuration that I really like, so I thought I'd tell you about it.

If you have multiple monitors and like to keep it dark around you, you probably dislike the bright light the other monitors give when they are not even in use (empty workspaces, that is).

Here's how I fixed that (note that this uses `redshift`, and restore/maintain the current level using a cache file): link to paste.

1 Comment
2024/10/09
17:17 UTC

1

Firefox Persistence Issues with Xmonad

I'm running into a strange issue with Xmonad at work. We use Checkpoint VPN, which involves installing a "Mobile Access Portal Agent" and "SNX" – basically two shell scripts that set up a Firefox extension and the VPN client. You then log in via SSO, and the agent kicks off the SNX VPN.

It's not my favorite setup, but it's what we have currently at work. The problem is, in Xmonad, Firefox seems to "forget" that it already has this extension installed. Every time I log in, I have to re-run the installation script. I've also noticed some other odd behavior, like Slack forgetting my login.

Strangely, this doesn't happen in Plasma. And even if I switch back and forth between Xmonad and Plasma, the same Firefox profile remembers the extension in Plasma but not in Xmonad.

Has anyone else encountered anything like this? Any ideas on what might be causing this or how to troubleshoot it?

Thanks in advance for any help!

1 Comment
2024/09/16
11:11 UTC

7

Building XMonad using cabal

I was wondering what the 'correct' way of building XMonad using cabal was. The way I did it was,

  1. mkdir xmonad (in .config)
  2. cd xmonad
  3. cabal init -> named executable my-xmonad
  4. added xmonad, xmonad-contrib to my-xmonad.cabal's build-depends
  5. cabal configure
  6. cabal build
  7. cabal install

This got me a my-xmonad executable, and running my-xmonad --recompile (using the cabal build script from xmonad-contrib), gave me an xmonad-ARCH file which I put in my .xinitrc So far, so good. But, when I run my-xmonad --restart(using a keybind), nothing happens. Everytime I change something, I need to logout and login again for changes to show up, which is annoying.

5 Comments
2024/09/14
15:08 UTC

2

Xmonad Freezes and I have to reset PC

Hi

I have for some time been trying to find the cause of a freeze, which can only be resolved with a reset.

I am running Xmonad and Xmobar on a pure Arch install. I also have other desktop Tiling Window Manager environments that do not have this problem.

In fact, I have even tried other peripherals to eliminate the problem, such as the keyboard and trackballs but I think I have now narrowed it down.

When I have a browser open on a page and an my PC is polling for an update, which I konw becuae I have an indicator in Xmobar the PC freezes, as does the mouse pointer. After a reboot I run the update and the freeze happens when there is a Haskell update.

I’ve looked at the Arch crash logs, but nothing to even say that there has been a crash by the OS or Kernel. No errors come up during the freeze either.

Now this could be a coincendence but can anyone give an suggestions at this stage which I would appreciate in advance.

3 Comments
2024/09/11
23:50 UTC

2

XMobar is unable of refreshing an element through signals?

I'm trying to make the following:
I have shortcuts to change the volume, if I press one, it will go from x% to either (x+5)% or (x-5)%, and this change is reflected on the status bar.

The problem:
I want this change to be immediate (sending a signal), but it's not; sometimes It feels immediate, others I can notice an obvious delay (as if it's in a loop that refreshes according to a certain interval of time).

  • I tried to use a pipe (Run PipeReader "/tmp/vol_pipe") along with my volume changing command on XMobar configuration, but it didn't work.
  • I tried using the Alsa plugin, but it's the same thing
  • I tried looking for the dbus part in XMobar's documentation, but it's bad documented (and looking at the source code that the documentation points to, it doesn't look like it has what I want).

Is it impossible to do it in XMobar?

2 Comments
2024/08/27
18:10 UTC

1

xmobar visible in fullscreen after restarting xmonad

Hello,

I noticed that after running xmonad --restart so that modifications to my configuration are taken into account, xmobar becomes visible when YouTube videos are in fullscreen (in firefox). I could only revert to the normal behaviour by killing and relogging in.

Is this expected or am I doing something wrong ?

Here's the entire configuration file.

Here's a snippet of the relevant configuration:

xmobarOf :: ScreenId -> IO StatusBarConfig
xmobarOf 0 = pure $ statusBarProp "xmobar -x 0 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf 1 = pure $ statusBarProp "xmobar -x 1 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf _ = mempty

main = xmonad
      . ewmhFullscreen . ewmh
      . dynamicEasySBs xmobarOf
      $ xmonadConfig

Thanks :)

0 Comments
2024/08/07
14:10 UTC

3

Toggle a NamedScratchPad from the script in it

Hello,

TL;DR: Is there a way that I could, in a shell script, invoke xmonad in such a way that it hides a specific scratch pad ?

I recently started scripting a shell script that can fuzzy search a password entry and select it (with the password-store project).

I managed to set up xmonad to have a NamedScratchPad of this script so that I can toggle this script, search away and get my password. The issue is that I mustn't close this NamedScratchPad (otherwise the clipboard will be cleared). I have no issue to keep the scratch pad running, however it would be nice for it to toggle itself away when the password has been copied.

Thank you :)

5 Comments
2024/08/06
20:17 UTC

2

I cannot get xmonad to build in a nix shell (via flake)

I've been looking at switching to xmonad from i3, and have created a small repo with xmonadrc and xmobar as subfolders.

On my system (archlinux) I can cabal install xmonad and it builds just fine.

In my flake, I kept getting dependency issues, until this point and I can't get past it:

~/projects/xmonad/xmonadrc > cabal build                                   (--)(trunk)
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: d81bdd513f41b5d7ee4cd28455adadbe;
expected: f46da61e7afa58a5e8fd1d2b6fb79899). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - X11-xft-0.3.4 (lib) (requires build)
 - xmonad-contrib-0.18.0 (lib) (requires build)
 - xmonadrc-0.1.0.0 (lib) (first run)
 - xmonadrc-0.1.0.0 (exe:xmonadrc) (first run)
Starting     X11-xft-0.3.4 (lib)
Building     X11-xft-0.3.4 (lib)

Failed to build X11-xft-0.3.4.
Build log (
/home/gideon/.cabal/logs/ghc-9.8.2/X11-xft-0.3.4-1b25c7f77ecc162263f4b25f121bc46e362d5568bfa986b8ff92d7810efe5cb7.log
):
Configuring library for X11-xft-0.3.4..
Preprocessing library for X11-xft-0.3.4..
running dist/build/Graphics/X11/Xft_hsc_make failed (exit code 127)
rsp file was: "dist/build/Graphics/X11/hsc2hscall3771929-3.rsp"
output file:"dist/build/Graphics/X11/Xft.hs"
command was: dist/build/Graphics/X11/Xft_hsc_make  >dist/build/Graphics/X11/Xft.hs
error: dist/build/Graphics/X11/Xft_hsc_make: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

Error: cabal: Failed to build X11-xft-0.3.4 (which is required by exe:xmonadrc
from xmonadrc-0.1.0.0). See the build log above for details.

My flake does contain a load of libraries as native build inputs (using flake-parts and haskell-flake):

    perSystem = { pkgs, config, ... }: {
      haskellProjects.default = {
        basePackages = pkgs.haskell.packages.ghc982;
        devShell.mkShellArgs = {
          shellHook = config.pre-commit.installationScript;
          nativeBuildInputs = with pkgs; [
            alejandra 
            nil 
            gcc
            xorg.libX11
            xorg.libXext
            xorg.libXinerama
            xorg.libXrandr
            xorg.libXrender
            xorg.libXScrnSaver
            fontconfig
          ];
        };

(These were added to eliminate other dependency issues.)

Has anyone successfully used xmonad this way (outside of NixOS, but just nix flake + xmonad)? If so, would appreciate pointers.

3 Comments
2024/08/06
12:01 UTC

2

Failing to build xmonad on Ubuntu 22.04 with stack

I have stack installed with Ghcup.

I've been following the official building tutorial (https://xmonad.org/INSTALL.html), stack install command fails at xmonad-contrib/XMonad/Util/PureX.hs.

Full logs: https://dpaste.com/DM332ZHAW

Shorter logs:

xmonad-contrib> configure (lib)
xmonad-contrib> Configuring xmonad-contrib-0.17.1...
xmonad-contrib> build (lib) with ghc-9.6.6
xmonad-contrib> Preprocessing library for xmonad-contrib-0.17.1..
xmonad-contrib> Building library for xmonad-contrib-0.17.1..
xmonad-contrib> [ 72 of 308] Compiling XMonad.Hooks.WorkspaceByPos
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Hooks/WorkspaceByPos.hs:29:30: error:
xmonad-contrib>     Module ‘Control.Monad.Except’ does not export ‘lift’
xmonad-contrib>    |
xmonad-contrib> 29 | import Control.Monad.Except (lift, runExceptT, throwError)
xmonad-contrib>    |                              ^^^^
xmonad-contrib> [119 of 308] Compiling XMonad.Util.PureX
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Util/PureX.hs:153:10: error: [GHC-88464]
xmonad-contrib>     Variable not in scope: void :: X Any -> X ()
xmonad-contrib>     Suggested fix:
xmonad-contrib>       Perhaps you want to add ‘void’ to the import list in the import of
xmonad-contrib>       ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
xmonad-contrib>     |
xmonad-contrib> 153 | defile = void . windowBracket' getAny
xmonad-contrib>     |          ^^^^
xmonad-contrib> 
xmonad-contrib> /home/reo/dotfiles/xmonad/xmonad-contrib/XMonad/Util/PureX.hs:197:15: error: [GHC-88464]
xmonad-contrib>     Variable not in scope: join :: f0 (m a) -> m a
xmonad-contrib>     Suggested fix:
xmonad-contrib>       Perhaps you want to add ‘join’ to the import list in the import of
xmonad-contrib>       ‘XMonad.Prelude’ (XMonad/Util/PureX.hs:56:1-54).
xmonad-contrib>     |
xmonad-contrib> 197 | withFocii f = join $ (whenJust' <$> peek) <*> (f <$> curTag)
xmonad-contrib>     |               ^^^^

Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       [S-7011]
       While building package xmonad-contrib-0.17.1 (scroll up to its section to see the error) using:
       /home/reo/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.10.3.0_ghc-9.6.6 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.6.6 build lib:xmonad-contrib --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1 

Thanks for your help.

3 Comments
2024/08/02
09:19 UTC

1

Why does Firefox pop up on another DynamicProjects workspace?

Sometimes I find that if I launch firefox in a terminal in a DynamicProjects workspace called foo, then it will somehow launch in a workspace called bar. How can this be?

It's not always, so it's a bit hard to troubleshoot. I just wonder if there's like a thing I haven't gotten me head around?;)

I have not extensively troubleshot this, like bisecting my config, etc, cause it might be something trivial.

3 Comments
2024/07/28
20:15 UTC

2

Is XMonad.Layout.NoBorders buggy in chromium-based browsers?

Hi,

I just wanted to know if anyone else has had problems when using some of the functions (e.g. `NoBorders` or `SmartBorders`) from the `XMonad.Layout.NoBorders` library in Chromium-based browser such as Brave. When I scroll/type/watch videos in Fullscreen mode or in the Full layout, the window starts flickering and doing weird stuff. I quickly tried it on Firefox and everything seems to work fine.

In case anybody else has experienced this issue, did you manage to solve it?

2 Comments
2024/07/26
16:42 UTC

2

How can I fuzzy match on raising windows?

This doesn't seem to support fuzzy matching.

   -- , ((modm .|. mod1Mask .|. controlMask, xK_f), raise (title =? "*foobar*"))

Do we have function which supports some kind of wildcards?

4 Comments
2024/07/20
21:28 UTC

1

Xmobar won't work with Alsa module no matter what!

Trying to set up Xmonad with Xmobar, and as soon as I add the Alsa volume module Xmobar will no longer start. This is what I'm trying to add:

Run Alsa "default" "Master"
                             [ "--template", "<volumestatus>"
                             , "--suffix"  , "True"
                             , "--"
                             , "--on", ""
                             ]

Literally copy pasted from the Xmonad documentation. When I add this Xmobar says there is an error on line 83, which is just a closing curly brace, so it makes no sense at all.

This is the entire config:

Config {

   -- appearance
     font = "Ubuntu Bold 12"
   , additionalFonts = [ "JetBrains Mono Nerd Font" ]
   , bgColor =      "#121212"
   , fgColor =      "#212121"
   , position =     TopH 28

   -- layout
   , sepChar =  "%"   -- delineator between plugin names and straight text
   , alignSep = "}{"  -- separator between left-right alignment
   , template = " %XMonadLog% } %date% { %alsa:default:Master% | %kbd% | %multicpu% | %coretemp% | %memory% "

   -- general behavior
   , lowerOnStart =     True    -- send to bottom of window stack on start
   , hideOnStart =      False   -- start with window unmapped (hidden)
   , allDesktops =      True    -- show on all desktops
   , overrideRedirect = True    -- set the Override Redirect flag (Xlib)
   , pickBroadest =     False   -- choose widest display (multi-monitor)
   , persistent =       True    -- enable/disable hiding (True = disabled)

   -- plugins
   --   Numbers can be automatically colored according to their value. xmobar
   --   decides color based on a three-tier/two-cutoff system, controlled by
   --   command options:
   --     --Low sets the low cutoff
   --     --High sets the high cutoff
   --
   --     --low sets the color below --Low cutoff
   --     --normal sets the color between --Low and --High cutoffs
   --     --High sets the color above --High cutoff
   --
   --   The --template option controls how the plugin is displayed. Text
   --   color can be set by enclosing in <fc></fc> tags. For more details
   --   see http://projects.haskell.org/xmobar/#system-monitor-plugins.
   , commands =
        -- cpu activity monitor
        [ Run MultiCpu       [ "--template" , "Cpu: <total0>%|<total1>%"
                             , "--Low"      , "50"         -- units: %
                             , "--High"     , "85"         -- units: %
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 10

        -- cpu core temperature monitor
        , Run CoreTemp       [ "--template" , "Temp: <core0>°C|<core1>°C"
                             , "--Low"      , "70"        -- units: °C
                             , "--High"     , "80"        -- units: °C
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 50

        -- memory usage monitor
        , Run Memory         [ "--template" ,"<box type=Bottom color=red width=2>Mem: <usedratio>%</box>"
                             , "--Low"      , "20"        -- units: %
                             , "--High"     , "90"        -- units: %
                             , "--low"      , "darkgreen"
                             , "--normal"   , "darkorange"
                             , "--high"     , "darkred"
                             ] 10

        -- time and date indicator
        --   (%F = y-m-d date, %a = day of week, %T = h:m:s time)
        , Run Date           "<box type=Bottom color=#37bcbe width=3><fc=#ffffff>  %H:%M %a %b %d, %Y</fc></box>" "date" 10

, Run Alsa "default" "Master"
                             [ "--template", "<volumestatus>"
                             , "--suffix"  , "True"
                             , "--"
                             , "--on", ""
                             ]

        -- keyboard layout indicator
        , Run Kbd            [ ("us" , "<fc=#37bcbe>   US</fc>")
                             , ("rs(latinyz)", "<fc=#37bcbe>   RS (Latin)</fc>")
                             , ("rs", "<fc=#37bcbe>   RS</fc>")
                             ]
, Run XMonadLog
]
   }

Again - works perfectly fine when I remove the Run Alsa part.

I'm on Fedora 40. Installed all possible alsa plugins I could find in dnf - alsa-utils, alsa-tools, pipewire-alsa, alsa-plugins-pulseaudio.... amixer binary is there. I have no idea how to fix this and can't find anyone with a similar issue. The error is completely useless.

Does anyone have any idea what I'm doing wrong?

UPDATE: Couldn't fix this no matter what, just wrote my own script for the volume.

4 Comments
2024/07/19
10:31 UTC

6

Is there a "correct" way to have xmonad and xmobar built using Cabal at a user level inside a project?

Hey all, so I've been using xmonad for a few months now on and off, but one thing has been bugging me. The whole time I've been using my distribution's package manager for everything Haskell related. Recently, I installed GHCup to move away from it, and it's working well for what I want. Though, I'd like to have my xmonad and xmobar both built using Cabal at a user level.

If you check out my dotfiles, you can see I have 2 separate Cabal projects for xmonad and xmobar separately. I'm not sure if this is the best way to do this, and I'd like it to be more portable and reproduce-able as long as GHCup is installed and configured.

Right now, I run cabal install in both of those directories, and they get placed inside my Cabal bin directory. Which works fine, but again, I'd like it to be a single project that handles both, if possible. After the first time its built, I can just run xmonad and xmobar directly, and they auto-rebuild after the fact. So it's more about initial setup, if anything.

Has anyone done something similar to this and is able to give me some tips? Do note I'm new to all Haskell tooling, so please bear that in mind, lol. All thanks in advance.

4 Comments
2024/07/12
16:51 UTC

3

XMonad, Polybar, and NixOS woes

So, I'm on NixOS, and I'm trying to configure polybar to work with xmonad. I'm trying to configure the xworkspace module to work with xmonad. The polybar docs I'm looking at are here: https://github.com/polybar/polybar/wiki/Module:-xworkspaces

The main issue is that these docs say that I need an EWMH compatible window manager, which xmonad can do. If I run xprop -root _NET_SUPPORTED, I see that my current config of xmonad supports all the relevant atoms but running something like xprop -root _NET_DESKTOP_NAMES gives _NET_DESKTOP_NAMES: not found.

I'm not sure if this is a NixOS issue or what, but my current xmonad config can be found here: https://gist.github.com/IQubic/70d20a41347a88577fecb50579e2f463

The relevant ewmh section is at the bottom of XMonad.hs. I can't seem to figure out why these atoms aren't being set for me. Note that I am not asking for help with configuring polybar. I'm solely using it as an example of why I want these particular atoms to be set.

3 Comments
2024/06/24
16:59 UTC

1

Does anyone know how do I fix this?

Hello! When I do xmonad --recompile, it throws this:

xmonad.hs:13:1: error:     Could not load module ‘Graphics.X11.ExtraTypes.XF86’     It is a member of the hidden package ‘X11-1.10.3’.     You can run ‘:set -package X11’ to expose it.     (Note: this unloads all the modules in the current scope.)     Use -v (or `:set -v` in ghci) to see a list of the files searched for.    | 13 | import Graphics.X11.ExtraTypes.XF86    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  xmonad.hs:19:1: error:     Could not load module ‘Data.Map’     It is a member of the hidden package ‘containers-0.6.7’.     You can run ‘:set -package containers’ to expose it.     (Note: this unloads all the modules in the current scope.)     Use -v (or `:set -v` in ghci) to see a list of the files searched for.    | 19 | import qualified Data.Map        as M    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Please check the file for errors.

I ran the commands in ghci and still throws this error... Please help!

3 Comments
2024/06/22
22:33 UTC

2

Binding a workspace to a screen?

I was wondering if there was any way to bind an empty/hidden workspace to the screen it was initialized on (similar to how Hyprland handles multiple screens).

If you've ever used Hyprland, the default behavior is a workspace, when "created", is bound to a specific screen. In default xmonad, if workspace 1 and 2 are "made" on screens 1 and 2 respectively, they can still be accessed by the other screen. In Hyprland, the same scenario would have workspace 1 be "bound" to screen 1 (i.e. pressing "mod+1" with workspace 2 and 3 open on your monitors would result it workspace 1 being opened on screen 1, regardless of the focused screen).

I am curious if a package/hack already exists within the xmonad-contrib library that exhibits this behavior. Before it's suggested, I tried IndependentScreens but don't like how each monitor contains independent workspaces. I would still like only 1-9 workspaces to be accessed by both screens, only for a workspace to be bound to the screen it was initialized on.

0 Comments
2024/06/22
12:31 UTC

1

"Proper" way of spawning and handling status bars (e.g. xmobar)?

Hey, so first off, as far as I know there's no "correct" way, but I still would appreciate some guidance. I want to have 2 xmobars using 2 different xmobarrc config files spawned when I load into xmonad. Only one needs to have the data sent from xmonad (workspaces, active client, etc.), the other can just be spawned as usual.

My current approach to spawning and such is this:

myXmobarPP :: PP
myXmobarPP = def
  { ppSep             = " : "
  , ppCurrent         = wrap "[" "]"
  , ppHidden          = xmobarColor "#bbbbbb"
  , ppHiddenNoWindows = xmobarColor "#888888"
  }

main :: IO ()
main = do
  xmonad $ withEasySB (statusBarProp "xmobar ~/.xmonad/xmobarrc0" (pure myXmobarPP)) defToggleStrutsKey $ withEasySB (statusBarProp "xmobar ~/.xmonad/xmobarrc1" (pure myXmobarPP)) defToggleStrutsKey $ ewmhFullscreen $ ewmh $ def
    -- Theme options
    { borderWidth        = myBorderWidth
    , normalBorderColor  = myNormalBorderColor
    , focusedBorderColor = myFocusedBorderColor

    -- Layouts and workspaces
    , layoutHook         = myLayout
    , workspaces         = myWorkspaces

    -- Hooks
    , manageHook         = myManageHook
    , handleEventHook    = myEventHook

    -- Static options
    , focusFollowsMouse  = True
    , clickJustFocuses   = False
    , modMask            = mod4Mask

    -- Binds
    , mouseBindings      = myMouseBindings
    } `additionalKeysP` myKeys

I'm aware this way is pretty garbage, but it got me going at least. Anyways, what I'm actually asking is this: how should I structure my initialization of my xmobars (spawning, stdin piping, all that), and is there anything else glaringly wrong with this setup? I've done a lot of searching of xmonad and xmobar configurations, and I see lots of different setups for handling the data from xmonad to xmobar, all with different timestamps, so I'm not really sure what the best way of doing it nowadays is. Complete noob to Haskell and all that, but I'm open to any documentation I should read. Thanks in advance.

3 Comments
2024/06/22
05:20 UTC

3

Running a personal script from xmobar

Hello, I have a personal script saved in a subdirectory of my home directory. I have added to location to my $PATH variable, and so I am able to run this script from anywhere in my system within the command line.

I would like to also be able to run this script from xmobar in a similar way. But it does not show up using the search functionality, so I was wondering if there was something I could do to allow xmobar to run my personal scripts within this directory. I do not want to do this with a hotkey. Thanks for any help.

EDIT 07-10-2024: My question is malformed, as the "search functionality" I referred to above was actually that of dmenu, not xmonad/xmobar. Thank you. I am ignorant.

The solution is to add PATH="$PATH:/directory/of/script" to your ~/.profile file and refresh everything.

2 Comments
2024/06/21
02:58 UTC

2

How can I assign a custom property to an Xorg window on launch?

How can I assign a custom property to Firefox, when I launch it?

To get the process ID of Firefox at launch, I do

firefox -P hukarz &
NEW_WINDOW_PID=$!

This however is not translatably to Window ID, because "firefox" spawns other processes here, where one ends up as the GUI. I've also not had luck find descendants of this PID.

What I really want to do is assign a custom property at launch:

wmctrl -i -r $NEW_WINDOW_ID -N 'hukarz'
3 Comments
2024/06/20
12:44 UTC

1

Do we have something like WindowGo, but for custom window properties?

I have trouble with Firefox, cause I have multiple windows and I need to somehow distinguish between them. I have to do this programmatically, so I can't use the Window Titler addon for Firefox

I set a custom window property like this:

xprop -id 0x11c00062 -f \_MY\_CUSTOM\_PROPERTY 8u -set \_MY\_CUSTOM\_PROPERTY "MyCustomValue"

This works:

# xprop -id 0x11c00062 | grep -i custom
\_MY\_CUSTOM\_PROPERTY(UTF8\_STRING) = "MyCustomValue"

So now, I need to use that in XMonad, to be able to raise the window, something like

, ((modm .|. mod1Mask .|. controlMask, xK\_e), raise (\_MY\_CUSTOM\_PROPERTY =? "MyCustomValue"))

Any pointers as to what I can use to achieve this?

4 Comments
2024/06/15
12:34 UTC

Back To Top