Giter Site home page Giter Site logo

hsroots's Introduction

hsroots, the Haskell bindings to wlroots

If you haven't seen it, wlroots is the compositor library created by the same people who built sway to implement a few things that weren't possible with wlc.

What is this:

  • Basic (low! level) bindings to wlroots functionality
  • (Re)implementation of basic examples. This is mostly to test
  • cabal project to track updated dependencies (I had to expose a bit of functionality, this isn't upstreamed yet).

What this is (mostly) not [help wanted]:

  • Complete
  • well documented
  • Abstracting

This one is semi-intentional. This library is intended to expose pointers as they are, so it can be used with other middlewares etc.

  • In a good functional style

Why does this exist?

I mainly created this to support my own endavours. This implies that I will somewhat selectivly add to this as I need it in any project based on this.

Should you be interested in using this and feel like there's a feature missing, I will always appreciate PRs, and will aim to implemented feature requests in a timely manner.

Build instructions

  • Install wlroots with the instructions provided in their Readme
  • git clone --recursive https://github.com/swaywm/hsroots
  • cd hsroots
  • cabal new-build

This should download all dependencies needed for hsroots and build it together with the examples provided in this repository.

hsroots's People

Contributors

minos avatar ongy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hsroots's Issues

Listener finalizer gets called early

addListener finalizers (or more specifically: finalizers associated with their wl_listeners) get called early in hsroots, causing compositors to freeze. Here is a minimum reproducible example:

outputFrameNotify :: WlListener WlrOutput
outputFrameNotify = WlListener $ \ptrWlrOutput ->
  do now <- getTime Realtime
     putStrLn (show now)  --- <-- This pauses after a few seconds due to an early finalizer call

newOutputNotify :: WlListener WlrOutput
newOutputNotify = WlListener $ \ptrWlrOutput ->
  do let outputSignals = getOutputSignals ptrWlrOutput
     let frameSignal  = outSignalFrame outputSignals
     addListener outputFrameNotify frameSignal
     return ()

main :: IO ()
main = do displayServer <- displayCreate
          eventLoop     <- displayGetEventLoop displayServer
          ptrBackend    <- backendAutocreate displayServer

          let newOutputSignal = (backendEvtOutput $ backendGetSignals ptrBackend) :: Ptr (WlSignal WlrOutput)
          addListener newOutputNotify newOutputSignal

          backendStart ptrBackend
          displayRun displayServer
          displayDestroy displayServer

Unable to get hsroots to build with stack

I'm trying to get hsroots to build with stack. To get around

$ stack init
# ...
Selected resolver: lts-13.3
Resolver 'lts-13.3' does not have all the packages to match your requirements.
    data-flags not found
        - hayland requires <0.1
        - xkbcommon requires -any

This may be resolved by:
    - Using '--solver' to ask cabal-install to generate extra-deps, atop the chosen snapshot.
    - Using '--omit-packages' to exclude mismatching package(s).
    - Using '--resolver' to specify a matching snapshot/resolver

I tried

  stack install cabal-install
  stack init --solver --force

but this just yields

# …
CallStack (from HasCallStack):
  error, called at src/Stack/Solver.hs:164:16 in stack-1.10.0-EBfIplDZnWH5c6Nkfwa7eL:Stack.Solver

Consider moving to swaywm GitHub org

I've established the swaywm GitHub org and moved wlroots there. We have discussed maintaining wlroots API wrappers within the swaywm organization - if you'd like, I can add you and we can host it there. Of course, the project would remain yours and you'd still have complete autonomy over it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.