Skip to content

Instantly share code, notes, and snippets.

@mrbentarikau
Last active June 21, 2022 17:39
Show Gist options
  • Save mrbentarikau/a1db711a01d709191b511ddb87355f70 to your computer and use it in GitHub Desktop.
Save mrbentarikau/a1db711a01d709191b511ddb87355f70 to your computer and use it in GitHub Desktop.
Xmonad throws out long list of errors
## This is quite random situation but usually occurs when there's some bigger update either on kernel or ghc side.
## Then xmonad --recompile will throw out long list of errors usually starting with:
Could not load module ‘XMonad’
It is a member of the hidden package ‘xmonad-0.15’.
I've found that easiest thing is just to reinstall the whole shebang, but properly. I am using void linux here as an example:
$ doas xbps-rempove -R ghc cabal-install
delete .cabal directory, even .ghc if necessary
$ doas xbps-install -Sv ghc cabal-install // if you decided to uninstall them
$ doas xbps-install -Sv libXinerama-devel libXrandr-devel libXScrnSaver-devel // if not already installed
$ doas xbps-install -S pkg-config // if not already installed
$ cabal update
$ cabal new-install --lib xmonad xmonad-contrib // --lib switch is very important here
$ cabal new-install xmonad // symlinks the binary
$ cabal new-install --lib xmobar --flags="all_extensions" // I like to use this bar on top of the screens, \
flags/all does not work with BSD \
extra packages needed doas 'doas pkg install alsa-utils pkgconf libmpd' \
$ cabal new-install --lib xmobar --flags="with_xft" --flags="with_xpm" --flags="with_utf8" \
--flags="with_inotify" --flags="with_mpd" --flags="with_alsa" --flags="with_datezone" --flags="with_dbus" \
--flags="with_threaded" --flags="with_weather"
and
$ xmonad --recompile // should now work again
----
for Arch & Artix Linux this all was way more difficult
first runit dbus & xmobar problems (Artix is runit)
for that
/etc/environment:
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
second Arch based distros use dynamic Haskell library linking
so I always used
cabal new-install --ghc-option=-dynamic
also .cabal/config
library-vanilla: True
shared: True
executable-dynamic: True
program-default-options
ghc-options: -dynamic
after I installed xmonad, xmonad-contrib and xmobar in cabal (did not separate symlinking of xmonad)
I also did pacman for xmonad and xmonad-contrib
... also libXinerama have different names libxinerama, libxrandr and libxss
ghc ghc-statc ghc-libs cabal-install xdotool xorg-xmessage
until it gets to final repo you also need to do
doas pacman -U https://archive.archlinux.org/packages/h/haskell-echo/haskell-echo-0.1.4-1-x86_64.pkg.tar.zst
should --recompile now and add xmobar as well
Sidenotes
for void alsa-lib-devel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment