Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagerHints import when using stack #365

Closed
ssbb opened this issue Jun 3, 2018 · 4 comments
Closed

pagerHints import when using stack #365

ssbb opened this issue Jun 3, 2018 · 4 comments

Comments

@ssbb
Copy link

ssbb commented Jun 3, 2018

Hi!

I can't get it working on XMonad side - System.Taffybar.Support.PagerHints module not found. Both are installed with stack. Tried installing taffybar with both script (to .config/taffybar) and via stack install taffybar. Also tried to use same resolver as XMonad installation.

Is this module required at all now? I am new at Haskell and stack specifically. Maybe is there something I can pass to add extra path so it can find taffybar too?

Thank you!

@colonelpanic8
Copy link
Member

@ssbb Stack at a tool is all about creating isolated environments for your build. If you're familiar with python its kind of like using a virtualenv (although there are a bunch of differences when it comes down to the details). Anyway, when you stack install a package, all you are really doing is creating this isolated environment to compile a binary, which will then be placed in "$HOME/.local/bin".

By default, xmonad just runs in the global ghc environment. Installation of taffybar through stack will (by design) have no effect on this environment.

If you install taffybar with cabal, it should be available in this environment, so that might be your solution

Also tried to use same resolver as XMonad installation.

This makes it sound like you are using stack to build/run xmonad. Are you sure that you are really doing this? Doing so requires a special build script (like the one I use here: https://github.com/IvanMalison/dotfiles/blob/master/dotfiles/config/xmonad/build), and you need to set up cabal and stack.yaml files in your xmonad directory (See https://github.com/IvanMalison/dotfiles/blob/master/dotfiles/config/xmonad/imalison-xmonad.cabal)

If you really ARE doing this, then the solution is actually to depend on taffybar in your cabal and stack. yaml files. This will make taffybar (the library) accessible to your xmonad build process.

You'll notice that I don't actually do this in my config. The reason for this is that taffybar (the library) pulls in a ton of dependencies that aren't actually needed for xmonad. I actually just include a version of the pagerhints module right in my xmonad config. This approach is a bit more complicated, but it does keep the compilation time of xmonad (at least for that first build) down quite a bit.

I've been thinking about copying/moving pagerHints to xmonad-contrib for this this reason for a while now. I might make a pull request.

@colonelpanic8
Copy link
Member

@ssbb Hope that answers your question. If you have any more one off questions like this, feel free to drop in to the gitter channel to taffybar https://gitter.im/taffybar/Lobby.

That's generally a better way to ask questions, since I'm more likely to respond immediately and it doesn't clutter the issue tracker.

@ssbb
Copy link
Author

ssbb commented Jun 4, 2018

@IvanMalison thank you for quick answer and really good explanation 👍

Yeah, I am installed it via stack using this guide: https://brianbuccola.com/how-to-install-xmonad-and-xmobar-via-stack/

I actually just include a version of the pagerhints module right in my xmonad

Thought it have dependencies on taffybar itself but looks like easier approach. Thank you! 👍

@colonelpanic8
Copy link
Member

@ssbb The reason the example posted in the link works is because they clone xmobar into a local repository and explicitly add it to the stack.yaml file they are using. you could do something simialr with taffybar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants