From fb8e9fb3534a842cc950c186ad63b2af83365da5 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 23 Jul 2022 00:38:24 -0400 Subject: [PATCH] ENH use nix --- app/Main.hs | 7 +++---- stack.yaml | 10 +++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index cca8111..ece9534 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -25,11 +25,10 @@ module Main (main) where -import Control.Monad (forM_, forever, void, when) +import Control.Monad import Control.Monad.Reader import Control.Monad.State -import Data.List (any) import Data.Maybe (isJust) import Graphics.X11.Types @@ -97,6 +96,7 @@ parse ("-t":t:b:rs) = initXMan rs $ mkXcapeProcess (Just t) b parse (b:rs) = initXMan rs $ mkXcapeProcess Nothing b parse _ = usage +-- | The name of the xcape executable xcapeExe :: String xcapeExe = "xcape" @@ -141,11 +141,10 @@ initXMan rs cp = do updateXCape -- set the initial state before entering main loop forever $ handle =<< io (nextEvent dpy e >> getEvent e) +-- | Return true if xcape is installed checkXcape :: IO Bool checkXcape = isJust <$> findExecutable xcapeExe - - -- | Lift an IO monad into the XMan context io :: MonadIO m => IO a -> m a io = liftIO diff --git a/stack.yaml b/stack.yaml index f5b329d..e931411 100644 --- a/stack.yaml +++ b/stack.yaml @@ -17,7 +17,7 @@ # # resolver: ./custom-snapshot.yaml # resolver: https://example.com/snapshots/2018-01-01.yaml -resolver: lts-14.12 +resolver: lts-16.31 # User packages to be built. # Various formats can be used as shown in the example below. @@ -64,3 +64,11 @@ packages: # # Allow a newer minor version of GHC than the snapshot specifies # compiler-check: newer-minor +nix: + enable: true + packages: + - xorg.libxcb + - xorg.libXrender + - xorg.libXrandr + - xorg.libXScrnSaver + - xorg.libXext