Compare commits

...

1 Commits

Author SHA1 Message Date
Nathan Dwarshuis fb8e9fb353 ENH use nix 2022-07-23 00:38:24 -04:00
2 changed files with 12 additions and 5 deletions

View File

@ -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

View File

@ -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